跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • 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 中文社区

KevinKongK

KevinKong

@KevinKong
关于
帖子
99
主题
11
群组
0
粉丝
0
关注
0

帖子

最新 最佳 有争议的

  • Many2one的字段,在做选择时,如何能按选择习惯排序,即最常选的,排在最上面
    KevinKongK KevinKong

    给Many2one值加权重,用户每选择一次就在对应的拓展表(用户ID,model_id, id, count)增加一次次数,然后关联排序。


  • POSBOX如何连接非官方支持的打印机?
    KevinKongK KevinKong

    首先,你的描述很不清楚;其次,报的错误你也没有贴上来;第三,搞posbox得人不多

    你说,谁来给你答案。。。。


  • Odoo怎么调试错误
    KevinKongK KevinKong

    这不说的很清楚。。。。decorder zip not available 。。。。


  • 产品active默认值改为false
    KevinKongK KevinKong

    我竟无言以对。。。


  • Odoo怎么调试错误
    KevinKongK KevinKong

    看错误要看最后几行,你这样截图,没人能告诉你到底是什么错误


  • 如何在one2many列表不能删除指定的某一列??
    KevinKongK KevinKong

    为什么不unlink的时候查一下,指定id里的就 excpt不让删。。。。囧


  • 在员工管理模块中具有员工角色的用户如何修改自己的员工表信息
    KevinKongK KevinKong

    自己建个组呗~


  • 如何在one2many列表不能删除指定的某一列??
    KevinKongK KevinKong

    需求还真是花样。。


  • 如何在odoo9.0视图中使用uid
    KevinKongK KevinKong

    也行。。。但是uid 默认为1 真的好嘛。。。


  • 如何在odoo9.0视图中使用uid
    KevinKongK KevinKong

    safe_eval 8.0就有了好么,是你传值的姿势不对....再好好看看  ;D


  • Odoo8的库存移动功能中,当手动创建一个库存移动,预计日期不管怎么填写都会报错【字段无效】
    KevinKongK KevinKong

    我错了,我投降,我上图,我的结论是,你用的是盗版~


  • Odoo8的库存移动功能中,当手动创建一个库存移动,预计日期不管怎么填写都会报错【字段无效】
    KevinKongK KevinKong

    没图你说个xx...

    直觉告诉我你说的不是move是picking....


  • Odoo8的库存移动功能中,当手动创建一个库存移动,预计日期不管怎么填写都会报错【字段无效】
    KevinKongK KevinKong

    你用的是盗版................













    手动创建明显不行 目的库位压根就不让你填..........


  • 弱弱问句odoo9的条码界面在哪儿呢
    KevinKongK KevinKong

    我只贴图,我不说话


  • Many2many 字段下拉框显示数据的过滤
    KevinKongK KevinKong

    描述好混乱,看起来好费劲.....

    用fields_view_get方法吧,想怎么过滤就怎么过滤......


  • 采购询价单订单日期问题
    KevinKongK KevinKong

    销售订单,生产单和采购订单的日期逻辑是这样的(MTO):
    1. 生产单日期 = 销售订单确认的日期 + 客户提前期 - 产品的生产提前期 - 生产安全期
    2. 采购订单日期 = 生产单日期 - 采购提前期 - 供应商的送货周期

    其中 生产安全期和 采购提前期 都在公司设置里,默认都是1天,我估计你是没有注意到这里的设置。


  • 按库存采购的货品,设定了供应商和再订货规则,运行排程会不断重复产生询价单,何故
    KevinKongK KevinKong

    恭喜你,又碰到了odoo给你预留的一个坑位。如果我没估计错,你的仓库是[b]两步入库[/b](因为我是三步入库,第二次的运行结果是75并非50)。

    其实你的理解并没错,按道理讲你已经生成了25个的采购单,再次运行MRP运算不应该生成后续的询价单,但是理想很美好,现实很骨感。

    我们来看看这个错误是如何发生的:

    <br />for key in product_dict.keys():<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ctx = context.copy()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ctx.update({&#039;location&#039;: ops_dict[key][0].location_id.id})<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; prod_qty = product_obj._product_available(cr, uid, [x.id for x in product_dict[key]],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; context=ctx)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; subtract_qty = orderpoint_obj.subtract_procurements_from_orderpoints(cr, uid, [x.id for x in ops_dict[key]], context=context)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for op in ops_dict[key]:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; prods = prod_qty[op.product_id.id]&#91;&#039;virtual_available&#039;]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if prods is None:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if float_compare(prods, op.product_min_qty, precision_rounding=op.product_uom.rounding) &lt;= 0:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; qty = max(op.product_min_qty, op.product_max_qty) - prods<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reste = op.qty_multiple &gt; 0 and qty % op.qty_multiple or 0.0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if float_compare(reste, 0.0, precision_rounding=op.product_uom.rounding) &gt; 0:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; qty += op.qty_multiple - reste<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if float_compare(qty, 0.0, precision_rounding=op.product_uom.rounding) &lt; 0:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; qty -= subtract_qty[op.id]<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; qty_rounded = float_round(qty, precision_rounding=op.product_uom.rounding)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if qty_rounded &gt; 0:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proc_id = procurement_obj.create(cr, uid,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  self._prepare_orderpoint_procurement(cr, uid, op, qty_rounded, context=context),<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  context=context)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tot_procs.append(proc_id)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if use_new_cursor:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cr.commit()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; except OperationalError:<br />
    


    由以上代码可以看出,Odoo官方其实是已经将预先采购但并未实际入库的数量扣除了,所以这里你入没入库实际并不影响它的运算结果。

    但作怪的究竟是谁呢?经过一番print之后,找到始作俑者:

     qty -= subtract_qty[op.id]
    



    进而,按图索骥,找到最终的罪魁祸首——
    orderpoint对象的subtract_procurements_from_orderpoints方法:

    <br />def subtract_procurements_from_orderpoints(self, cr, uid, orderpoint_ids, context=None):<br />&nbsp; &nbsp; &nbsp; &nbsp; &#039;&#039;&#039;This function returns quantity of product that needs to be deducted from the orderpoint computed quantity because there&#039;s already a procurement created with aim to fulfill it.<br />&nbsp; &nbsp; &nbsp; &nbsp; &#039;&#039;&#039;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; cr.execute(&quot;&quot;&quot;select op.id, p.id, p.product_uom, p.product_qty, pt.uom_id, sm.product_qty from procurement_order as p left join stock_move as sm ON sm.procurement_id = p.id,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stock_warehouse_orderpoint op, product_product pp, product_template pt<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE p.orderpoint_id = op.id AND p.state not in (&#039;done&#039;, &#039;cancel&#039;) AND (sm.state IS NULL OR sm.state not in (&#039;draft&#039;))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND pp.id = p.product_id AND pp.product_tmpl_id = pt.id<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND op.id IN %s<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ORDER BY op.id, p.id<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;&quot;, (tuple(orderpoint_ids),))<br />&nbsp; &nbsp; &nbsp; &nbsp; results = cr.fetchall()<br />&nbsp; &nbsp; &nbsp; &nbsp; current_proc = False<br />&nbsp; &nbsp; &nbsp; &nbsp; current_op = False<br />&nbsp; &nbsp; &nbsp; &nbsp; uom_obj = self.pool.get(&quot;product.uom&quot;)<br />&nbsp; &nbsp; &nbsp; &nbsp; op_qty = 0<br />&nbsp; &nbsp; &nbsp; &nbsp; res = dict.fromkeys(orderpoint_ids, 0.0)<br />&nbsp; &nbsp; &nbsp; &nbsp; for move_result in results:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; op = move_result[0]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if current_op != op:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if current_op:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; res[current_op] = op_qty<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; current_op = op<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; op_qty = 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proc = move_result[1]<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if proc != current_proc:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; op_qty += uom_obj._compute_qty(cr, uid, move_result[2], move_result[3], move_result[4], round=False)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; current_proc = proc<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if move_result[5]: #If a move is associated (is move qty)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; op_qty -= move_result[5]<br />&nbsp; &nbsp; &nbsp; &nbsp; if current_op:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; res[current_op] = op_qty<br />&nbsp; &nbsp; &nbsp; &nbsp; return res<br />
    



    这段代码的问题在什么地方呢?
    在于联表查询stock_move的时候并没有判断move的源库位和目的库位。
    针对你这里的问题,按我估计,你是两步入库,第一步供应商到input 数量25,第二步 input到stock 25。根据上面的代码,第一次循环走前2个if 到第三个if的时候
    相互抵消,op_qty数量为0。第二次循环 不走前两个if 直接第三个if 结果为-25.
    回到_procure_orderpoint_confirm 方法 ,因此会创建一个 (25 -= -25 )50的询价单。

    第三次运行MRP运算,你确认了50的询价单 ,因而符合的stock move有4个 分别为25,25,50,50.
    因此 会创建一个(25-=-75) 100的询价单。

    依次可类推,第四次运算的结果应该为 200.

    WTF!!(ノಠ益ಠ)ノ彡┻━┻!!

    多大一坑啊!!!!

    好了,认识了这个坑就该知道怎么修补这个坑了吧~~


    什么?不知道如何修补?

















    ...........................










    那还玩什么odoo啊。。。。。。。。


    【原创,禁止转载】

    --------------------------------------------------更新----------------------------------------------------

    细心的同学可能已经发现了 按上面说的

    prods = prod_qty[op.product_id.id]&#91;&#039;virtual_available&#039;]
    


    当第一次的25入库以后,预计数量应该为25才对,但从结果上看,显然预计数量仍然为0 。

    oh,no!又是灵异事件么?

    经查,odoo关于预测数量的算法是这样的,预测数量 = 入库数量 - 出库数量 (当前库位)

    而楼主的问题,在于 预测数量始终为0 才导致的 每运行一次都出一次询价单。。。。。。

    所以,饶了一圈又回到了原点。

    解决楼主问题的方法非常简单,不要把订购点设置到input库位上!!!!!!!!!!!!

    为什么?

    两次入库的前提下,每确定一张采购单,系统会自动生成 供应商到 input的 move 和 input 到 stock的move

    这一进一出,预测数量不为0 才怪! 同理, 三步入库把 订购点设置到qc库位的,也是傻*一个。

    ╮(╯▽╰)╭


  • 数据库恢复有问题
    KevinKongK KevinKong

    哦,原来你是用的这个模块啊,怪不得。。。。


  • 安装问题
    KevinKongK KevinKong

    你装的是个什么鬼


  • 采购入库时想通过条形码扫描实现-可是碰到问题做不出来,求教--在ODOO8.0中操作
    KevinKongK KevinKong

    2,3总监已经解释过了

    4. 包装就是扫码界面的那个put in pack 生成的包装。

  • 登录

  • 没有帐号? 注册

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