Fix style
This commit is contained in:
parent
3b9a2fd9e6
commit
da21626f4a
|
@ -1,10 +1,10 @@
|
||||||
# The COPYRIGHT file at the top level of this repository contains
|
# The COPYRIGHT file at the top level of this repository contains
|
||||||
# the full copyright notices and license terms.
|
# the full copyright notices and license terms.
|
||||||
from trytond.pool import Pool
|
from trytond.pool import Pool
|
||||||
from .invoice import *
|
from . import invoice
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
Pool.register(
|
Pool.register(
|
||||||
Invoice,
|
invoice.Invoice,
|
||||||
module='account_invoice_consecutive', type_='model')
|
module='account_invoice_consecutive', type_='model')
|
||||||
|
|
18
invoice.py
18
invoice.py
|
@ -15,14 +15,14 @@ class Invoice:
|
||||||
super(Invoice, cls).__setup__()
|
super(Invoice, cls).__setup__()
|
||||||
cls._error_messages.update({
|
cls._error_messages.update({
|
||||||
'invalid_number_date': 'You are trying to create '
|
'invalid_number_date': 'You are trying to create '
|
||||||
'%(invoice_number)s invoice on date %(invoice_date)s. '
|
'%(invoice_number)s invoice on date %(invoice_date)s. '
|
||||||
'There are %(invoice_count)d invoices after this date:'
|
'There are %(invoice_count)d invoices after this date:'
|
||||||
'\n\n%(invoices)s',
|
'\n\n%(invoices)s',
|
||||||
'not_same_dates': 'You are trying to validate an invoice '
|
'not_same_dates': 'You are trying to validate an invoice '
|
||||||
'where invoice date (%(invoice_date)s) and accounting '
|
'where invoice date (%(invoice_date)s) and accounting '
|
||||||
'date (%(accounting_date)s) are different. That is not '
|
'date (%(accounting_date)s) are different. That is not '
|
||||||
'permitted, because of invoice number and date '
|
'permitted, because of invoice number and date '
|
||||||
'correlation.',
|
'correlation.',
|
||||||
})
|
})
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -33,11 +33,11 @@ class Invoice:
|
||||||
invoice.check_same_dates()
|
invoice.check_same_dates()
|
||||||
|
|
||||||
def check_same_dates(self):
|
def check_same_dates(self):
|
||||||
pool=Pool()
|
pool = Pool()
|
||||||
Lang = pool.get('ir.lang')
|
Lang = pool.get('ir.lang')
|
||||||
|
|
||||||
if (self.invoice_date and self.accounting_date
|
if (self.invoice_date and self.accounting_date
|
||||||
and self.invoice_date != self.accounting_date):
|
and self.invoice_date != self.accounting_date):
|
||||||
language = Transaction().language
|
language = Transaction().language
|
||||||
languages = Lang.search([('code', '=', language)])
|
languages = Lang.search([('code', '=', language)])
|
||||||
if not languages:
|
if not languages:
|
||||||
|
|
Loading…
Reference in New Issue