diff options
| author | Denis Ledoux <dle@odoo.com> | 2019-04-24 09:31:49 +0200 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2019-04-24 09:31:49 +0200 |
| commit | 0c46c8a929d8702574c02db28d3bbadac3aabaf9 (patch) | |
| tree | d601feec46d9a483cff5ea84e5721c0e788a86b6 /addons/l10n_fr_pos_cert | |
| parent | 47ebb835e5baed52ac089663f2fb57b3c4993186 (diff) | |
| parent | 6fd092e131bdbefce2cc9de4db9bb1fd533e8329 (diff) | |
[MERGE] forward port branch saas-14 up to 6fd092e131b
Diffstat (limited to 'addons/l10n_fr_pos_cert')
| -rw-r--r-- | addons/l10n_fr_pos_cert/i18n/l10n_fr_pos_cert.pot | 13 | ||||
| -rw-r--r-- | addons/l10n_fr_pos_cert/models/__init__.py | 3 | ||||
| -rw-r--r-- | addons/l10n_fr_pos_cert/models/account_fiscal_position.py | 19 |
3 files changed, 33 insertions, 2 deletions
diff --git a/addons/l10n_fr_pos_cert/i18n/l10n_fr_pos_cert.pot b/addons/l10n_fr_pos_cert/i18n/l10n_fr_pos_cert.pot index 4e1507eb9f0..ca60d0c4779 100644 --- a/addons/l10n_fr_pos_cert/i18n/l10n_fr_pos_cert.pot +++ b/addons/l10n_fr_pos_cert/i18n/l10n_fr_pos_cert.pot @@ -67,6 +67,11 @@ msgid "Corrupted data on point of sale order with id %s." msgstr "" #. module: l10n_fr_pos_cert +#: model:ir.model,name:l10n_fr_pos_cert.model_account_fiscal_position +msgid "Fiscal Position" +msgstr "" + +#. module: l10n_fr_pos_cert #: model:ir.ui.menu,name:l10n_fr_pos_cert.pos_fr_statements_menu msgid "French Statements" msgstr "" @@ -137,7 +142,13 @@ msgid "This session has been opened another day. To comply with the French law, msgstr "" #. module: l10n_fr_pos_cert -#: code:addons/l10n_fr_pos_cert/models/account_bank_statement.py:11 +#: code:addons/l10n_fr_pos_cert/models/account_fiscal_position.py:14 +#, python-format +msgid "You cannot modify a fiscal position used in a POS order. You should archive it and create a new one." +msgstr "" + +#. module: l10n_fr_pos_cert +#: code:addons/l10n_fr_pos_cert/models/account_bank_statement.py:12 #, python-format msgid "You cannot modify anything on a bank statement (name: %s) that was created by point of sale operations." msgstr "" diff --git a/addons/l10n_fr_pos_cert/models/__init__.py b/addons/l10n_fr_pos_cert/models/__init__.py index e56d2fcd33c..92fba1e252d 100644 --- a/addons/l10n_fr_pos_cert/models/__init__.py +++ b/addons/l10n_fr_pos_cert/models/__init__.py @@ -1,3 +1,4 @@ import account_bank_statement +from . import account_fiscal_position import res_company -import pos
\ No newline at end of file +import pos diff --git a/addons/l10n_fr_pos_cert/models/account_fiscal_position.py b/addons/l10n_fr_pos_cert/models/account_fiscal_position.py new file mode 100644 index 00000000000..71b4b12155a --- /dev/null +++ b/addons/l10n_fr_pos_cert/models/account_fiscal_position.py @@ -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 modify a fiscal position used in a POS order. " + + "You should archive it and create a new one." + ) + ) + return super(AccountFiscalPosition, self).write(vals) |
