421
424
def onchange_product_id(self, cr, uid, ids, product_id, compute_method=False, consumption_method=False,
422
425
consumption_period_from=False, consumption_period_to=False, frequency=False,
423
safety_month=False, lead_time=False, supplier_lt=False, context=None):
426
safety_month=False, lead_time=False, supplier_lt=False, fixed_tv=0.00,
427
fixed_qty=0.00, context=None):
424
428
""" Finds UoM for changed product.
425
429
@param product_id: Changed id of product.
426
430
@return: Dictionary of values.
440
444
consumption_period_from, consumption_period_to, frequency,
441
445
safety_month, lead_time, supplier_lt, prod.uom_id.id, context=context)['threshold_value']
442
446
res['value'].update({'fake_threshold_value': tv, 'threshold_value': tv})
449
res = self.pool.get('product.uom')._change_round_up_qty(cr, uid, prod.uom_id.id, tv, ['fixed_threshold_value', 'fixed_product_qty', 'threshold_value', 'fake_threshold_value'], result=res)
450
if prod.uom_id.id and fixed_tv:
451
res = self.pool.get('product.uom')._change_round_up_qty(cr, uid, prod.uom_id.id, fixed_tv, ['fixed_threshold_value'], result=res)
452
if prod.uom_id.id and fixed_qty:
453
res = self.pool.get('product.uom')._change_round_up_qty(cr, uid, prod.uom_id.id, fixed_tv, ['fixed_product_qty'], result=res)
457
def onchange_uom_qty(self, cr, uid, ids, uom_id, tv_qty, product_qty):
459
Check round of qty according to UoM
462
uom_obj = self.pool.get('product.uom')
465
res = uom_obj._change_round_up_qty(cr, uid, uom_id, tv_qty, 'fixed_threshold_value', result=res)
468
res = uom_obj._change_round_up_qty(cr, uid, uom_id, product_qty, 'fixed_product_qty', result=res)
446
472
threshold_value_line()