[REV] l10n_mx: prevent MX from printing receipts
PR #66910 has been created so the MX can print their receipts. Eventually, this needs to be reverted since printing a receipt is actually illegal. closes odoo/odoo#67209 X-original-commit: 7e9261cacd9f6963dca517fe7b1f3de067af1366 Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
This commit is contained in:
@@ -127,12 +127,6 @@ msgstr ""
|
||||
msgid "Nature"
|
||||
msgstr ""
|
||||
|
||||
#. module: l10n_mx
|
||||
#: code:addons/l10n_mx/models/account_move.py:0
|
||||
#, python-format
|
||||
msgid "Only invoices can be printed."
|
||||
msgstr ""
|
||||
|
||||
#. module: l10n_mx
|
||||
#: model:ir.model.fields,help:l10n_mx.field_account_setup_bank_manual_config__l10n_mx_edi_clabe
|
||||
#: model:ir.model.fields,help:l10n_mx.field_res_partner_bank__l10n_mx_edi_clabe
|
||||
|
||||
@@ -7,4 +7,3 @@ from . import account_tax
|
||||
from . import res_bank
|
||||
from . import res_config_settings
|
||||
from . import chart_template
|
||||
from . import account_move
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = 'account.move'
|
||||
|
||||
def _get_report_base_filename(self):
|
||||
self.ensure_one()
|
||||
if (self.company_id.country_id and self.company_id.country_id.code) == 'MX':
|
||||
if not self.is_invoice(include_receipts=True):
|
||||
raise UserError(_("Only invoices can be printed."))
|
||||
return self._get_move_display_name()
|
||||
return super()._get_report_base_filename()
|
||||
Reference in New Issue
Block a user