2
0

[IMP] a_i_c_chronology: cosmetics, pylint

This commit is contained in:
Stéphane Bidoul (ACSONE) 2017-05-29 16:25:41 +02:00 committed by Zina Rasoamanana
parent 045616358d
commit 8abfd3c145
7 changed files with 196 additions and 41 deletions

View File

@ -3,14 +3,16 @@
# * account_invoice_constraint_chronology # * account_invoice_constraint_chronology
# #
# Translators: # Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
# Bole <bole@dajmi5.com>, 2017
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: account-financial-tools (8.0)\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-07-01 13:25+0000\n" "POT-Creation-Date: 2017-05-30 00:47+0000\n"
"PO-Revision-Date: 2015-06-03 15:57+0000\n" "PO-Revision-Date: 2017-05-30 00:47+0000\n"
"Last-Translator: <>\n" "Last-Translator: Bole <bole@dajmi5.com>, 2017\n"
"Language-Team: Croatian (http://www.transifex.com/oca/OCA-account-financial-tools-8-0/language/hr/)\n" "Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
@ -18,12 +20,12 @@ msgstr ""
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: account_invoice_constraint_chronology #. module: account_invoice_constraint_chronology
#: field:account.journal,check_chronology:0 #: model:ir.model.fields,field_description:account_invoice_constraint_chronology.field_account_journal_check_chronology
msgid "Check Chronology" msgid "Check chronology"
msgstr "" msgstr "Provjeri kronološki"
#. module: account_invoice_constraint_chronology #. module: account_invoice_constraint_chronology
#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:59 #: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:31
#, python-format #, python-format
msgid "" msgid ""
"Chronology Error. Please confirm older draft invoices before %s and try " "Chronology Error. Please confirm older draft invoices before %s and try "
@ -31,7 +33,7 @@ msgid ""
msgstr "" msgstr ""
#. module: account_invoice_constraint_chronology #. module: account_invoice_constraint_chronology
#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:78 #: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:48
#, python-format #, python-format
msgid "" msgid ""
"Chronology Error. There exist at least one invoice with a date posterior to " "Chronology Error. There exist at least one invoice with a date posterior to "

View File

@ -0,0 +1,50 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_constraint_chronology
#
# Translators:
# Bole <bole@dajmi5.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-30 00:47+0000\n"
"PO-Revision-Date: 2017-05-30 00:47+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>, 2017\n"
"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/hr_HR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: hr_HR\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: account_invoice_constraint_chronology
#: model:ir.model.fields,field_description:account_invoice_constraint_chronology.field_account_journal_check_chronology
msgid "Check chronology"
msgstr ""
#. module: account_invoice_constraint_chronology
#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:31
#, python-format
msgid ""
"Chronology Error. Please confirm older draft invoices before %s and try "
"again."
msgstr ""
#. module: account_invoice_constraint_chronology
#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:48
#, python-format
msgid ""
"Chronology Error. There exist at least one invoice with a date posterior to "
"%s."
msgstr ""
#. module: account_invoice_constraint_chronology
#: model:ir.model,name:account_invoice_constraint_chronology.model_account_invoice
msgid "Invoice"
msgstr "Račun"
#. module: account_invoice_constraint_chronology
#: model:ir.model,name:account_invoice_constraint_chronology.model_account_journal
msgid "Journal"
msgstr ""

View File

@ -0,0 +1,50 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_constraint_chronology
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-30 00:47+0000\n"
"PO-Revision-Date: 2017-05-30 00:47+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Portuguese (Portugal) (https://www.transifex.com/oca/teams/23907/pt_PT/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: pt_PT\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: account_invoice_constraint_chronology
#: model:ir.model.fields,field_description:account_invoice_constraint_chronology.field_account_journal_check_chronology
msgid "Check chronology"
msgstr ""
#. module: account_invoice_constraint_chronology
#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:31
#, python-format
msgid ""
"Chronology Error. Please confirm older draft invoices before %s and try "
"again."
msgstr ""
#. module: account_invoice_constraint_chronology
#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:48
#, python-format
msgid ""
"Chronology Error. There exist at least one invoice with a date posterior to "
"%s."
msgstr ""
#. module: account_invoice_constraint_chronology
#: model:ir.model,name:account_invoice_constraint_chronology.model_account_invoice
msgid "Invoice"
msgstr ""
#. module: account_invoice_constraint_chronology
#: model:ir.model,name:account_invoice_constraint_chronology.model_account_journal
msgid "Journal"
msgstr "Diário"

View File

