I created 2 fields inside the stock.move.line inside transfers : The first one is many2one field and I need to populate it automatically if the second customized boolean field is checked. The field I need to populate with is the product_id which is already found in the lines. Any Ideas? Here is my code:
@api.onchange('product_id')
def relate_alternatives(self):
for rec in self:
if rec.alternative_delivery_item==True:
rec.product_alternative=rec.product_id
I don't need an onchange function, I need when checking the box, I need the new many2one field to be filled automatically, at the same time I need when changing the product_id again not affect the other many2one field I created. Thanks