Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0] Fix l10n_it_account_stamp multi company #4415

Draft
wants to merge 2 commits into
base: 10.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion l10n_it_account_stamp/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, '
Expand Down
6 changes: 3 additions & 3 deletions l10n_it_account_stamp/models/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down