From c9555e2d6543f4fa6ffba5faab6951c1d524584e Mon Sep 17 00:00:00 2001 From: blueuc Date: Mon, 9 Dec 2024 09:23:01 -0500 Subject: [PATCH] Added with_company context for shared products on multi-company setups --- subscription_oca/models/sale_subscription_line.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subscription_oca/models/sale_subscription_line.py b/subscription_oca/models/sale_subscription_line.py index bac2974d06..7022ab5fca 100644 --- a/subscription_oca/models/sale_subscription_line.py +++ b/subscription_oca/models/sale_subscription_line.py @@ -301,9 +301,13 @@ def _prepare_sale_order_line(self): def _prepare_account_move_line(self): self.ensure_one() + #added with_company context for multi-company setups + #without separate product configurations account = ( self.product_id.property_account_income_id - or self.product_id.categ_id.property_account_income_categ_id + or self.product_id.categ_id.with_company( + self.sale_subscription_id.company_id + ).property_account_income_categ_id ) return { "product_id": self.product_id.id,