mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[FIX+IMP] mrp_operations_extension:
FIX: Use ceil instead is_integer check IMP: Don't allow inline editing of route operations on BoM
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
##############################################################################
|
||||
|
||||
from openerp import models, fields, api, _
|
||||
import math
|
||||
|
||||
|
||||
class MrpBom(models.Model):
|
||||
@@ -53,9 +54,7 @@ class MrpBom(models.Model):
|
||||
routing_line_id = routing_line.id
|
||||
break
|
||||
wc = routing_line_obj.browse(routing_line_id)
|
||||
cycle = factor / wc.cycle_nbr
|
||||
if wc.limited_production_capacity and not cycle.is_integer():
|
||||
cycle = int(cycle) + 1
|
||||
cycle = int(math.ceil(factor / wc.cycle_nbr))
|
||||
hour = wc.hour_nbr * cycle
|
||||
default_wc_line = wc.op_wc_lines.filtered(lambda r: r.default)
|
||||
work_order['cycle'] = cycle
|
||||
|
||||
@@ -10,8 +10,9 @@
|
||||
<xpath expr="//tree/field[@name='product_id']"
|
||||
position="after">
|
||||
<field name="operation"
|
||||
domain="[('routing_id', '=', parent.routing_id)]"
|
||||
groups="mrp.group_mrp_routings" />
|
||||
widget="selection"
|
||||
domain="[('routing_id', '=', parent.routing_id)]"
|
||||
groups="mrp.group_mrp_routings" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user