@ -3,15 +3,15 @@
# * account_invoice_constraint_chronology # * account_invoice_constraint_chronology
# #
# Translators: # Translators:
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015 # OCA Transbot <transbot@odoo-community.org>, 2017
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: account-financial-tools (8.0)\n" "Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-07-01 13:25+0000\n" "POT-Creation-Date: 2017-05-30 00:47+0000\n"
"PO-Revision-Date: 2015-07-04 11:49+0000\n" "PO-Revision-Date: 2017-05-30 00:47+0000\n"
"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n" "Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-account-financial-tools-8-0/language/sl/)\n" "Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
@ -19,20 +19,22 @@ msgstr ""
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
#. module: account_invoice_constraint_chronology #. module: account_invoice_constraint_chronology
#: field:account.journal,check_chronology:0 #: model:ir.model.fields,field_description:account_invoice_constraint_chronology.field_account_journal_check_chronology
msgid "Check Chronology" msgid "Check chronology"
msgstr "Preveri kronologijo" msgstr ""
#. module: account_invoice_constraint_chronology #. module: account_invoice_constraint_chronology
#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:59 #: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:31
#, python-format #, python-format
msgid "" msgid ""
"Chronology Error. Please confirm older draft invoices before %s and try " "Chronology Error. Please confirm older draft invoices before %s and try "
"again." "again."
msgstr "Kronološka napaka. Starejše osnutke računov potrdite pred %s in poskusite ponovno." msgstr ""
"Kronološka napaka. Starejše osnutke računov potrdite pred %s in poskusite "
"ponovno."
#. module: account_invoice_constraint_chronology #. module: account_invoice_constraint_chronology
#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:78 #: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:48
#, python-format #, python-format
msgid "" msgid ""
"Chronology Error. There exist at least one invoice with a date posterior to " "Chronology Error. There exist at least one invoice with a date posterior to "

View File

@ -0,0 +1,50 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_constraint_chronology
#
# Translators:
# Ediz Duman <neps1192@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-30 00:47+0000\n"
"PO-Revision-Date: 2017-05-30 00:47+0000\n"
"Last-Translator: Ediz Duman <neps1192@gmail.com>, 2017\n"
"Language-Team: Turkish (Turkey) (https://www.transifex.com/oca/teams/23907/tr_TR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: tr_TR\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#. module: account_invoice_constraint_chronology
#: model:ir.model.fields,field_description:account_invoice_constraint_chronology.field_account_journal_check_chronology
msgid "Check chronology"
msgstr ""
#. module: account_invoice_constraint_chronology
#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:31
#, python-format
msgid ""
"Chronology Error. Please confirm older draft invoices before %s and try "
"again."
msgstr ""
#. module: account_invoice_constraint_chronology
#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:48
#, python-format
msgid ""
"Chronology Error. There exist at least one invoice with a date posterior to "
"%s."
msgstr ""
#. module: account_invoice_constraint_chronology
#: model:ir.model,name:account_invoice_constraint_chronology.model_account_invoice
msgid "Invoice"
msgstr ""
#. module: account_invoice_constraint_chronology
#: model:ir.model,name:account_invoice_constraint_chronology.model_account_journal
msgid "Journal"
msgstr "Yevmiye"

View File

@ -8,7 +8,7 @@ from odoo import models, fields, api
class AccountJournal(models.Model): class AccountJournal(models.Model):
_inherit = ['account.journal'] _inherit = ['account.journal']
check_chronology = fields.Boolean(string='Check Chronology', default=False) check_chronology = fields.Boolean(default=False)
@api.onchange('type') @api.onchange('type')
def _onchange_type(self): def _onchange_type(self):

View File

@ -2,9 +2,10 @@
# Copyright 2015-2017 ACSONE SA/NV (<http://acsone.eu>) # Copyright 2015-2017 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from datetime import datetime, timedelta
import odoo.tests.common as common import odoo.tests.common as common
from odoo.exceptions import UserError from odoo.exceptions import UserError
from datetime import datetime, timedelta
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
@ -53,24 +54,24 @@ class TestAccountConstraintChronology(common.TransactionCase):
return journal return journal
def create_simple_invoice(self, journal_id, date): def create_simple_invoice(self, journal_id, date):
invoice = self.env['account.invoice'].create( invoice = self.env['account.invoice'].create({
{'partner_id': self.env.ref('base.res_partner_2').id, 'partner_id': self.env.ref('base.res_partner_2').id,
'account_id': self.account_account.id, 'account_id': self.account_account.id,
'type': 'in_invoice', 'type': 'in_invoice',
'journal_id': journal_id, 'journal_id': journal_id,
'date_invoice': date, 'date_invoice': date,
'state': 'draft', 'state': 'draft',
}) })
self.env['account.invoice.line'].create( self.env['account.invoice.line'].create({
{'product_id': self.product.id, 'product_id': self.product.id,
'quantity': 1.0, 'quantity': 1.0,
'price_unit': 100.0, 'price_unit': 100.0,
'invoice_id': invoice.id, 'invoice_id': invoice.id,
'name': 'product that cost 100', 'name': 'product that cost 100',
'account_id': self.account_account_line.id, 'account_id': self.account_account_line.id,
'account_analytic_id': self.analytic_account.id, 'account_analytic_id': self.analytic_account.id,
}) })
return invoice return invoice
def test_invoice_draft(self): def test_invoice_draft(self):