Skip to content
Permalink
Browse files

[FIX] l10n_fr_pos_cert: fpos settings

opw-1969009
  • Loading branch information...
nim-odoo committed Apr 16, 2019
1 parent 78ba90d commit ee5e470ebabcf0010a480eb4db4b767a264e5186
@@ -1,3 +1,4 @@
import account_bank_statement
from . import account_fiscal_position
import res_company
import pos
import pos
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-

from odoo import _, models
from odoo.exceptions import UserError


class AccountFiscalPosition(models.Model):
_inherit = "account.fiscal.position"

def write(self, vals):
if "tax_ids" in vals:
if self.env["pos.order"].sudo().search_count([("fiscal_position_id", "in", self.ids)]):
raise UserError(
_(
"You cannot change a fiscal position used in a POS order. "
+ "You should archive it and create a new one."
)
)
return super(AccountFiscalPosition, self).write(vals)

0 comments on commit ee5e470

Please sign in to comment.
You can’t perform that action at this time.