跳转至内容

Odoo 开发与实施交流

No decsciption available
2.3k 主题 10.5k 帖子
  • 版本 7.0 中文社区osbzr版 stock 模块 几个问题临时解决方案

    4
    0 赞同
    4 帖子
    4k 浏览
    Z

    问题2 不修改 代码,用补丁方式 代码

    <br />&lt;!-- 修正 入库单无法输入序列号的问题 --&gt; <br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;record id=&quot;view_picking_in_form&quot; model=&quot;ir.ui.view&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;name&quot;&gt;stock.picking.in.form&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;model&quot;&gt;stock.picking.in&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;inherit_id&quot; ref=&quot;stock.view_picking_in_form&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;arch&quot; type=&quot;xml&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;xpath expr=&quot;//field[@name=&#039;move_lines&#039;]&quot; position=&quot;attributes&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;attribute name=&quot;context&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&#039;address_in_id&#039;: partner_id, &#039;picking_type&#039;: &#039;in&#039;, &#039;form_view_ref&#039;:&#039;view_move_picking_form&#039;, &#039;tree_view_ref&#039;:&#039;stock.view_move_picking_tree&#039;}&quot; options=&#039;{&quot;reload_on_button&quot;: true}<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/attribute&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/xpath&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/record&gt;<br /><br />



    有个需要大神 确认的问题  <record id="view_picking_in_form" model="ir.ui.view">  这个id 是否可以必须和原模块的id不同还是,可以一样?如果可以一样,是不是这个id 在系统中自动加了模块名而区分开了?

  • [bug] Editable List脚本异常

    5
    0 赞同
    5 帖子
    5k 浏览
    wjfonhandW

    firefox 17.0.10
    未见异常

  • Bom展开是如何实现的呢?

    3
    0 赞同
    3 帖子
    1k 浏览
    3

    能不能把代码贴上来呢?谢谢!

  • 【转】OpenERP教程之模块开发及POS模块修改实例

    6
    0 赞同
    6 帖子
    7k 浏览
    C

    [quote author=old_taoist link=topic=14533.msg25081#msg25081 date=1383693049]
    刚刚改了pos的收据打印,从收据打印机的格式改到激光打上。略有心得和吐糟,有空写出来。有需要原码的请留言。
    [/quote]

    直接贴嘛

  • 【转】使用eclipse安装openerp的Debug环境和调试OpenERP的视频教程

    3
    0 赞同
    3 帖子
    3k 浏览
    R

    mark

  • 一张图分析OpenERP的idea模块。图片较大,建议打印出来看。

    3
    0 赞同
    3 帖子
    3k 浏览
    JoshuaJ

    谢谢LZ分享,帮LZ压缩了下图像,版运到这里。

  • 一张图分析OpenERP的idea模块。图片较大,建议打印出来看。

    2
    0 赞同
    2 帖子
    2k 浏览
    尚无回复
  • Xmlrpc,php 操作 OE 的方法 --- 搜索、读取、创建、更新

    5
    0 赞同
    5 帖子
    5k 浏览
    F

    为什么还要直接执行 SQL 语句。。知道 ORM 的概念吗?了解一些 ORM 的操作模式(就是面向对象),你的问题也就不是问题了

  • 关于7.0的主页动作(Home Action)设置无效

    4
    0 赞同
    4 帖子
    4k 浏览
    mrshellyM

    死循环了. ... 我从shine-it 到  oschina. 再由 oschina 到了 shine-it... loooooooops.....

  • Char字段也可以在UI上使用text的widget

    4
    0 赞同
    4 帖子
    2k 浏览
    mrshellyM

    [quote author=rufeng1199 link=topic=14526.msg25013#msg25013 date=1383125624]
    因为oe的开发文档极少,写起代码来畏首畏尾,倒不如大胆的尝试。
    话说,widget只是一个模版,样式的封装单元?如果是,适用性就大大增加了啊
    [/quote]

    对, widget 就是一种模板.  用于展示各种类型的字段.
    so, 如果字段是视频, 字段是音频, 字段是图片, 这些,都可以使用 widget 来实现..

  • [分享]关于如何确认哪些模块继承修改过某对象的方法

    9
    0 赞同
    9 帖子
    7k 浏览
    W

    这个就是我以前想要的东西 总监突破了!!! ;D

  • Mrp.py 中 action_confirm 的一个疑似bug

    4
    0 赞同
    4 帖子
    3k 浏览
    W

    哈哈 我也重构过这块的代码!!我还是放在循环里面的 我_make

    _production_consume_line 方法被我返回成数组了

    <br />class mrp_fresh(osv.osv):<br />&nbsp; &nbsp; _inherit=&#039;mrp.production&#039;<br /><br />&nbsp; &nbsp; def _make_production_consume_line(self, cr, uid, production_line, parent_move_id, source_location_id=False, context=None):<br />&nbsp; &nbsp; &nbsp; &nbsp; stock_move = self.pool.get(&#039;stock.move&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; production = production_line.production_id<br />&nbsp; &nbsp; &nbsp; &nbsp; # Internal shipment is created for Stockable and Consumer Products<br />&nbsp; &nbsp; &nbsp; &nbsp; if production_line.product_id.type not in (&#039;product&#039;, &#039;consu&#039;):<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return False<br />&nbsp; &nbsp; &nbsp; &nbsp; destination_location_id = production.product_id.property_stock_production.id<br />&nbsp; &nbsp; &nbsp; &nbsp; if not source_location_id:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; source_location_id = production.location_src_id.id<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; #TODO 自动选择批次号 先入先出<br />&nbsp; &nbsp; &nbsp; &nbsp; production_lot = self.pool.get(&#039;stock.production.lot&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; #查询该商品所有的批次号信息,是根据批次号的排序查询<br />&nbsp; &nbsp; &nbsp; &nbsp; ids = production_lot.search(cr,uid,[(&#039;product_id&#039;,&#039;=&#039;,production_line.product_id.id)])<br />&nbsp; &nbsp; &nbsp; &nbsp; objects = production_lot.browse(cr,uid,ids)<br />&nbsp; &nbsp; &nbsp; &nbsp; temp_new = &#91;]<br />&nbsp; &nbsp; &nbsp; &nbsp; move_state = &#91;&#039;assigned&#039;,&#039;waiting&#039;]<br />&nbsp; &nbsp; &nbsp; &nbsp; #需求要的数量<br />&nbsp; &nbsp; &nbsp; &nbsp; use_quantity = production_line.product_qty<br />&nbsp; &nbsp; &nbsp; &nbsp; #下面查找符合条件的批次号<br />&nbsp; &nbsp; &nbsp; &nbsp; for obj in objects:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; prodlot_id = obj.id<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #查询该批次号&nbsp; 的商品 所有的待生产&nbsp; 未投料的 数量<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cr.execute(&#039;select sum(product_qty) from stock_move where (state IN %s) and product_id =%s and prodlot_id =%s&#039;,(tuple(move_state),production_line.product_id.id,prodlot_id))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; res = cr.fetchone()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # 已有的生产单的在本批次号中 商品数量&nbsp; 和 本次要的数量 总和 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #等待生产的数量 <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; user_quantity = (res and res[0] and int(res[0])) or 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #需求总量<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; def_quantity = obj.stock_available - user_quantity <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if def_quantity &gt;=use_quantity:#如果需求的数量直接就被该批次满足了情况<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; temp_new.append({&#039;prodlot_id&#039;:prodlot_id,&#039;quantity&#039;:use_quantity})<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else :<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; temp_new.append({&#039;prodlot_id&#039;:prodlot_id,&#039;quantity&#039;:def_quantity})<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; use_quantity -= def_quantity<br />&nbsp; &nbsp; &nbsp; &nbsp; move_ids = &#91;]<br />&nbsp; &nbsp; &nbsp; &nbsp; all_quantity = 0<br />&nbsp; &nbsp; &nbsp; &nbsp; for temp in temp_new:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; all_quantity+=int(temp&#91;&#039;quantity&#039;])<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; if int(production_line.product_qty - all_quantity)&gt;0:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; temp_new.append({&#039;prodlot_id&#039;:None,&#039;quantity&#039;:int(production_line.product_qty - all_quantity)})<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; for new in temp_new:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; move_id = stock_move.create(cr, uid, {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;name&#039;: production.name,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;date&#039;: production.date_planned,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;product_id&#039;: production_line.product_id.id,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #&#039;product_qty&#039;: production_line.product_qty,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;product_qty&#039;: new&#91;&#039;quantity&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;product_uom&#039;: production_line.product_uom.id,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;product_uos_qty&#039;: production_line.product_uos and production_line.product_uos_qty or False,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;product_uos&#039;: production_line.product_uos and production_line.product_uos.id or False,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;location_id&#039;: source_location_id,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;location_dest_id&#039;: destination_location_id,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;move_dest_id&#039;: parent_move_id,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;state&#039;: &#039;waiting&#039;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #&#039;prodlot_id&#039;:prodlot_id,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;prodlot_id&#039;:new&#91;&#039;prodlot_id&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;company_id&#039;: production.company_id.id,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; })<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; production.write({&#039;move_lines&#039;: [(4, move_id)]}, context=context)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; move_ids.append(move_id)<br />&nbsp; &nbsp; &nbsp; &nbsp; return move_ids<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; <br />&nbsp; &nbsp; def action_confirm(self, cr, uid, ids, context=None):<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;&quot; Confirms production order.<br />&nbsp; &nbsp; &nbsp; &nbsp; @return: Newly generated Shipment Id.<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; shipment_id = False<br />&nbsp; &nbsp; &nbsp; &nbsp; wf_service = netsvc.LocalService(&quot;workflow&quot;)<br />&nbsp; &nbsp; &nbsp; &nbsp; uncompute_ids = filter(lambda x:x, [not x.product_lines and x.id or False for x in self.browse(cr, uid, ids, context=context)])<br />&nbsp; &nbsp; &nbsp; &nbsp; self.action_compute(cr, uid, uncompute_ids, context=context)<br />&nbsp; &nbsp; &nbsp; &nbsp; for production in self.browse(cr, uid, ids, context=context):<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shipment_id = self._make_production_internal_shipment(cr, uid, production, context=context)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; produce_move_id = self._make_production_produce_line(cr, uid, production, context=context)<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Take routing location as a Source Location.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; source_location_id = production.location_src_id.id<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if production.bom_id.routing_id and production.bom_id.routing_id.location_id:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; source_location_id = production.bom_id.routing_id.location_id.id<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for line in production.product_lines:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; consume_move_ids = self._make_production_consume_line(cr, uid, line, produce_move_id, source_location_id=source_location_id, context=context)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if shipment_id:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for consume_move_id in consume_move_ids:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; shipment_move_id = self._make_production_internal_shipment_line(cr, uid, line, shipment_id, consume_move_id,\<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destination_location_id=source_location_id, context=context)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self._make_production_line_procurement(cr, uid, line, shipment_move_id, context=context)<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if shipment_id:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; wf_service.trg_validate(uid, &#039;stock.picking&#039;, shipment_id, &#039;button_confirm&#039;, cr)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; production.write({&#039;state&#039;:&#039;confirmed&#039;}, context=context)<br />&nbsp; &nbsp; &nbsp; &nbsp; return shipment_id<br /><br />
  • 解决报表以及表头无法显示中文的问题

    7
    0 赞同
    7 帖子
    8k 浏览
    S

    [quote author=lindongy link=topic=2470.msg8191#msg8191 date=1308542480]
    最新的研究发现,部分报表页眉页脚中文显示方框也是因为所使用的字体不支持中文,可以通过以下方法解决:
    修改base_report_cn中的__init__.py,在其中字体映射表的部分添加两行,如下:
            fontmap = {
                'DejaVu Sans':                  'SimHei',
                'DejaVu Sans Bold':              'SimHei',
    即可。
    [/quote]


    我装的7.0windows版本,安装目录下没找到这个base_report_cn?
    是什么状况啊?

  • (已解决)求助 report rml 的对象类型转换

    7
    0 赞同
    7 帖子
    3k 浏览
    W

    呵呵 这个我老板应该不会同意的 话2000 搞懂这个 呵呵 再次感觉 总监

  • 問題2:如何一口氣建立100個帳號??

    4
    0 赞同
    4 帖子
    3k 浏览
    K

    謝謝分享,我試試~~~ ;D

  • 工作流trigger问题求助(已改用subflow方式,已补充流程说明)

    8
    0 赞同
    8 帖子
    5k 浏览
    J

    [quote author=baggiow link=topic=12684.msg23050#msg23050 date=1382322465]
    [quote author=jerry79 link=topic=12684.msg22995#msg22995 date=1381995871]
    问题描述:我希望实现的功能是,在sale.order流程中,progress状态下,当发票状态为paid,同时合同(自定义类)状态为done时,sale.order状态自动变为done。
    [/quote]

    LZ 你描述的这个问题不够清楚合同(自定义类)状态为done时,请问这个合同是什么?在sale.order.basic中,sale.order状态自动变为done的这个节点中定义了Join Mode 为and ,也就是说这个and就是判断了只有在Delivered和发票状态为paid时候sale.order状态自动变为done。望解释一下你自定义的合同(自定义类)是什么,我们一起探讨一下怎么使用workflow.wkf_service的方法来实现,
    [检测到链接无效,已移除]
    [/quote]

    我补充了我的流程的简化版,我想实现的也是希望合同和发票都完成后,订单才变为done,请参考我的博客的说明。
    另外,经过两种方法的比较,我现在觉得subflow模式更加清晰明了,而trigger方式还需要修改py文件,比较麻烦。

  • XPATH中position()的用法

    7
    0 赞同
    7 帖子
    9k 浏览
    JoshuaJ

    [quote author=mrshelly link=topic=14508.msg24932#msg24932 date=1382769348]
    赞...............
    参考资料:https://developer.mozilla.org/en-US/docs/XPath/Functions/position
    [/quote]

    xpath 还有很多玩法 😉 谢谢分享。

  • 分享 通过wizard的python代码控制页面的显示

    7
    0 赞同
    7 帖子
    3k 浏览
    mrshellyM

    那就 加俩 Tag 吧... 感谢分享....

  • 如何将开源的openerp商业化呢,简单的说就是怎么赚钱

    12
    0 赞同
    12 帖子
    7k 浏览
    ieitzybI

    [quote author=xiaokang_214 link=topic=12723.msg24895#msg24895 date=1382596523]
    ...选型几个行业进行免费实施和开发,...
    [/quote]
    好家伙,比我有勇气

    [quote author=xiaokang_214 link=topic=12723.msg24895#msg24895 date=1382596523]
    ...总之,我觉得做erp是就像做实业,需要一步一个脚印
    [/quote]
    嗯,做事业!

  • 分享 one2many 或者many2many 在列表编辑的例子

    4
    0 赞同
    4 帖子
    3k 浏览
    W

    Tag是什么意思呢?