From 8828f34726c3790120ad3833a954ceee8b98077a Mon Sep 17 00:00:00 2001 From: Alberto Re Date: Thu, 17 Oct 2024 16:24:06 +0200 Subject: [PATCH 1/2] [FIX] l10n_it_account_stamp: Environment of company retrieved from user is another user's --- l10n_it_account_stamp/models/invoice.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/l10n_it_account_stamp/models/invoice.py b/l10n_it_account_stamp/models/invoice.py index 068581df3d0e..534246bd1ff5 100644 --- a/l10n_it_account_stamp/models/invoice.py +++ b/l10n_it_account_stamp/models/invoice.py @@ -10,7 +10,7 @@ class AccountInvoice(models.Model): "Tax Stamp", readonly=True, states={'draft': [('readonly', False)]}) def is_tax_stamp_applicable(self): - stamp_product_id = self.env.user.with_context( + stamp_product_id = self.with_context( lang=self.partner_id.lang).company_id.tax_stamp_product_id if not stamp_product_id: raise exceptions.Warning( @@ -40,7 +40,7 @@ def add_tax_stamp_line(self): for inv in self: if not inv.tax_stamp: raise exceptions.Warning(_("Tax stamp is not applicable")) - stamp_product_id = self.env.user.with_context( + stamp_product_id = inv.with_context( lang=inv.partner_id.lang).company_id.tax_stamp_product_id if not stamp_product_id: raise exceptions.Warning( @@ -123,7 +123,7 @@ def action_move_create(self): posted = True inv.move_id.state = 'draft' line_model = self.env['account.move.line'] - stamp_product_id = self.env.user.with_context( + stamp_product_id = inv.with_context( lang=inv.partner_id.lang).company_id.tax_stamp_product_id if not stamp_product_id: raise exceptions.Warning( From 08c687c842983ae87880175710304c8a460071e1 Mon Sep 17 00:00:00 2001 From: Alberto Re Date: Thu, 17 Oct 2024 16:39:55 +0200 Subject: [PATCH 2/2] Bump minor version for AgileBG open PR build --- l10n_it_account_stamp/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_it_account_stamp/__manifest__.py b/l10n_it_account_stamp/__manifest__.py index 7c0319b2fceb..03724af98fb1 100644 --- a/l10n_it_account_stamp/__manifest__.py +++ b/l10n_it_account_stamp/__manifest__.py @@ -7,7 +7,7 @@ { 'name': 'Italian Localization - Tax Stamp', - 'version': '10.0.1.0.1', + 'version': '10.0.1.0.2', 'category': 'Localization/Italy', 'summary': 'Tax stamp automatic management', 'author': 'Ermanno Gnan, Sergio Corato, Enrico Ganzaroli, '