我在我的 odoo 环境中有一个多公司设置,我正在尝试制作一个模块,该模块允许将草稿发票移动到另一个可用的公司,但是在设置新的 company_id 时出现错误。我的代码:
self.company_id = company_ids.filtered(lambda x: x.id != self.id)[0].id
错误:
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.
关于如何实现这一目标的任何帮助或想法都会很棒。谢谢