[REF] Account Invoice Constraint Chronology: better messages
This commit is contained in:
parent
25d91cda4e
commit
2571215d3d
@ -32,7 +32,7 @@ msgid ""
|
|||||||
"and try again."
|
"and try again."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Erreur de chronologie. Veuillez confirmer les anciennes factures brouillon "
|
"Erreur de chronologie. Veuillez confirmer les anciennes factures brouillon "
|
||||||
"avant %set réessayer."
|
"avant le {date_invoice} et réessayer."
|
||||||
|
|
||||||
#. module: account_invoice_constraint_chronology
|
#. module: account_invoice_constraint_chronology
|
||||||
#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:66
|
#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:66
|
||||||
@ -42,7 +42,7 @@ msgid ""
|
|||||||
"{date_invoice}."
|
"{date_invoice}."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Erreur de chronologie. Il existe au moins une facture avec une date "
|
"Erreur de chronologie. Il existe au moins une facture avec une date "
|
||||||
"ultérieure à %s."
|
"ultérieure au {date_invoice}."
|
||||||
|
|
||||||
#. module: account_invoice_constraint_chronology
|
#. module: account_invoice_constraint_chronology
|
||||||
#: model:ir.model,name:account_invoice_constraint_chronology.model_account_invoice
|
#: model:ir.model,name:account_invoice_constraint_chronology.model_account_invoice
|
||||||
|
@ -5,6 +5,7 @@ import datetime
|
|||||||
|
|
||||||
from odoo import models, api, fields, _
|
from odoo import models, api, fields, _
|
||||||
from odoo.exceptions import UserError
|
from odoo.exceptions import UserError
|
||||||
|
from odoo.tools.misc import format_date
|
||||||
|
|
||||||
|
|
||||||
class AccountInvoice(models.Model):
|
class AccountInvoice(models.Model):
|
||||||
@ -46,8 +47,9 @@ class AccountInvoice(models.Model):
|
|||||||
month=inv.date_invoice.month,
|
month=inv.date_invoice.month,
|
||||||
day=inv.date_invoice.day,
|
day=inv.date_invoice.day,
|
||||||
)
|
)
|
||||||
date_invoice_tz = fields.Date.context_today(
|
date_invoice_tz = format_date(
|
||||||
self, date_invoice_format)
|
self.env, fields.Date.context_today(
|
||||||
|
self, date_invoice_format))
|
||||||
raise UserError(_(
|
raise UserError(_(
|
||||||
"Chronology Error. Please confirm older draft invoices "
|
"Chronology Error. Please confirm older draft invoices "
|
||||||
"before {date_invoice} and try again.").format(
|
"before {date_invoice} and try again.").format(
|
||||||
@ -61,8 +63,9 @@ class AccountInvoice(models.Model):
|
|||||||
month=inv.date_invoice.month,
|
month=inv.date_invoice.month,
|
||||||
day=inv.date_invoice.day,
|
day=inv.date_invoice.day,
|
||||||
)
|
)
|
||||||
date_invoice_tz = fields.Date.context_today(
|
date_invoice_tz = format_date(
|
||||||
self, date_invoice_format)
|
self.env, fields.Date.context_today(
|
||||||
|
self, date_invoice_format))
|
||||||
raise UserError(_(
|
raise UserError(_(
|
||||||
"Chronology Error. There exist at least one invoice "
|
"Chronology Error. There exist at least one invoice "
|
||||||
"with a later date to {date_invoice}.").format(
|
"with a later date to {date_invoice}.").format(
|
||||||
|
Loading…
Reference in New Issue
Block a user