Hello all,
In the stock.picking model, I want to declare a new field (customer_of_division_id).
If the stock.picking has a value in his sale_id field, I would want to declare the field like this :
customer_of_division_id = fields.Many2one(related="sale_id.customer_of_division_id",If the stock.picking has NO value in his sale_id field, I would want to declare the field like this :
domain="[('division_of_company_id','=',company_id)]",
string='Customer of the division')
customer_of_division_id = fields.Many2one(related="partner_id.customer_of_division_id",
domain="[('division_of_company_id','=',company_id)]",
string='Customer of the division')
How to achieve this?
Thanks all