I have a multi-company setup in my odoo environment and I am trying to make a module which alows a draft invoice to be moved to a different available company however when setting the new company_id I get an error. my code:
self.company_id = company_ids.filtered(lambda x: x.id != self.id)[0].id
error:
Incompatible companies on records:
- 'S00007' belongs to company 'Sale Comp 1' and 'Fiscal Position' (fiscal_position_id: 'Some position') belongs to another company.
- 'S00007' belongs to company 'Sale Comp 1' and 'Warehouse' (warehouse_id: 'Sale Company 2') belongs to another company.
Any help or ideas on how to achieve this would be great. Thank you