diff options
| -rw-r--r-- | addons/l10n_ar/i18n/es.po | 12 | ||||
| -rw-r--r-- | addons/l10n_ar/i18n/l10n_ar.pot | 4 | ||||
| -rw-r--r-- | addons/l10n_ar/models/account_journal.py | 15 |
3 files changed, 14 insertions, 17 deletions
diff --git a/addons/l10n_ar/i18n/es.po b/addons/l10n_ar/i18n/es.po index 3b57cffc086..57928f97f1e 100644 --- a/addons/l10n_ar/i18n/es.po +++ b/addons/l10n_ar/i18n/es.po @@ -1006,8 +1006,8 @@ msgid "" "The selected Journal can't be used in this transaction, please select one " "that doesn't use documents as these are just for Invoices." msgstr "" -"El Diario seleccionado no se puede usar en esta transacción, por favor seleccione " -"uno que no use documentos, ya que estos son solo para Facturas." +"El Diario seleccionado no se puede usar en esta transacción, por favor " +"seleccione uno que no use documentos, ya que estos son solo para Facturas." #. module: l10n_ar #: code:addons/l10n_ar/models/res_partner.py:0 @@ -1207,11 +1207,11 @@ msgstr "" #: code:addons/l10n_ar/models/account_journal.py:0 #, python-format msgid "" -"You can not change the journal configuration for a journal that already have" -" validate invoices" +"You can not change the journal's configuration if journal already have " +"validated invoices" msgstr "" -"No puedes cambiar la configuración del diario ya que este tiene facturas " -"validadas" +"No puedes cambiar la confguración de un diario si el diario ya tiene " +"facturas validadas" #. module: l10n_ar #: model:ir.model.fields.selection,name:l10n_ar.selection__l10n_latam_document_type__purchase_aliquots__zero diff --git a/addons/l10n_ar/i18n/l10n_ar.pot b/addons/l10n_ar/i18n/l10n_ar.pot index 3f938007ca6..514f916dcc9 100644 --- a/addons/l10n_ar/i18n/l10n_ar.pot +++ b/addons/l10n_ar/i18n/l10n_ar.pot @@ -1156,8 +1156,8 @@ msgstr "" #: code:addons/l10n_ar/models/account_journal.py:0 #, python-format msgid "" -"You can not change the journal configuration for a journal that already have" -" validate invoices" +"You can not change the journal's configuration if journal already have " +"validated invoices" msgstr "" #. module: l10n_ar diff --git a/addons/l10n_ar/models/account_journal.py b/addons/l10n_ar/models/account_journal.py index ba901e591fc..8a537f57b4d 100644 --- a/addons/l10n_ar/models/account_journal.py +++ b/addons/l10n_ar/models/account_journal.py @@ -107,16 +107,13 @@ class AccountJournal(models.Model): 'l10n_latam_use_documents') def _check_afip_configurations(self): """ Do not let to update journal if already have confirmed invoices """ - self.ensure_one() - if self.company_id.country_id != self.env.ref('base.ar'): - return True - if self.type != 'sale' and self._origin.type != 'sale': - return True - invoices = self.env['account.move'].search([('journal_id', '=', self.id), ('state', '!=', 'draft')]) + arg_sale_journals = self.filtered(lambda x: x.company_id.country_id == self.env.ref('base.ar') and + x.type == 'sale' and x._origin.type == 'sale') + invoices = self.env['account.move'].search([('journal_id', 'in', arg_sale_journals.ids), ('state', '!=', 'draft')]) if invoices: - raise ValidationError(_( - 'You can not change the journal configuration for a journal that already have validate invoices') + - ':<br/><br/> - %s' % ('<br/>- '.join(invoices.mapped('display_name')))) + raise ValidationError( + _("You can not change the journal's configuration if journal already have validated invoices") + ' (' + + ', '.join(invoices.mapped('journal_id').mapped('name')) + ')') @api.constrains('l10n_ar_afip_pos_number') def _check_afip_pos_number(self): |
