跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

W

wang

@wang
关于
帖子
41
主题
15
群组
0
粉丝
0
关注
0

帖子

最新 最佳 有争议的

  • Odoo8仓库管理(WMS)介绍
    W wang

    这样的帖子应该置顶啊!


  • Fields.function store=True 执行次数的问题(已解决)
    W wang

    http://stuartl.longlandclan.yi.org/blog/2013/04/05/openerp-function-store/ 再次发个连接  ccdos提供 感觉不错


  • Fields.function store=True 执行次数的问题(已解决)
    W wang

    今天遇见了一个问题 就是在fields.function 的字段声明的时候 ,在store=True的情况下 函数还是在每次对象write的情况下都要执行一次,这样的情况下会很耗性能

    经过jeff的帮助下 找到了一个解决方法 就是在store={'对象':(不变的字段)} 例如::

    'delivery_date': fields.function (day_date_delivery,type="char",
                                              store={'mrp.production': (lambda self, cr, uid, ids, c={}: ids, ['name'], 10),}, string='送货日期'),


    就能很好的解决问题!这个应该是官方修改出来的bug还是一个什么情况 有点时候我们很像实现每次编辑的重新执行函数一次。。以前还有没有这个问题 。现在要是用store=True就要小心点了!!


    听jeff说 上海-Joshua  说过这样一句话  store=true 相当于 store = {self._name:(lambda self, cr, uid, ids, c={}: ids, [ ], 10) }

    希望对大家有 帮助





  • (7.0 version)当销售单中包含service或phantom类型的产品时,销售单不能完成的原因分析及解决方案
    W wang

    拜读下!!先评价再仔细的看下


  • OpenERP rml2pdf打印空方格的解决方法
    W wang

    很好!! ;D这下你就不会忘记了 哈哈


  • Fields required 属性个人理解
    W wang

    可能大家在写一个字段是必填的时候 会在fields 设置required=True属性 这样在创建数据库表的时候 对该字段会设置 非空。有的时候你可能感觉这个字段没有必要设置非空的 于是就把在python中把对应的required=True字段去掉了 。
    结果重启升级 等等操作的时候 在一些不确定的因素的情况下。数据库的字段属性并非是是想要的结果 可能就是数据库的字段还是非空的!!所以不要完全相信odoo里面的升级sql的机制!
    要是发现问题的时候最好看下数据库的结构


  • Oe中的addons的一个大坑(已解决)
    W wang

    大家可能平时有个这样的习惯!例如自己写了一个模块在addons下面 ,有的时候想把这个模块备份下!就在该文件下打了个.zip文件夹 !!要是不及时的删除这个zip文件  你在后续的对你的模块开发,运行时不起中用 了 系统读的都是你的zip包里面的程序!所以大家要谨慎!!谢谢


  • 自定义report 遇见的奇怪的问题
    W wang

    今天我在生产环境下 升级我的开发的模块,在升级的时候提示我的report 报错 说我们的id已经存在了 
    ,奇怪的事情是我这个模块很久都没有修改过了 ,怎么会影响我这个report的信息 ,
    <report id="add_picking_report1" model="stock.picking" name="stock.picking.out.report2" string="领料单(两鲜)"
                    rml="fresh_stock/report/picking.rml" header="False" />

    以前是这样写的!在N次升级的情况下都没有出现过错误!今天升级的时候出现了 后天经过 上海-joshua的提示
    添加 auto="False" 就可以升级了

    后来看了其他的模块的源码好像都加了 auto="False" 问题解决了!!但是以前为什么能升级 现在不能的原因没有找到了!!


  • 北京 OpenERP Meetup 沙龙召集(时间 2013-12-21周六)
    W wang

    那个红衣服应该是buke


  • 关于采购问题几个讨论!
    W wang

    分享你的处理的方法 大家探讨下!!


  • 我想在销售订单列表增加数量,单位等字段,请问应该怎么操作?急急急
    W wang

    不太合理把!!你的销售单的单位 是在明细中的!!可能单位有很多种类的 !! 要是单位有kg有件 之类的 你在销售订单列表中显示 合理吗??


  • 分享第一次 上系统的 心得 (期初盘点)
    W wang

    今天对系统做了一个新的系统做了一次重新部署 就要考虑到库存的问题!
    1,以为对以前的库位的设置有点不方便 没有上下级别的概念!!所以盘点的时候就很不方便
    2,还有就是对采购单位的滥用 !定义了很多采购单位 最一个产品的箱规 都用了菜单单位自动计算  !想起来是感觉很方便了 到时最后发现我们的 采购单位比产品还要多!!
    弄的采购都晕了 !因为我们是做食品的 单位比较多!!后来对单位做了调整 !

    没有办法就要重新弄新的帐套!就要解决期初库存的问题 !现在做的方式是 一次性做了盘点!!原本想的是做个入库单 感觉不太合理

    但是我们现在财务还没有好的解决方式 !!好在我们的是试运行阶段的时候没有用到oe的财务!!


  • 上传Excel附件,且自动解析文件
    W wang

    这个非常好 谢谢分享  这个我在参考web_printscreen的例子也有很好的介绍的


  • Oe的出库代码部分分析
    W wang

    唉  我发现我自己造轮子了 我在生产的那块自己写了分解 呵呵 不过比他这个要好点 但是我没有考虑 锁表的操作

    我是从批次表里面去找的stock_report_prodlots 这个里面找库位的


  • Oe的出库代码部分分析
    W wang

    现在oe中有个这样的功能!!例如我有个产品叫  苹果  我放到了库位A001 放了 5 个  在库位A002上放了5个 这样的情况 我在做销售的时候

    销售了6个 oe在生成的出库单  的明细 会出现  出库的源库位是A001 出了5个 A002出了 1个 这样的情况 !!我就是想在oe中找这块变化的代码在地方实现的 因为我要在这个地方扩展下 把批次号自动选择上去

    经过 一天的时候找这块的代码的时候 一直找不出来 打了无数的断点 到底写在什么地方  后来经过  花费总监一个小时的宝贵时间给我远程的情况下 终于找到了 实现这段代码的地方

    在stock模块 的stock_move class 里面的 check_assign 方法 里面的  res = self.pool.get('stock.location')._product_reserve( 这个里面做了分单处理

    希望对大家有所帮助 谢谢 !! 但是我还是不知道总监是怎么找到这块代码的 呵呵 总之感谢 !!

    实际出库单的里面有个检查可用 就是做这个操作的!!刚刚发现



  • 讨论下 库存用sql查询的方式
    W wang

    现在有这样的一个情况 例如我的一个商品已经在我的一个库存的一个库位里面了 !现在我想用一个sql查询出来 这个商品在那个库位里面  还有 在这个库位里面这商品有多少个 ,
    还有 就是这个商品的每个批次对应的商品有多少!!这样的情况

    当然我的库位内部库位了

    现在用的是下面的方式 一个sql 我现在不能确认我也是是否有问题 或者说我有那点地方我没有考虑到 !!希望大神给指点下  希望不惜赐教

    <br /><br />select a.prodlot_id , sum(a.qty) ,b.name ,p.name_template<br />from stock_report_prodlots as a <br />left join stock_location as b on a.location_id = b.id<br />left join product_product as p on p.id = a.product_id&nbsp; <br />where&nbsp; b.usage =&#039;internal&#039; and p.id=17<br /> group by a.prodlot_id,b.name ,p.name_template ,b.name&nbsp; <br /><br />
    

  • Magento电子商务网站+OpenERP集成
    W wang

    我们公司用的就是magento和openerp 一起使用的 主要用了同步商品,同步订单 ,同步库存 等等 双向同步


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

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


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

    哈哈 我也重构过这块的代码!!我还是放在循环里面的 我_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 />
    

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

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

  • 登录

  • 没有帐号? 注册

  • 登录或注册以进行搜索。
  • 第一个帖子
    最后一个帖子
0
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组