'You should install the mrp_byproduct module if you want to manage extra products on BoMs !'),
]
+ def create(self, cr, uid, values, context=None):
+ if context is None:
+ context = {}
+ product_obj = self.pool.get('product.product')
+ if 'product_id' in values and not 'product_uom' in values:
+ values['product_uom'] = product_obj.browse(cr, uid, values.get('product_id'), context=context).uom_id.id
+ return super(mrp_bom_line, self).create(cr, uid, values, context=context)
+
def onchange_uom(self, cr, uid, ids, product_id, product_uom, context=None):
res = {'value': {}}
if not product_uom or not product_id:
(_check_qty, 'Order quantity cannot be negative or zero!', ['product_qty']),
]
+ def create(self, cr, uid, values, context=None):
+ if context is None:
+ context = {}
+ product_obj = self.pool.get('product.product')
+ if 'product_id' in values and not 'product_uom' in values:
+ values['product_uom'] = product_obj.browse(cr, uid, values.get('product_id'), context=context).uom_id.id
+ return super(mrp_production, self).create(cr, uid, values, context=context)
+
def unlink(self, cr, uid, ids, context=None):
for production in self.browse(cr, uid, ids, context=context):
if production.state not in ('draft', 'cancel'):
'product_qty': 1,
}
+ def create(self, cr, uid, values, context=None):
+ if context is None:
+ context = {}
+ product_obj = self.pool.get('product.product')
+ if 'product_id' in values and not 'product_uom_id' in values:
+ values['product_uom_id'] = product_obj.browse(cr, uid, values.get('product_id'), context=context).uom_id.id
+ return super(stock_inventory_line, self).create(cr, uid, values, context=context)
+
def _resolve_inventory_line(self, cr, uid, inventory_line, context=None):
stock_move_obj = self.pool.get('stock.move')
diff = inventory_line.theoretical_qty - inventory_line.product_qty