[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:
Pedro M. Baeza
2015-02-01 17:24:23 +01:00
parent fbdbde9806
commit 129878e4c5
2 changed files with 5 additions and 5 deletions

View File

@@ -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

View File

@@ -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>