mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[REF] Account Invoice Constraint Chronology: better messages
This commit is contained in:
committed by
Alexey Pelykh
parent
269981e3c2
commit
facb144cd1
@@ -32,7 +32,7 @@ msgid ""
|
||||
"and try again."
|
||||
msgstr ""
|
||||
"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
|
||||
#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:66
|
||||
@@ -42,7 +42,7 @@ msgid ""
|
||||
"{date_invoice}."
|
||||
msgstr ""
|
||||
"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
|
||||
#: 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.exceptions import UserError
|
||||
from odoo.tools.misc import format_date
|
||||
|
||||
|
||||
class AccountInvoice(models.Model):
|
||||
@@ -46,8 +47,9 @@ class AccountInvoice(models.Model):
|
||||
month=inv.date_invoice.month,
|
||||
day=inv.date_invoice.day,
|
||||
)
|
||||
date_invoice_tz = fields.Date.context_today(
|
||||
self, date_invoice_format)
|
||||
date_invoice_tz = format_date(
|
||||
self.env, fields.Date.context_today(
|
||||
self, date_invoice_format))
|
||||
raise UserError(_(
|
||||
"Chronology Error. Please confirm older draft invoices "
|
||||
"before {date_invoice} and try again.").format(
|
||||
@@ -61,8 +63,9 @@ class AccountInvoice(models.Model):
|
||||
month=inv.date_invoice.month,
|
||||
day=inv.date_invoice.day,
|
||||
)
|
||||
date_invoice_tz = fields.Date.context_today(
|
||||
self, date_invoice_format)
|
||||
date_invoice_tz = format_date(
|
||||
self.env, fields.Date.context_today(
|
||||
self, date_invoice_format))
|
||||
raise UserError(_(
|
||||
"Chronology Error. There exist at least one invoice "
|
||||
"with a later date to {date_invoice}.").format(
|
||||
|
||||
Reference in New Issue
Block a user