From 7de87354f07ef1bde1e9c1d0ed9aa4fd6524d86e Mon Sep 17 00:00:00 2001 From: Antonio Espinosa Date: Wed, 27 Jan 2016 13:54:21 +0100 Subject: [PATCH 01/29] [IMP] Copy partner payment mode to contracts when installing --- contract_payment_mode/README.rst | 1 + contract_payment_mode/__init__.py | 4 ++++ contract_payment_mode/__openerp__.py | 1 + contract_payment_mode/hooks.py | 24 ++++++++++++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 contract_payment_mode/hooks.py diff --git a/contract_payment_mode/README.rst b/contract_payment_mode/README.rst index 5d4ee46c0..09e27ba1f 100644 --- a/contract_payment_mode/README.rst +++ b/contract_payment_mode/README.rst @@ -34,6 +34,7 @@ Contributors ------------ * Ángel Moya +* Antonio Espinosa Maintainer diff --git a/contract_payment_mode/__init__.py b/contract_payment_mode/__init__.py index a0fdc10fe..753e6ceed 100644 --- a/contract_payment_mode/__init__.py +++ b/contract_payment_mode/__init__.py @@ -1,2 +1,6 @@ # -*- coding: utf-8 -*- +# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + from . import models +from .hooks import post_init_hook diff --git a/contract_payment_mode/__openerp__.py b/contract_payment_mode/__openerp__.py index 1eee7c8b6..f9c12929d 100644 --- a/contract_payment_mode/__openerp__.py +++ b/contract_payment_mode/__openerp__.py @@ -35,6 +35,7 @@ 'views/contract_view.xml', ], 'test': ['test/contract_payment_mode.yml'], + 'post_init_hook': 'post_init_hook', 'installable': True, 'auto_install': True, } diff --git a/contract_payment_mode/hooks.py b/contract_payment_mode/hooks.py new file mode 100644 index 000000000..01ee2da21 --- /dev/null +++ b/contract_payment_mode/hooks.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import api, SUPERUSER_ID +import logging + +_logger = logging.getLogger(__name__) + + +def post_init_hook(cr, registry): + """Copy payment mode from partner to the new field at contract.""" + with api.Environment.manage(): + env = api.Environment(cr, SUPERUSER_ID, {}) + m_contract = env['account.analytic.account'] + contracts = m_contract.search([('type', '=', 'contract')]) + if contracts: + _logger.info('Setting payment mode: %d contracts' % + len(contracts)) + for contract in contracts: + payment_mode = contract.partner_id.customer_payment_mode + if payment_mode: + contract.payment_mode_id = payment_mode.id + _logger.info('Setting payment mode: Done') From 803635dbca5b720c392ed77caebd4349226e6de3 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 22 Feb 2016 18:36:40 +0100 Subject: [PATCH 02/29] [ADD] contract_recurring_invoicing_markers ======================================= Markers for contract recurring invoices ======================================= This module allows to include some markers on the lines of your recurring invoices definition inside the contract so that the generated invoice lines will contain a dynamic text depending on these markers. These markers are the supported ones: * #START#: Start date of the invoiced period. * #END# End date of the invoiced period. Usage ===== On a contract (*Sales > Sales > Contracts*), mark "Generate recurring invoices automatically" for enabling the creation of recurring invoices. In the "Invoice Lines" section, you can add lines with products. In the *Description* field, you can now add any of the markers mentioned before between the rest of the text. When you invoice this contract (automatically or manually), your invoice will contain the corresponding text that replaces the marker. Known issues / Roadmap ====================== * Add more markers, like #START_MONTH# or #END_MONTH#. --- .../README.rst | 79 +++++ .../__init__.py | 5 + .../__openerp__.py | 19 ++ .../models/__init__.py | 5 + .../models/account_analytic_account.py | 41 +++ .../static/description/icon.png | Bin 0 -> 6327 bytes .../static/description/icon.svg | 320 ++++++++++++++++++ .../tests/__init__.py | 5 + ...est_contract_recurring_invoicing_marker.py | 39 +++ .../views/account_analytic_account_view.xml | 20 ++ 10 files changed, 533 insertions(+) create mode 100644 contract_recurring_invoicing_marker/README.rst create mode 100644 contract_recurring_invoicing_marker/__init__.py create mode 100644 contract_recurring_invoicing_marker/__openerp__.py create mode 100644 contract_recurring_invoicing_marker/models/__init__.py create mode 100644 contract_recurring_invoicing_marker/models/account_analytic_account.py create mode 100644 contract_recurring_invoicing_marker/static/description/icon.png create mode 100644 contract_recurring_invoicing_marker/static/description/icon.svg create mode 100644 contract_recurring_invoicing_marker/tests/__init__.py create mode 100644 contract_recurring_invoicing_marker/tests/test_contract_recurring_invoicing_marker.py create mode 100644 contract_recurring_invoicing_marker/views/account_analytic_account_view.xml diff --git a/contract_recurring_invoicing_marker/README.rst b/contract_recurring_invoicing_marker/README.rst new file mode 100644 index 000000000..a26d69360 --- /dev/null +++ b/contract_recurring_invoicing_marker/README.rst @@ -0,0 +1,79 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +======================================= +Markers for contract recurring invoices +======================================= + +This module allows to include some markers on the lines of your recurring +invoices definition inside the contract so that the generated invoice lines +will contain a dynamic text depending on these markers. + +These markers are the supported ones: + +* #START#: Start date of the invoiced period. +* #END# End date of the invoiced period. + +Usage +===== + +On a contract (*Sales > Sales > Contracts*), mark "Generate recurring invoices +automatically" for enabling the creation of recurring invoices. + +In the "Invoice Lines" section, you can add lines with products. In the +*Description* field, you can now add any of the markers mentioned before +between the rest of the text. + +When you invoice this contract (automatically or manually), your invoice +will contain the corresponding text that replaces the marker. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/110/8.0 + +Known issues / Roadmap +====================== + +* Add more markers, like #START_MONTH# or #END_MONTH#. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback `here `_. + +Credits +======= + +Contributors +------------ + +* Pedro M. Baeza + +Icon +---- + +* https://openclipart.org/detail/125071/pie-graph +* Subicon made by `Freepik _ from + www.flaticon.com + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/contract_recurring_invoicing_marker/__init__.py b/contract_recurring_invoicing_marker/__init__.py new file mode 100644 index 000000000..406086aa9 --- /dev/null +++ b/contract_recurring_invoicing_marker/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# (c) 2016 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import models diff --git a/contract_recurring_invoicing_marker/__openerp__.py b/contract_recurring_invoicing_marker/__openerp__.py new file mode 100644 index 000000000..f2efc5549 --- /dev/null +++ b/contract_recurring_invoicing_marker/__openerp__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# (c) 2016 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +{ + 'name': 'Markers for contract recurring invoices', + 'version': '8.0.1.0.0', + 'category': 'Contract Management', + 'author': 'Serv. Tecnol. Avanzados - Pedro M. Baeza, ' + 'Odoo Community Association (OCA)', + 'website': 'http://www.serviciosbaeza.com', + 'depends': [ + 'account_analytic_analysis', + ], + 'data': [ + 'views/account_analytic_account_view.xml', + ], + 'installable': True, +} diff --git a/contract_recurring_invoicing_marker/models/__init__.py b/contract_recurring_invoicing_marker/models/__init__.py new file mode 100644 index 000000000..9bde9c9bc --- /dev/null +++ b/contract_recurring_invoicing_marker/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# (c) 2016 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import account_analytic_account diff --git a/contract_recurring_invoicing_marker/models/account_analytic_account.py b/contract_recurring_invoicing_marker/models/account_analytic_account.py new file mode 100644 index 000000000..c29866551 --- /dev/null +++ b/contract_recurring_invoicing_marker/models/account_analytic_account.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# (c) 2016 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from openerp import api, fields, models +from dateutil.relativedelta import relativedelta + + +class AccountAnalyticAccount(models.Model): + _inherit = "account.analytic.account" + + @api.model + def _prepare_invoice(self, contract): + next_date = fields.Date.from_string( + contract.recurring_next_date or fields.Date.today()) + interval = contract.recurring_interval + old_date = next_date + if contract.recurring_rule_type == 'daily': + new_date = next_date + relativedelta(days=interval - 1) + elif contract.recurring_rule_type == 'weekly': + new_date = next_date + relativedelta(weeks=interval, days=-1) + else: + new_date = next_date + relativedelta(months=interval, days=-1) + obj = self.with_context(old_date=old_date, next_date=new_date) + return super(AccountAnalyticAccount, obj)._prepare_invoice(contract) + + @api.model + def _prepare_invoice_line(self, line, invoice_id): + res = super(AccountAnalyticAccount, self)._prepare_invoice_line( + line, invoice_id) + if 'old_date' in self.env.context and 'next_date' in self.env.context: + lang_obj = self.env['res.lang'] + contract = line.analytic_account_id + lang = lang_obj.search( + [('code', '=', contract.partner_id.lang)]) + date_format = lang.date_format + res['name'] = res['name'].replace( + '#START#', self.env.context['old_date'].strftime(date_format)) + res['name'] = res['name'].replace( + '#END#', self.env.context['next_date'].strftime(date_format)) + return res diff --git a/contract_recurring_invoicing_marker/static/description/icon.png b/contract_recurring_invoicing_marker/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d4d85b463492004db72160d3ecb6a3eaeac718eb GIT binary patch literal 6327 zcmaJ_c{r5syMM;MWDA)P6S8FA#*#IIY%wW&md4l_%gD~4By0Ji>>7#45<-NLLfKLY zNyxtMWIwO(@0{y8=btmzyz^e~Joj^N&*#2B_w_zBxvtAV$4LhOV9>jUx&hq@rxy(s z^xLN9&;{Kn{I2TVq=7!6G>);*Gp+YEOFu|{@brRR70wET{ydM@w!oX>obUk-zE}_t z5Fp{|;Cz9;ouvrzhvf0SZQm5L!8eH{Y45UySbz5ns3?~KOBO;=AWkdcy>5|@$_ zmr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v;E2*I*bu|e{nu%KYF3<|EgO00-X(Mt-h-z4JPNw1OeT)UE~EJ_;5t}z15 zgeMYR8{R{WQCBYM1t&}2y}^7>cXYZHZvEcpS4a7QjEqe1(T9v4r-Op)MUB)XiuR$V zrou(~c8i9tsT8e+x82cUf9T;DSy;`3d-o1|Jdlg_c@J+2>3t31?vRIgY&thpc8U@p zdZwk%fG^@IW(?-7YVpO?sPCDNA5W}jHCS3&7WFu7+QquCFGXwEKI=X3>)wWnB>!g) zS$@ac`oAYA`NIp}bsQtk1i@m7^;9HI2y~Uo?=ppG-kVvbE09_I?3(Ibnd@=#dm?Er z)!w|SR{4jH<%pJaRN1$&%$hW*V~`@pr9sx=Q^(wY!zQ!nZxw=u8m5smx|N{(cJdbA zexY#OYDUk@34(YKnA@Vp&p(NZn0_lWMLAAd@BY=_|Jr<1ob?_umz59-y(|ZM+SgI#SM8(z3mv1V!T + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + Pile of Golden Coins + 2010-04-09T03:27:45 + A pile of hypothetical golden coins, drawn in Inkscape. + https://openclipart.org/detail/43969/pile-of-golden-coins-by-j_alves + + + J_Alves + + + + + coin + currency + gold + money + thaler + + + + + + + + + + + diff --git a/contract_recurring_invoicing_marker/tests/__init__.py b/contract_recurring_invoicing_marker/tests/__init__.py new file mode 100644 index 000000000..6e03ad9f9 --- /dev/null +++ b/contract_recurring_invoicing_marker/tests/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# (c) 2016 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import test_contract_recurring_invoicing_marker diff --git a/contract_recurring_invoicing_marker/tests/test_contract_recurring_invoicing_marker.py b/contract_recurring_invoicing_marker/tests/test_contract_recurring_invoicing_marker.py new file mode 100644 index 000000000..607bb7db4 --- /dev/null +++ b/contract_recurring_invoicing_marker/tests/test_contract_recurring_invoicing_marker.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# (c) 2016 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +import openerp.tests.common as common + + +class TestContractRecurringInvoicingMarker(common.TransactionCase): + + def setUp(self): + super(TestContractRecurringInvoicingMarker, self).setUp() + self.partner = self.env['res.partner'].create({ + 'name': 'Test', + 'lang': 'en_US', + }) + self.product = self.env.ref('product.product_product_consultant') + self.uom = self.env.ref('product.product_uom_hour') + self.contract = self.env['account.analytic.account'].create({ + 'name': 'Test contract', + 'partner_id': self.partner.id, + 'type': 'contract', + 'recurring_invoices': 1, + 'recurring_next_date': '2016-01-01', + 'recurring_rule_type': 'monthly', + 'recurring_interval': 1, + 'recurring_invoice_line_ids': [ + (0, 0, {'quantity': 2.0, + 'price_unit': 100.0, + 'name': '#START# - #END#', + 'product_id': self.product.id, + 'uom_id': self.uom.id})], + }) + + def test_invoice_with_marker(self): + self.contract.recurring_create_invoice() + invoice = self.env['account.invoice'].search( + [('partner_id', '=', self.partner.id)]) + self.assertEqual( + invoice.invoice_line[0].name, u'01/01/2016 - 01/31/2016') diff --git a/contract_recurring_invoicing_marker/views/account_analytic_account_view.xml b/contract_recurring_invoicing_marker/views/account_analytic_account_view.xml new file mode 100644 index 000000000..5bc873584 --- /dev/null +++ b/contract_recurring_invoicing_marker/views/account_analytic_account_view.xml @@ -0,0 +1,20 @@ + + + + + + Contract form (with markers) + account.analytic.account + + + + +

#START#: Start date of the invoiced period

+

#END#: End date of the invoiced period

+
+
+
+
+ +
+
From 95feed8357ccda8e9c8acf26aa538059607a47e7 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 22 Feb 2016 18:49:00 +0100 Subject: [PATCH 03/29] [IMP] contract_recurring_invoicing_marker: Spanish translation --- .../i18n/es.po | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 contract_recurring_invoicing_marker/i18n/es.po diff --git a/contract_recurring_invoicing_marker/i18n/es.po b/contract_recurring_invoicing_marker/i18n/es.po new file mode 100644 index 000000000..00d9bb0ef --- /dev/null +++ b/contract_recurring_invoicing_marker/i18n/es.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_invoicing_marker +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-02-22 17:47+0000\n" +"PO-Revision-Date: 2016-02-22 17:47+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "#END#" +msgstr "#END#" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "#START#" +msgstr "#START#" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid ": End date of the invoiced period" +msgstr ": Fecha final del periodo facturado" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid ": Start date of the invoiced period" +msgstr ": Fecha inicial del periodo facturado" + +#. module: contract_recurring_invoicing_marker +#: model:ir.model,name:contract_recurring_invoicing_marker.model_account_analytic_account +msgid "Analytic Account" +msgstr "Cuenta analítica" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "Legend (for the markers inside invoice lines description)" +msgstr "Leyenda (para los marcadores dentro de la descripción de las líneas de factura)" + From 5d4e639086831b3ad1de1d8169baeb9a04f59afc Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 22 Feb 2016 19:26:41 +0100 Subject: [PATCH 04/29] [FIX] contract_recurring_invoicing_marker: Avoid empty date format --- .../models/account_analytic_account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contract_recurring_invoicing_marker/models/account_analytic_account.py b/contract_recurring_invoicing_marker/models/account_analytic_account.py index c29866551..a134d75eb 100644 --- a/contract_recurring_invoicing_marker/models/account_analytic_account.py +++ b/contract_recurring_invoicing_marker/models/account_analytic_account.py @@ -33,7 +33,7 @@ class AccountAnalyticAccount(models.Model): contract = line.analytic_account_id lang = lang_obj.search( [('code', '=', contract.partner_id.lang)]) - date_format = lang.date_format + date_format = lang.date_format or '%d/%M/%Y' res['name'] = res['name'].replace( '#START#', self.env.context['old_date'].strftime(date_format)) res['name'] = res['name'].replace( From 7ba0d29e0208cb3ff1980caa3da63dfdb52771e7 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 22 Feb 2016 19:50:58 +0100 Subject: [PATCH 05/29] [IMP] contract_recurring_invoicing_marker: Add more tests --- ...test_contract_recurring_invoicing_marker.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/contract_recurring_invoicing_marker/tests/test_contract_recurring_invoicing_marker.py b/contract_recurring_invoicing_marker/tests/test_contract_recurring_invoicing_marker.py index 607bb7db4..c0c605065 100644 --- a/contract_recurring_invoicing_marker/tests/test_contract_recurring_invoicing_marker.py +++ b/contract_recurring_invoicing_marker/tests/test_contract_recurring_invoicing_marker.py @@ -31,9 +31,25 @@ class TestContractRecurringInvoicingMarker(common.TransactionCase): 'uom_id': self.uom.id})], }) - def test_invoice_with_marker(self): + def test_monthly_invoice_with_marker(self): self.contract.recurring_create_invoice() invoice = self.env['account.invoice'].search( [('partner_id', '=', self.partner.id)]) self.assertEqual( invoice.invoice_line[0].name, u'01/01/2016 - 01/31/2016') + + def test_daily_invoice_with_marker(self): + self.contract.recurring_rule_type = 'daily' + self.contract.recurring_create_invoice() + invoice = self.env['account.invoice'].search( + [('partner_id', '=', self.partner.id)]) + self.assertEqual( + invoice.invoice_line[0].name, u'01/01/2016 - 01/01/2016') + + def test_weekly_invoice_with_marker(self): + self.contract.recurring_rule_type = 'weekly' + self.contract.recurring_create_invoice() + invoice = self.env['account.invoice'].search( + [('partner_id', '=', self.partner.id)]) + self.assertEqual( + invoice.invoice_line[0].name, u'01/01/2016 - 01/07/2016') From 1aa8ad8d371ec05759188b95b9da4780c782aaeb Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 23 Feb 2016 15:54:34 +0100 Subject: [PATCH 06/29] [FIX] contract_recurring_invoicing_marker: License key --- contract_recurring_invoicing_marker/__openerp__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contract_recurring_invoicing_marker/__openerp__.py b/contract_recurring_invoicing_marker/__openerp__.py index f2efc5549..5f75e7f04 100644 --- a/contract_recurring_invoicing_marker/__openerp__.py +++ b/contract_recurring_invoicing_marker/__openerp__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (c) 2016 Serv. Tecnol. Avanzados - Pedro M. Baeza +# © 2016 Serv. Tecnol. Avanzados - Pedro M. Baeza # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { @@ -12,6 +12,7 @@ 'depends': [ 'account_analytic_analysis', ], + 'license': 'AGPL-3', 'data': [ 'views/account_analytic_account_view.xml', ], From 7df454bc6ae05ad0a7d416e13828da341805ea1e Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Wed, 24 Feb 2016 12:29:54 +0100 Subject: [PATCH 07/29] [IMP] contract_recurring_invoicing_marker: Better inherability --- .../models/account_analytic_account.py | 13 +++++++++---- .../views/account_analytic_account_view.xml | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/contract_recurring_invoicing_marker/models/account_analytic_account.py b/contract_recurring_invoicing_marker/models/account_analytic_account.py index a134d75eb..b48285848 100644 --- a/contract_recurring_invoicing_marker/models/account_analytic_account.py +++ b/contract_recurring_invoicing_marker/models/account_analytic_account.py @@ -24,6 +24,12 @@ class AccountAnalyticAccount(models.Model): obj = self.with_context(old_date=old_date, next_date=new_date) return super(AccountAnalyticAccount, obj)._prepare_invoice(contract) + @api.model + def _insert_markers(self, line, date_start, date_end, date_format): + line = line.replace('#START#', date_start.strftime(date_format)) + line = line.replace('#END#', date_end.strftime(date_format)) + return line + @api.model def _prepare_invoice_line(self, line, invoice_id): res = super(AccountAnalyticAccount, self)._prepare_invoice_line( @@ -34,8 +40,7 @@ class AccountAnalyticAccount(models.Model): lang = lang_obj.search( [('code', '=', contract.partner_id.lang)]) date_format = lang.date_format or '%d/%M/%Y' - res['name'] = res['name'].replace( - '#START#', self.env.context['old_date'].strftime(date_format)) - res['name'] = res['name'].replace( - '#END#', self.env.context['next_date'].strftime(date_format)) + res['name'] = self._insert_markers( + res['name'], self.env.context['old_date'], + self.env.context['next_date'], date_format) return res diff --git a/contract_recurring_invoicing_marker/views/account_analytic_account_view.xml b/contract_recurring_invoicing_marker/views/account_analytic_account_view.xml index 5bc873584..fbbd330b0 100644 --- a/contract_recurring_invoicing_marker/views/account_analytic_account_view.xml +++ b/contract_recurring_invoicing_marker/views/account_analytic_account_view.xml @@ -8,7 +8,7 @@ - +

#START#: Start date of the invoiced period

#END#: End date of the invoiced period

From c73cb116140aba96846e357c2a1d128e41eff379 Mon Sep 17 00:00:00 2001 From: Antonio Espinosa Date: Fri, 4 Mar 2016 16:33:41 +0100 Subject: [PATCH 08/29] Adding test --- contract_payment_mode/hooks.py | 5 ++- contract_payment_mode/tests/__init__.py | 5 +++ .../tests/test_contract_payment_init.py | 40 +++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 contract_payment_mode/tests/__init__.py create mode 100644 contract_payment_mode/tests/test_contract_payment_init.py diff --git a/contract_payment_mode/hooks.py b/contract_payment_mode/hooks.py index 01ee2da21..5e68b6c39 100644 --- a/contract_payment_mode/hooks.py +++ b/contract_payment_mode/hooks.py @@ -13,7 +13,10 @@ def post_init_hook(cr, registry): with api.Environment.manage(): env = api.Environment(cr, SUPERUSER_ID, {}) m_contract = env['account.analytic.account'] - contracts = m_contract.search([('type', '=', 'contract')]) + contracts = m_contract.search([ + ('type', '=', 'contract'), + ('payment_mode_id', '=', False), + ]) if contracts: _logger.info('Setting payment mode: %d contracts' % len(contracts)) diff --git a/contract_payment_mode/tests/__init__.py b/contract_payment_mode/tests/__init__.py new file mode 100644 index 000000000..be86a7bf3 --- /dev/null +++ b/contract_payment_mode/tests/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import test_contract_payment_init diff --git a/contract_payment_mode/tests/test_contract_payment_init.py b/contract_payment_mode/tests/test_contract_payment_init.py new file mode 100644 index 000000000..2056a162d --- /dev/null +++ b/contract_payment_mode/tests/test_contract_payment_init.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# © 2015 Antiun Ingenieria S.L. - Antonio Espinosa +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp.tests.common import TransactionCase +from ..hooks import post_init_hook + + +class TestContractPaymentInit(TransactionCase): + # Use case : Prepare some data for current test case + def setUp(self): + super(TestContractPaymentInit, self).setUp() + self.payment_mode = self.env.ref('account_payment.payment_mode_1') + self.partner = self.env['res.partner'].create({ + 'name': 'Test contract partner', + 'customer_payment_mode': self.payment_mode.id, + }) + + def _contract_payment_mode_id(self, contract_id): + contract = self.env['account.analytic.account'].search([ + ('id', '=', contract_id), + ]) + return contract.payment_mode_id.id + + def test_post_init_hook(self): + contract = self.env['account.analytic.account'].create({ + 'name': 'Test contract', + 'type': 'contract', + 'partner_id': self.partner.id, + 'payment_mode_id': self.payment_mode.id, + }) + self.assertEqual(self._contract_payment_mode_id(contract.id), + self.payment_mode.id) + + contract.payment_mode_id = False + self.assertEqual(self._contract_payment_mode_id(contract.id), False) + + post_init_hook(self.cr, self.env) + self.assertEqual(self._contract_payment_mode_id(contract.id), + self.payment_mode.id) From f43d6f8a975079c6789354b643e9182192d08438 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 7 Mar 2016 17:51:28 +0100 Subject: [PATCH 09/29] [FIX] contract_recurring_invoicing_marker: Incorrect default date format --- .../models/account_analytic_account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contract_recurring_invoicing_marker/models/account_analytic_account.py b/contract_recurring_invoicing_marker/models/account_analytic_account.py index b48285848..40ac46383 100644 --- a/contract_recurring_invoicing_marker/models/account_analytic_account.py +++ b/contract_recurring_invoicing_marker/models/account_analytic_account.py @@ -39,7 +39,7 @@ class AccountAnalyticAccount(models.Model): contract = line.analytic_account_id lang = lang_obj.search( [('code', '=', contract.partner_id.lang)]) - date_format = lang.date_format or '%d/%M/%Y' + date_format = lang.date_format or '%m/%d/%Y' res['name'] = self._insert_markers( res['name'], self.env.context['old_date'], self.env.context['next_date'], date_format) From cc37901df6f4d9d7d6c07012e6a6438a3da6e713 Mon Sep 17 00:00:00 2001 From: OCA Git Bot Date: Tue, 8 Mar 2016 02:33:40 +0100 Subject: [PATCH 10/29] [UPD] addons table in README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6fc24a336..272f59963 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ addon | version | summary [contract_discount](contract_discount/) | 8.0.1.0.0 | Discounts for contracts and their invoices [contract_journal](contract_journal/) | 8.0.1.0.0 | Invoice Journal in contracts and their invoices [contract_payment_mode](contract_payment_mode/) | 8.0.1.0.0 | Payment mode in contracts and their invoices +[contract_recurring_invoicing_marker](contract_recurring_invoicing_marker/) | 8.0.1.0.0 | Markers for contract recurring invoices [contract_recurring_plans](contract_recurring_plans/) | 8.0.1.0.0 | Analytic plans on contracts recurring invoices [contract_show_invoice](contract_show_invoice/) | 8.0.1.0.0 | Button in contracts to show their invoices [contract_show_recurring_invoice](contract_show_recurring_invoice/) | 8.0.1.0.0 | Button in contracts to show their recurring invoices From a952382ff5cb1734f6bd35f5d81c91e98d3c7a2f Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 12 Mar 2016 03:16:13 -0500 Subject: [PATCH 11/29] OCA Transbot updated translations from Transifex --- contract_payment_mode/i18n/pt_BR.po | 9 ++-- .../i18n/de.po | 48 ++++++++++++++++++ .../i18n/pt_BR.po | 48 ++++++++++++++++++ .../i18n/sl.po | 49 +++++++++++++++++++ contract_recurring_plans/i18n/pt_BR.po | 29 +++++++++++ contract_show_invoice/i18n/pt_BR.po | 40 +++++++++++++++ contract_show_recurring_invoice/i18n/pt_BR.po | 15 +++--- 7 files changed, 227 insertions(+), 11 deletions(-) create mode 100644 contract_recurring_invoicing_marker/i18n/de.po create mode 100644 contract_recurring_invoicing_marker/i18n/pt_BR.po create mode 100644 contract_recurring_invoicing_marker/i18n/sl.po create mode 100644 contract_recurring_plans/i18n/pt_BR.po create mode 100644 contract_show_invoice/i18n/pt_BR.po diff --git a/contract_payment_mode/i18n/pt_BR.po b/contract_payment_mode/i18n/pt_BR.po index fe1f942b6..028007082 100644 --- a/contract_payment_mode/i18n/pt_BR.po +++ b/contract_payment_mode/i18n/pt_BR.po @@ -3,13 +3,14 @@ # * contract_payment_mode # # Translators: +# danimaribeiro , 2016 msgid "" msgstr "" "Project-Id-Version: contract (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-11-07 12:33+0000\n" -"PO-Revision-Date: 2015-11-07 12:33+0000\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2016-03-08 01:39+0000\n" +"PO-Revision-Date: 2016-03-05 18:19+0000\n" +"Last-Translator: danimaribeiro \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-contract-8-0/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -25,4 +26,4 @@ msgstr "Conta Analítica" #. module: contract_payment_mode #: field:account.analytic.account,payment_mode_id:0 msgid "Payment Mode" -msgstr "" +msgstr "Modo de pagamento" diff --git a/contract_recurring_invoicing_marker/i18n/de.po b/contract_recurring_invoicing_marker/i18n/de.po new file mode 100644 index 000000000..894ce2223 --- /dev/null +++ b/contract_recurring_invoicing_marker/i18n/de.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_invoicing_marker +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-08 01:39+0000\n" +"PO-Revision-Date: 2016-03-07 23:16+0000\n" +"Last-Translator: <>\n" +"Language-Team: German (http://www.transifex.com/oca/OCA-contract-8-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "#END#" +msgstr "" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "#START#" +msgstr "" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid ": End date of the invoiced period" +msgstr "" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid ": Start date of the invoiced period" +msgstr "" + +#. module: contract_recurring_invoicing_marker +#: model:ir.model,name:contract_recurring_invoicing_marker.model_account_analytic_account +msgid "Analytic Account" +msgstr "Kostenstelle" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "Legend (for the markers inside invoice lines description)" +msgstr "" diff --git a/contract_recurring_invoicing_marker/i18n/pt_BR.po b/contract_recurring_invoicing_marker/i18n/pt_BR.po new file mode 100644 index 000000000..1e06f49bc --- /dev/null +++ b/contract_recurring_invoicing_marker/i18n/pt_BR.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_invoicing_marker +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-08 01:39+0000\n" +"PO-Revision-Date: 2016-03-07 23:16+0000\n" +"Last-Translator: <>\n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-contract-8-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "#END#" +msgstr "" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "#START#" +msgstr "" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid ": End date of the invoiced period" +msgstr "" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid ": Start date of the invoiced period" +msgstr "" + +#. module: contract_recurring_invoicing_marker +#: model:ir.model,name:contract_recurring_invoicing_marker.model_account_analytic_account +msgid "Analytic Account" +msgstr "Conta analítica" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "Legend (for the markers inside invoice lines description)" +msgstr "" diff --git a/contract_recurring_invoicing_marker/i18n/sl.po b/contract_recurring_invoicing_marker/i18n/sl.po new file mode 100644 index 000000000..bf50975ef --- /dev/null +++ b/contract_recurring_invoicing_marker/i18n/sl.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_invoicing_marker +# +# Translators: +# Matjaž Mozetič , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-08 01:39+0000\n" +"PO-Revision-Date: 2016-03-08 07:00+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-contract-8-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "#END#" +msgstr "#END#" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "#START#" +msgstr "#START#" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid ": End date of the invoiced period" +msgstr ": Končni datum obračunskega obdobja" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid ": Start date of the invoiced period" +msgstr ": Začetni datum obračunskega obdobja" + +#. module: contract_recurring_invoicing_marker +#: model:ir.model,name:contract_recurring_invoicing_marker.model_account_analytic_account +msgid "Analytic Account" +msgstr "Analitični konto" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "Legend (for the markers inside invoice lines description)" +msgstr "Legenda (za kazalnike znotraj opisa postavk računa)" diff --git a/contract_recurring_plans/i18n/pt_BR.po b/contract_recurring_plans/i18n/pt_BR.po new file mode 100644 index 000000000..ffe69f1b8 --- /dev/null +++ b/contract_recurring_plans/i18n/pt_BR.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_plans +# +# Translators: +# danimaribeiro , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-08 01:39+0000\n" +"PO-Revision-Date: 2016-03-05 18:19+0000\n" +"Last-Translator: danimaribeiro \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-contract-8-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: contract_recurring_plans +#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +msgid "Analytic Account" +msgstr "Conta analítica" + +#. module: contract_recurring_plans +#: field:account.analytic.invoice.line,analytics_id:0 +msgid "Analytic Distribution" +msgstr "Distribuição analítica" diff --git a/contract_show_invoice/i18n/pt_BR.po b/contract_show_invoice/i18n/pt_BR.po new file mode 100644 index 000000000..c596ac58b --- /dev/null +++ b/contract_show_invoice/i18n/pt_BR.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_show_invoice +# +# Translators: +# danimaribeiro , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-08 01:39+0000\n" +"PO-Revision-Date: 2016-03-05 18:19+0000\n" +"Last-Translator: danimaribeiro \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-contract-8-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: contract_show_invoice +#: field:account.invoice,analytic_account_ids:0 +msgid "Contracts" +msgstr "Contratos" + +#. module: contract_show_invoice +#: model:ir.model,name:contract_show_invoice.model_account_invoice +msgid "Invoice" +msgstr "Fatura" + +#. module: contract_show_invoice +#: view:account.analytic.account:contract_show_invoice.account_analytic_account_button_invoice +#: model:ir.actions.act_window,name:contract_show_invoice.act_analytic_invoices +msgid "Invoices" +msgstr "Faturas" + +#. module: contract_show_invoice +#: view:account.analytic.account:contract_show_invoice.account_analytic_account_button_invoice +msgid "Invoices related with this contract" +msgstr "Faturas relacionadas com este contrato" diff --git a/contract_show_recurring_invoice/i18n/pt_BR.po b/contract_show_recurring_invoice/i18n/pt_BR.po index d3e61ef15..25340568f 100644 --- a/contract_show_recurring_invoice/i18n/pt_BR.po +++ b/contract_show_recurring_invoice/i18n/pt_BR.po @@ -3,13 +3,14 @@ # * contract_show_recurring_invoice # # Translators: +# danimaribeiro , 2016 msgid "" msgstr "" "Project-Id-Version: contract (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-10-14 02:21+0000\n" -"PO-Revision-Date: 2015-10-13 10:45+0000\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2016-03-08 01:39+0000\n" +"PO-Revision-Date: 2016-03-05 18:19+0000\n" +"Last-Translator: danimaribeiro \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-contract-8-0/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -25,19 +26,19 @@ msgstr "Conta Analítica" #. module: contract_show_recurring_invoice #: field:account.invoice,contract_id:0 msgid "Contract" -msgstr "" +msgstr "Contrato" #. module: contract_show_recurring_invoice #: model:ir.model,name:contract_show_recurring_invoice.model_account_invoice msgid "Invoice" -msgstr "" +msgstr "Fatura" #. module: contract_show_recurring_invoice #: model:ir.actions.act_window,name:contract_show_recurring_invoice.act_recurring_invoices msgid "Invoices" -msgstr "" +msgstr "Faturas" #. module: contract_show_recurring_invoice #: view:account.analytic.account:contract_show_recurring_invoice.account_analytic_account_button_recurring_invoice msgid "⇒ show invoices" -msgstr "" +msgstr "⇒ mostrar faturas" From c52f002e0dc4c48724ee87f9054b184114e98b79 Mon Sep 17 00:00:00 2001 From: OCA Git Bot Date: Thu, 14 Apr 2016 04:35:07 +0200 Subject: [PATCH 12/29] [ADD] setup.py --- setup/.setuptools-odoo-make-default-ignore | 2 ++ setup/README | 2 ++ setup/contract_discount/odoo_addons/__init__.py | 1 + setup/contract_discount/odoo_addons/contract_discount | 1 + setup/contract_discount/setup.py | 6 ++++++ setup/contract_journal/odoo_addons/__init__.py | 1 + setup/contract_journal/odoo_addons/contract_journal | 1 + setup/contract_journal/setup.py | 6 ++++++ setup/contract_payment_mode/odoo_addons/__init__.py | 1 + .../contract_payment_mode/odoo_addons/contract_payment_mode | 1 + setup/contract_payment_mode/setup.py | 6 ++++++ .../odoo_addons/__init__.py | 1 + .../odoo_addons/contract_recurring_invoicing_marker | 1 + setup/contract_recurring_invoicing_marker/setup.py | 6 ++++++ setup/contract_recurring_plans/odoo_addons/__init__.py | 1 + .../odoo_addons/contract_recurring_plans | 1 + setup/contract_recurring_plans/setup.py | 6 ++++++ setup/contract_show_invoice/odoo_addons/__init__.py | 1 + .../contract_show_invoice/odoo_addons/contract_show_invoice | 1 + setup/contract_show_invoice/setup.py | 6 ++++++ .../contract_show_recurring_invoice/odoo_addons/__init__.py | 1 + .../odoo_addons/contract_show_recurring_invoice | 1 + setup/contract_show_recurring_invoice/setup.py | 6 ++++++ 23 files changed, 60 insertions(+) create mode 100644 setup/.setuptools-odoo-make-default-ignore create mode 100644 setup/README create mode 100644 setup/contract_discount/odoo_addons/__init__.py create mode 120000 setup/contract_discount/odoo_addons/contract_discount create mode 100644 setup/contract_discount/setup.py create mode 100644 setup/contract_journal/odoo_addons/__init__.py create mode 120000 setup/contract_journal/odoo_addons/contract_journal create mode 100644 setup/contract_journal/setup.py create mode 100644 setup/contract_payment_mode/odoo_addons/__init__.py create mode 120000 setup/contract_payment_mode/odoo_addons/contract_payment_mode create mode 100644 setup/contract_payment_mode/setup.py create mode 100644 setup/contract_recurring_invoicing_marker/odoo_addons/__init__.py create mode 120000 setup/contract_recurring_invoicing_marker/odoo_addons/contract_recurring_invoicing_marker create mode 100644 setup/contract_recurring_invoicing_marker/setup.py create mode 100644 setup/contract_recurring_plans/odoo_addons/__init__.py create mode 120000 setup/contract_recurring_plans/odoo_addons/contract_recurring_plans create mode 100644 setup/contract_recurring_plans/setup.py create mode 100644 setup/contract_show_invoice/odoo_addons/__init__.py create mode 120000 setup/contract_show_invoice/odoo_addons/contract_show_invoice create mode 100644 setup/contract_show_invoice/setup.py create mode 100644 setup/contract_show_recurring_invoice/odoo_addons/__init__.py create mode 120000 setup/contract_show_recurring_invoice/odoo_addons/contract_show_recurring_invoice create mode 100644 setup/contract_show_recurring_invoice/setup.py diff --git a/setup/.setuptools-odoo-make-default-ignore b/setup/.setuptools-odoo-make-default-ignore new file mode 100644 index 000000000..207e61533 --- /dev/null +++ b/setup/.setuptools-odoo-make-default-ignore @@ -0,0 +1,2 @@ +# addons listed in this file are ignored by +# setuptools-odoo-make-default (one addon per line) diff --git a/setup/README b/setup/README new file mode 100644 index 000000000..a63d633e8 --- /dev/null +++ b/setup/README @@ -0,0 +1,2 @@ +To learn more about this directory, please visit +https://pypi.python.org/pypi/setuptools-odoo diff --git a/setup/contract_discount/odoo_addons/__init__.py b/setup/contract_discount/odoo_addons/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/contract_discount/odoo_addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/contract_discount/odoo_addons/contract_discount b/setup/contract_discount/odoo_addons/contract_discount new file mode 120000 index 000000000..e7e46b401 --- /dev/null +++ b/setup/contract_discount/odoo_addons/contract_discount @@ -0,0 +1 @@ +../../../contract_discount \ No newline at end of file diff --git a/setup/contract_discount/setup.py b/setup/contract_discount/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/contract_discount/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/contract_journal/odoo_addons/__init__.py b/setup/contract_journal/odoo_addons/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/contract_journal/odoo_addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/contract_journal/odoo_addons/contract_journal b/setup/contract_journal/odoo_addons/contract_journal new file mode 120000 index 000000000..8d3d620ca --- /dev/null +++ b/setup/contract_journal/odoo_addons/contract_journal @@ -0,0 +1 @@ +../../../contract_journal \ No newline at end of file diff --git a/setup/contract_journal/setup.py b/setup/contract_journal/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/contract_journal/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/contract_payment_mode/odoo_addons/__init__.py b/setup/contract_payment_mode/odoo_addons/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/contract_payment_mode/odoo_addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/contract_payment_mode/odoo_addons/contract_payment_mode b/setup/contract_payment_mode/odoo_addons/contract_payment_mode new file mode 120000 index 000000000..eea95444c --- /dev/null +++ b/setup/contract_payment_mode/odoo_addons/contract_payment_mode @@ -0,0 +1 @@ +../../../contract_payment_mode \ No newline at end of file diff --git a/setup/contract_payment_mode/setup.py b/setup/contract_payment_mode/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/contract_payment_mode/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/contract_recurring_invoicing_marker/odoo_addons/__init__.py b/setup/contract_recurring_invoicing_marker/odoo_addons/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/contract_recurring_invoicing_marker/odoo_addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/contract_recurring_invoicing_marker/odoo_addons/contract_recurring_invoicing_marker b/setup/contract_recurring_invoicing_marker/odoo_addons/contract_recurring_invoicing_marker new file mode 120000 index 000000000..3f30e900d --- /dev/null +++ b/setup/contract_recurring_invoicing_marker/odoo_addons/contract_recurring_invoicing_marker @@ -0,0 +1 @@ +../../../contract_recurring_invoicing_marker \ No newline at end of file diff --git a/setup/contract_recurring_invoicing_marker/setup.py b/setup/contract_recurring_invoicing_marker/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/contract_recurring_invoicing_marker/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/contract_recurring_plans/odoo_addons/__init__.py b/setup/contract_recurring_plans/odoo_addons/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/contract_recurring_plans/odoo_addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/contract_recurring_plans/odoo_addons/contract_recurring_plans b/setup/contract_recurring_plans/odoo_addons/contract_recurring_plans new file mode 120000 index 000000000..c6cd6791b --- /dev/null +++ b/setup/contract_recurring_plans/odoo_addons/contract_recurring_plans @@ -0,0 +1 @@ +../../../contract_recurring_plans \ No newline at end of file diff --git a/setup/contract_recurring_plans/setup.py b/setup/contract_recurring_plans/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/contract_recurring_plans/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/contract_show_invoice/odoo_addons/__init__.py b/setup/contract_show_invoice/odoo_addons/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/contract_show_invoice/odoo_addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/contract_show_invoice/odoo_addons/contract_show_invoice b/setup/contract_show_invoice/odoo_addons/contract_show_invoice new file mode 120000 index 000000000..f4c5123df --- /dev/null +++ b/setup/contract_show_invoice/odoo_addons/contract_show_invoice @@ -0,0 +1 @@ +../../../contract_show_invoice \ No newline at end of file diff --git a/setup/contract_show_invoice/setup.py b/setup/contract_show_invoice/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/contract_show_invoice/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/contract_show_recurring_invoice/odoo_addons/__init__.py b/setup/contract_show_recurring_invoice/odoo_addons/__init__.py new file mode 100644 index 000000000..de40ea7ca --- /dev/null +++ b/setup/contract_show_recurring_invoice/odoo_addons/__init__.py @@ -0,0 +1 @@ +__import__('pkg_resources').declare_namespace(__name__) diff --git a/setup/contract_show_recurring_invoice/odoo_addons/contract_show_recurring_invoice b/setup/contract_show_recurring_invoice/odoo_addons/contract_show_recurring_invoice new file mode 120000 index 000000000..234ecd0c6 --- /dev/null +++ b/setup/contract_show_recurring_invoice/odoo_addons/contract_show_recurring_invoice @@ -0,0 +1 @@ +../../../contract_show_recurring_invoice \ No newline at end of file diff --git a/setup/contract_show_recurring_invoice/setup.py b/setup/contract_show_recurring_invoice/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/contract_show_recurring_invoice/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) From d8d3c765e6e24a9526c55305aee8279b16796c46 Mon Sep 17 00:00:00 2001 From: Javi Melendez Date: Mon, 25 Apr 2016 09:48:15 +0200 Subject: [PATCH 13/29] [FIX] contract_payment_mode: get bank account from partner (#30) in recurring invoice --- contract_payment_mode/models/contract.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contract_payment_mode/models/contract.py b/contract_payment_mode/models/contract.py index 0aa60e893..1d2556673 100644 --- a/contract_payment_mode/models/contract.py +++ b/contract_payment_mode/models/contract.py @@ -26,7 +26,8 @@ class AccountAnalyticAccount(models.Model): _prepare_invoice_data(contract) if contract.payment_mode_id: invoice_vals['payment_mode_id'] = contract.payment_mode_id.id - invoice_vals['partner_bank_id'] = \ - contract.payment_mode_id.bank_id.id + invoice_vals['partner_bank_id'] = ( + contract.partner_id.bank_ids[:1].id or + contract.payment_mode_id.bank_id.id) return invoice_vals From cae70abe8d9990bed49a70399774de8f82cdabde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Wed, 27 Apr 2016 21:10:54 +0200 Subject: [PATCH 14/29] [IMP] contract_show_invoice: more lightweight solution (#31) [IMP] contract_show_invoice: more lightweight solution In order to implement the button, it's not necessary to have a heavy stored computed field. So I propose to remove it. --- contract_show_invoice/README.rst | 2 +- contract_show_invoice/__init__.py | 1 - contract_show_invoice/__openerp__.py | 7 ++-- .../i18n/contract_invoices_button.pot | 9 ++--- contract_show_invoice/models/__init__.py | 2 -- contract_show_invoice/models/invoice.py | 19 ---------- .../test/contract_show_invoice_test.yml | 35 ------------------- contract_show_invoice/views/contract_view.xml | 6 ++-- 8 files changed, 7 insertions(+), 74 deletions(-) delete mode 100644 contract_show_invoice/models/__init__.py delete mode 100644 contract_show_invoice/models/invoice.py delete mode 100644 contract_show_invoice/test/contract_show_invoice_test.yml diff --git a/contract_show_invoice/README.rst b/contract_show_invoice/README.rst index 9f1fc92ed..b143ce0d7 100644 --- a/contract_show_invoice/README.rst +++ b/contract_show_invoice/README.rst @@ -40,7 +40,7 @@ Contributors ------------ * Ángel Moya - +* Stéphane Bidoul Maintainer ---------- diff --git a/contract_show_invoice/__init__.py b/contract_show_invoice/__init__.py index a0fdc10fe..40a96afc6 100644 --- a/contract_show_invoice/__init__.py +++ b/contract_show_invoice/__init__.py @@ -1,2 +1 @@ # -*- coding: utf-8 -*- -from . import models diff --git a/contract_show_invoice/__openerp__.py b/contract_show_invoice/__openerp__.py index f7f773c4c..2efb26111 100644 --- a/contract_show_invoice/__openerp__.py +++ b/contract_show_invoice/__openerp__.py @@ -22,17 +22,14 @@ { 'name': 'Contract Show Invoice', 'summary': 'Button in contracts to show their invoices', - 'version': '8.0.1.0.0', - 'author': 'Domatix, Odoo Community Association (OCA)', + 'version': '8.0.2.0.0', + 'author': 'Domatix,Odoo Community Association (OCA)', 'website': 'http://www.domatix.com', 'depends': ['account_analytic_analysis'], 'category': 'Sales Management', 'data': [ 'views/contract_view.xml', ], - 'test': [ - 'test/contract_show_invoice_test.yml' - ], 'installable': True, 'auto_install': False, } diff --git a/contract_show_invoice/i18n/contract_invoices_button.pot b/contract_show_invoice/i18n/contract_invoices_button.pot index 6341c0666..a6ef757bf 100644 --- a/contract_show_invoice/i18n/contract_invoices_button.pot +++ b/contract_show_invoice/i18n/contract_invoices_button.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-10-01 07:58+0000\n" -"PO-Revision-Date: 2015-10-01 07:58+0000\n" +"POT-Creation-Date: 2016-04-13 12:35+0000\n" +"PO-Revision-Date: 2016-04-13 12:35+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -15,11 +15,6 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: contract_show_invoice -#: field:account.invoice,analytic_account_ids:0 -msgid "Contracts" -msgstr "" - #. module: contract_show_invoice #: model:ir.model,name:contract_show_invoice.model_account_invoice msgid "Invoice" diff --git a/contract_show_invoice/models/__init__.py b/contract_show_invoice/models/__init__.py deleted file mode 100644 index 78d96a031..000000000 --- a/contract_show_invoice/models/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# -*- coding: utf-8 -*- -from . import invoice diff --git a/contract_show_invoice/models/invoice.py b/contract_show_invoice/models/invoice.py deleted file mode 100644 index e3d3efb00..000000000 --- a/contract_show_invoice/models/invoice.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- - -from openerp import models, fields, api - - -class AccountInvoice(models.Model): - _inherit = 'account.invoice' - - @api.one - @api.depends('invoice_line.account_analytic_id') - def _analytic_account_ids(self): - self.analytic_account_ids = \ - self.mapped('invoice_line.account_analytic_id') - - analytic_account_ids = fields.Many2many( - comodel_name='account.analytic.account', - compute='_analytic_account_ids', - store=True, - string='Contracts') diff --git a/contract_show_invoice/test/contract_show_invoice_test.yml b/contract_show_invoice/test/contract_show_invoice_test.yml deleted file mode 100644 index b0174271f..000000000 --- a/contract_show_invoice/test/contract_show_invoice_test.yml +++ /dev/null @@ -1,35 +0,0 @@ -- - In order to test Contract Invoices Button I create a new Contract -- - !record {model: account.analytic.account, id: contract_main}: - name: Maintenance of Servers - company_id: base.main_company - partner_id: base.main_partner - type: contract - recurring_invoices : 1 - recurring_interval : 1 - recurring_invoice_line_ids: - - quantity: 2.0 - price_unit: 100.0 - name: Database Administration 25 - product_id: product.product_product_consultant - uom_id: product.product_uom_hour -- - I test the invoices button -- - !python {model: account.invoice}: | - contract_id = ref('contract_show_invoice.contract_main') - invoices = self.search(cr, uid,[('analytic_account_ids','=',contract_id)],context=context) - assert len(invoices) == 0, "No invoices related this contract, but get (%s)"%(invoices,) -- - I generate all invoices from contracts having recurring invoicing -- - !python {model: account.analytic.account}: | - self.recurring_create_invoice(cr, uid, []) -- - I test the invoices button -- - !python {model: account.invoice}: | - contract_id = ref('contract_show_invoice.contract_main') - invoices = self.search(cr, uid,[('analytic_account_ids','=',contract_id)],context=context) - assert len(invoices) == 1, "Must have one invoice related this contract, but get (%s)"%(invoices,) \ No newline at end of file diff --git a/contract_show_invoice/views/contract_view.xml b/contract_show_invoice/views/contract_view.xml index e89fa445c..ae29e9c61 100644 --- a/contract_show_invoice/views/contract_view.xml +++ b/contract_show_invoice/views/contract_view.xml @@ -3,11 +3,9 @@ - {'search_default_analytic_account_ids': - [active_id], 'default_analytic_account_ids': active_id} Invoices account.invoice - [('analytic_account_ids','=',active_id)] + [('invoice_line.account_analytic_id','=',active_id)] @@ -28,4 +26,4 @@ - \ No newline at end of file + From 5a2d4590553ef8fa1cc95bbbe79e887c29fa6b67 Mon Sep 17 00:00:00 2001 From: OCA Git Bot Date: Thu, 28 Apr 2016 02:40:42 +0200 Subject: [PATCH 15/29] [UPD] addons table in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 272f59963..49c9511c5 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ addon | version | summary [contract_payment_mode](contract_payment_mode/) | 8.0.1.0.0 | Payment mode in contracts and their invoices [contract_recurring_invoicing_marker](contract_recurring_invoicing_marker/) | 8.0.1.0.0 | Markers for contract recurring invoices [contract_recurring_plans](contract_recurring_plans/) | 8.0.1.0.0 | Analytic plans on contracts recurring invoices -[contract_show_invoice](contract_show_invoice/) | 8.0.1.0.0 | Button in contracts to show their invoices +[contract_show_invoice](contract_show_invoice/) | 8.0.2.0.0 | Button in contracts to show their invoices [contract_show_recurring_invoice](contract_show_recurring_invoice/) | 8.0.1.0.0 | Button in contracts to show their recurring invoices [//]: # (end addons) From 39320589a4721062e7cac880e1e853c2cfceb4ee Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 30 Apr 2016 06:27:09 -0400 Subject: [PATCH 16/29] OCA Transbot updated translations from Transifex --- contract_show_invoice/i18n/de.po | 16 +++------------ contract_show_invoice/i18n/en.po | 14 ++----------- contract_show_invoice/i18n/es.po | 31 ++++++++++------------------- contract_show_invoice/i18n/pt_BR.po | 17 ++++------------ contract_show_invoice/i18n/sl.po | 16 +++------------ 5 files changed, 23 insertions(+), 71 deletions(-) diff --git a/contract_show_invoice/i18n/de.po b/contract_show_invoice/i18n/de.po index 14f744cc9..e6cc01ac8 100644 --- a/contract_show_invoice/i18n/de.po +++ b/contract_show_invoice/i18n/de.po @@ -8,9 +8,9 @@ msgid "" msgstr "" "Project-Id-Version: contract (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-11-30 01:38+0000\n" -"PO-Revision-Date: 2015-11-25 09:21+0000\n" -"Last-Translator: Rudolf Schnapka \n" +"POT-Creation-Date: 2016-04-28 00:54+0000\n" +"PO-Revision-Date: 2016-04-27 19:38+0000\n" +"Last-Translator: OCA Transbot \n" "Language-Team: German (http://www.transifex.com/oca/OCA-contract-8-0/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,16 +18,6 @@ msgstr "" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. module: contract_show_invoice -#: field:account.invoice,analytic_account_ids:0 -msgid "Contracts" -msgstr "Verträge" - -#. module: contract_show_invoice -#: model:ir.model,name:contract_show_invoice.model_account_invoice -msgid "Invoice" -msgstr "Rechnung" - #. module: contract_show_invoice #: view:account.analytic.account:contract_show_invoice.account_analytic_account_button_invoice #: model:ir.actions.act_window,name:contract_show_invoice.act_analytic_invoices diff --git a/contract_show_invoice/i18n/en.po b/contract_show_invoice/i18n/en.po index 22eaa1c65..6a0f11e81 100644 --- a/contract_show_invoice/i18n/en.po +++ b/contract_show_invoice/i18n/en.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: contract (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-10-14 02:21+0000\n" -"PO-Revision-Date: 2015-10-12 19:18+0000\n" +"POT-Creation-Date: 2016-04-28 00:54+0000\n" +"PO-Revision-Date: 2016-04-27 19:38+0000\n" "Last-Translator: OCA Transbot \n" "Language-Team: English (http://www.transifex.com/oca/OCA-contract-8-0/language/en/)\n" "MIME-Version: 1.0\n" @@ -17,16 +17,6 @@ msgstr "" "Language: en\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. module: contract_show_invoice -#: field:account.invoice,analytic_account_ids:0 -msgid "Contracts" -msgstr "Contracts" - -#. module: contract_show_invoice -#: model:ir.model,name:contract_show_invoice.model_account_invoice -msgid "Invoice" -msgstr "Invoice" - #. module: contract_show_invoice #: view:account.analytic.account:contract_show_invoice.account_analytic_account_button_invoice #: model:ir.actions.act_window,name:contract_show_invoice.act_analytic_invoices diff --git a/contract_show_invoice/i18n/es.po b/contract_show_invoice/i18n/es.po index 6addc6b8c..31a19801a 100644 --- a/contract_show_invoice/i18n/es.po +++ b/contract_show_invoice/i18n/es.po @@ -1,30 +1,21 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * contract_show_invoice -# +# * contract_show_invoice +# +# Translators: msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: contract (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-10-01 07:59+0000\n" -"PO-Revision-Date: 2015-10-01 10:00+0100\n" -"Last-Translator: <>\n" -"Language-Team: \n" +"POT-Creation-Date: 2016-04-28 00:54+0000\n" +"PO-Revision-Date: 2016-04-27 19:38+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-contract-8-0/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: \n" -"X-Generator: Poedit 1.7.5\n" - -#. module: contract_show_invoice -#: field:account.invoice,analytic_account_ids:0 -msgid "Contracts" -msgstr "Contratos" - -#. module: contract_show_invoice -#: model:ir.model,name:contract_show_invoice.model_account_invoice -msgid "Invoice" -msgstr "Factura" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: contract_show_invoice #: view:account.analytic.account:contract_show_invoice.account_analytic_account_button_invoice diff --git a/contract_show_invoice/i18n/pt_BR.po b/contract_show_invoice/i18n/pt_BR.po index c596ac58b..1ed954f36 100644 --- a/contract_show_invoice/i18n/pt_BR.po +++ b/contract_show_invoice/i18n/pt_BR.po @@ -4,13 +4,14 @@ # # Translators: # danimaribeiro , 2016 +# danimaribeiro , 2016 msgid "" msgstr "" "Project-Id-Version: contract (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-03-08 01:39+0000\n" -"PO-Revision-Date: 2016-03-05 18:19+0000\n" -"Last-Translator: danimaribeiro \n" +"POT-Creation-Date: 2016-04-28 00:54+0000\n" +"PO-Revision-Date: 2016-04-27 19:38+0000\n" +"Last-Translator: OCA Transbot \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-contract-8-0/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,16 +19,6 @@ msgstr "" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#. module: contract_show_invoice -#: field:account.invoice,analytic_account_ids:0 -msgid "Contracts" -msgstr "Contratos" - -#. module: contract_show_invoice -#: model:ir.model,name:contract_show_invoice.model_account_invoice -msgid "Invoice" -msgstr "Fatura" - #. module: contract_show_invoice #: view:account.analytic.account:contract_show_invoice.account_analytic_account_button_invoice #: model:ir.actions.act_window,name:contract_show_invoice.act_analytic_invoices diff --git a/contract_show_invoice/i18n/sl.po b/contract_show_invoice/i18n/sl.po index d10367964..f99032b0e 100644 --- a/contract_show_invoice/i18n/sl.po +++ b/contract_show_invoice/i18n/sl.po @@ -8,9 +8,9 @@ msgid "" msgstr "" "Project-Id-Version: contract (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-10-14 02:21+0000\n" -"PO-Revision-Date: 2015-10-13 04:54+0000\n" -"Last-Translator: Matjaž Mozetič \n" +"POT-Creation-Date: 2016-04-28 00:54+0000\n" +"PO-Revision-Date: 2016-04-27 19:38+0000\n" +"Last-Translator: OCA Transbot \n" "Language-Team: Slovenian (http://www.transifex.com/oca/OCA-contract-8-0/language/sl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -18,16 +18,6 @@ msgstr "" "Language: sl\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" -#. module: contract_show_invoice -#: field:account.invoice,analytic_account_ids:0 -msgid "Contracts" -msgstr "Pogodbe" - -#. module: contract_show_invoice -#: model:ir.model,name:contract_show_invoice.model_account_invoice -msgid "Invoice" -msgstr "Račun" - #. module: contract_show_invoice #: view:account.analytic.account:contract_show_invoice.account_analytic_account_button_invoice #: model:ir.actions.act_window,name:contract_show_invoice.act_analytic_invoices From 0fd4b35e4fa0ca2bafe6d3c6aa908aa24aa40da8 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 21 May 2016 06:48:08 -0400 Subject: [PATCH 17/29] OCA Transbot updated translations from Transifex --- contract_discount/i18n/fr.po | 42 ++++++++++++++++ contract_journal/i18n/fr.po | 29 +++++++++++ contract_payment_mode/i18n/fr.po | 29 +++++++++++ .../i18n/fr.po | 49 +++++++++++++++++++ contract_recurring_plans/i18n/fr.po | 29 +++++++++++ contract_show_invoice/i18n/fr.po | 30 ++++++++++++ contract_show_recurring_invoice/i18n/fr.po | 44 +++++++++++++++++ 7 files changed, 252 insertions(+) create mode 100644 contract_discount/i18n/fr.po create mode 100644 contract_journal/i18n/fr.po create mode 100644 contract_payment_mode/i18n/fr.po create mode 100644 contract_recurring_invoicing_marker/i18n/fr.po create mode 100644 contract_recurring_plans/i18n/fr.po create mode 100644 contract_show_invoice/i18n/fr.po create mode 100644 contract_show_recurring_invoice/i18n/fr.po diff --git a/contract_discount/i18n/fr.po b/contract_discount/i18n/fr.po new file mode 100644 index 000000000..164814ce8 --- /dev/null +++ b/contract_discount/i18n/fr.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_discount +# +# Translators: +# Christophe CHAUVET , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-30 10:34+0000\n" +"PO-Revision-Date: 2016-05-19 16:11+0000\n" +"Last-Translator: Christophe CHAUVET \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-contract-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: contract_discount +#: model:ir.model,name:contract_discount.model_account_analytic_account +msgid "Analytic Account" +msgstr "Compte analytique" + +#. module: contract_discount +#: field:account.analytic.invoice.line,discount:0 +msgid "Discount (%)" +msgstr "Remise (%)" + +#. module: contract_discount +#: code:addons/contract_discount/models/contract.py:41 +#, python-format +msgid "Discount should be less or equal to 100" +msgstr "La remise doit être inférieur ou égale à 100 " + +#. module: contract_discount +#: help:account.analytic.invoice.line,discount:0 +msgid "" +"Discount that is applied in generated invoices. It should be less or equal " +"to 100" +msgstr "La remise qui sera appliquée aux factures générés. elle doit être inférieur ou égale à 100" diff --git a/contract_journal/i18n/fr.po b/contract_journal/i18n/fr.po new file mode 100644 index 000000000..efe8080fd --- /dev/null +++ b/contract_journal/i18n/fr.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_journal +# +# Translators: +# Christophe CHAUVET , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-30 10:34+0000\n" +"PO-Revision-Date: 2016-05-19 16:09+0000\n" +"Last-Translator: Christophe CHAUVET \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-contract-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: contract_journal +#: model:ir.model,name:contract_journal.model_account_analytic_account +msgid "Analytic Account" +msgstr "Compte analytique" + +#. module: contract_journal +#: field:account.analytic.account,journal_id:0 +msgid "Journal" +msgstr "Journal" diff --git a/contract_payment_mode/i18n/fr.po b/contract_payment_mode/i18n/fr.po new file mode 100644 index 000000000..2f73f80b2 --- /dev/null +++ b/contract_payment_mode/i18n/fr.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_payment_mode +# +# Translators: +# Christophe CHAUVET , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-30 10:34+0000\n" +"PO-Revision-Date: 2016-05-19 16:11+0000\n" +"Last-Translator: Christophe CHAUVET \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-contract-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: contract_payment_mode +#: model:ir.model,name:contract_payment_mode.model_account_analytic_account +msgid "Analytic Account" +msgstr "Compte analytique" + +#. module: contract_payment_mode +#: field:account.analytic.account,payment_mode_id:0 +msgid "Payment Mode" +msgstr "Mode de paiement" diff --git a/contract_recurring_invoicing_marker/i18n/fr.po b/contract_recurring_invoicing_marker/i18n/fr.po new file mode 100644 index 000000000..31500a547 --- /dev/null +++ b/contract_recurring_invoicing_marker/i18n/fr.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_invoicing_marker +# +# Translators: +# Christophe CHAUVET , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-30 10:34+0000\n" +"PO-Revision-Date: 2016-05-19 16:13+0000\n" +"Last-Translator: Christophe CHAUVET \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-contract-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "#END#" +msgstr "#END#" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "#START#" +msgstr "#START#" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid ": End date of the invoiced period" +msgstr ": Date de fin de la période facturé" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid ": Start date of the invoiced period" +msgstr ": Date de début de la période facturé" + +#. module: contract_recurring_invoicing_marker +#: model:ir.model,name:contract_recurring_invoicing_marker.model_account_analytic_account +msgid "Analytic Account" +msgstr "Compte analytique" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "Legend (for the markers inside invoice lines description)" +msgstr "Légende (pour les marques à l'intérieur de la description des lignes de facture)" diff --git a/contract_recurring_plans/i18n/fr.po b/contract_recurring_plans/i18n/fr.po new file mode 100644 index 000000000..c58eb4170 --- /dev/null +++ b/contract_recurring_plans/i18n/fr.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_plans +# +# Translators: +# Christophe CHAUVET , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-30 10:34+0000\n" +"PO-Revision-Date: 2016-05-19 16:11+0000\n" +"Last-Translator: Christophe CHAUVET \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-contract-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: contract_recurring_plans +#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +msgid "Analytic Account" +msgstr "Compte analytique" + +#. module: contract_recurring_plans +#: field:account.analytic.invoice.line,analytics_id:0 +msgid "Analytic Distribution" +msgstr "Distribution analytique" diff --git a/contract_show_invoice/i18n/fr.po b/contract_show_invoice/i18n/fr.po new file mode 100644 index 000000000..959ab4d09 --- /dev/null +++ b/contract_show_invoice/i18n/fr.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_show_invoice +# +# Translators: +# Christophe CHAUVET , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-30 10:34+0000\n" +"PO-Revision-Date: 2016-05-19 16:09+0000\n" +"Last-Translator: Christophe CHAUVET \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-contract-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: contract_show_invoice +#: view:account.analytic.account:contract_show_invoice.account_analytic_account_button_invoice +#: model:ir.actions.act_window,name:contract_show_invoice.act_analytic_invoices +msgid "Invoices" +msgstr "Factures" + +#. module: contract_show_invoice +#: view:account.analytic.account:contract_show_invoice.account_analytic_account_button_invoice +msgid "Invoices related with this contract" +msgstr "Factures liés à ce contrat" diff --git a/contract_show_recurring_invoice/i18n/fr.po b/contract_show_recurring_invoice/i18n/fr.po new file mode 100644 index 000000000..ab057068e --- /dev/null +++ b/contract_show_recurring_invoice/i18n/fr.po @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_show_recurring_invoice +# +# Translators: +# Christophe CHAUVET , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-30 10:34+0000\n" +"PO-Revision-Date: 2016-05-19 16:11+0000\n" +"Last-Translator: Christophe CHAUVET \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-contract-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: contract_show_recurring_invoice +#: model:ir.model,name:contract_show_recurring_invoice.model_account_analytic_account +msgid "Analytic Account" +msgstr "Compte analytique" + +#. module: contract_show_recurring_invoice +#: field:account.invoice,contract_id:0 +msgid "Contract" +msgstr "Contrat" + +#. module: contract_show_recurring_invoice +#: model:ir.model,name:contract_show_recurring_invoice.model_account_invoice +msgid "Invoice" +msgstr "Facture" + +#. module: contract_show_recurring_invoice +#: model:ir.actions.act_window,name:contract_show_recurring_invoice.act_recurring_invoices +msgid "Invoices" +msgstr "Factures" + +#. module: contract_show_recurring_invoice +#: view:account.analytic.account:contract_show_recurring_invoice.account_analytic_account_button_recurring_invoice +msgid "⇒ show invoices" +msgstr "⇒ montrer les factures" From a86be52085853822cb5863a8392bc2263f63fccb Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 28 May 2016 06:54:34 -0400 Subject: [PATCH 18/29] OCA Transbot updated translations from Transifex --- contract_discount/i18n/sk_SK.po | 41 ++++++++++++++++ contract_journal/i18n/sk_SK.po | 28 +++++++++++ contract_payment_mode/i18n/sk_SK.po | 28 +++++++++++ .../i18n/sk_SK.po | 48 +++++++++++++++++++ contract_recurring_plans/i18n/sk_SK.po | 28 +++++++++++ contract_show_invoice/i18n/sk_SK.po | 30 ++++++++++++ contract_show_recurring_invoice/i18n/sk_SK.po | 44 +++++++++++++++++ 7 files changed, 247 insertions(+) create mode 100644 contract_discount/i18n/sk_SK.po create mode 100644 contract_journal/i18n/sk_SK.po create mode 100644 contract_payment_mode/i18n/sk_SK.po create mode 100644 contract_recurring_invoicing_marker/i18n/sk_SK.po create mode 100644 contract_recurring_plans/i18n/sk_SK.po create mode 100644 contract_show_invoice/i18n/sk_SK.po create mode 100644 contract_show_recurring_invoice/i18n/sk_SK.po diff --git a/contract_discount/i18n/sk_SK.po b/contract_discount/i18n/sk_SK.po new file mode 100644 index 000000000..0ce9fa6a9 --- /dev/null +++ b/contract_discount/i18n/sk_SK.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_discount +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-05-21 10:53+0000\n" +"PO-Revision-Date: 2015-09-18 10:33+0000\n" +"Last-Translator: <>\n" +"Language-Team: Slovak (Slovakia) (http://www.transifex.com/oca/OCA-contract-8-0/language/sk_SK/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sk_SK\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: contract_discount +#: model:ir.model,name:contract_discount.model_account_analytic_account +msgid "Analytic Account" +msgstr "Analytický účet" + +#. module: contract_discount +#: field:account.analytic.invoice.line,discount:0 +msgid "Discount (%)" +msgstr "" + +#. module: contract_discount +#: code:addons/contract_discount/models/contract.py:41 +#, python-format +msgid "Discount should be less or equal to 100" +msgstr "" + +#. module: contract_discount +#: help:account.analytic.invoice.line,discount:0 +msgid "" +"Discount that is applied in generated invoices. It should be less or equal " +"to 100" +msgstr "" diff --git a/contract_journal/i18n/sk_SK.po b/contract_journal/i18n/sk_SK.po new file mode 100644 index 000000000..e904edcd4 --- /dev/null +++ b/contract_journal/i18n/sk_SK.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_journal +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-05-21 10:53+0000\n" +"PO-Revision-Date: 2015-10-12 21:23+0000\n" +"Last-Translator: <>\n" +"Language-Team: Slovak (Slovakia) (http://www.transifex.com/oca/OCA-contract-8-0/language/sk_SK/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sk_SK\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: contract_journal +#: model:ir.model,name:contract_journal.model_account_analytic_account +msgid "Analytic Account" +msgstr "Analytický účet" + +#. module: contract_journal +#: field:account.analytic.account,journal_id:0 +msgid "Journal" +msgstr "" diff --git a/contract_payment_mode/i18n/sk_SK.po b/contract_payment_mode/i18n/sk_SK.po new file mode 100644 index 000000000..ed203d294 --- /dev/null +++ b/contract_payment_mode/i18n/sk_SK.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_payment_mode +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-05-21 10:53+0000\n" +"PO-Revision-Date: 2015-11-07 12:33+0000\n" +"Last-Translator: <>\n" +"Language-Team: Slovak (Slovakia) (http://www.transifex.com/oca/OCA-contract-8-0/language/sk_SK/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sk_SK\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: contract_payment_mode +#: model:ir.model,name:contract_payment_mode.model_account_analytic_account +msgid "Analytic Account" +msgstr "Analytický účet" + +#. module: contract_payment_mode +#: field:account.analytic.account,payment_mode_id:0 +msgid "Payment Mode" +msgstr "" diff --git a/contract_recurring_invoicing_marker/i18n/sk_SK.po b/contract_recurring_invoicing_marker/i18n/sk_SK.po new file mode 100644 index 000000000..41c425a44 --- /dev/null +++ b/contract_recurring_invoicing_marker/i18n/sk_SK.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_invoicing_marker +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-05-21 10:53+0000\n" +"PO-Revision-Date: 2016-03-07 23:16+0000\n" +"Last-Translator: <>\n" +"Language-Team: Slovak (Slovakia) (http://www.transifex.com/oca/OCA-contract-8-0/language/sk_SK/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sk_SK\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "#END#" +msgstr "" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "#START#" +msgstr "" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid ": End date of the invoiced period" +msgstr "" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid ": Start date of the invoiced period" +msgstr "" + +#. module: contract_recurring_invoicing_marker +#: model:ir.model,name:contract_recurring_invoicing_marker.model_account_analytic_account +msgid "Analytic Account" +msgstr "Analytický účet" + +#. module: contract_recurring_invoicing_marker +#: view:account.analytic.account:contract_recurring_invoicing_marker.account_analytic_account_form_form +msgid "Legend (for the markers inside invoice lines description)" +msgstr "" diff --git a/contract_recurring_plans/i18n/sk_SK.po b/contract_recurring_plans/i18n/sk_SK.po new file mode 100644 index 000000000..ab2c7c130 --- /dev/null +++ b/contract_recurring_plans/i18n/sk_SK.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_plans +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-05-21 10:53+0000\n" +"PO-Revision-Date: 2015-11-29 23:23+0000\n" +"Last-Translator: <>\n" +"Language-Team: Slovak (Slovakia) (http://www.transifex.com/oca/OCA-contract-8-0/language/sk_SK/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sk_SK\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: contract_recurring_plans +#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +msgid "Analytic Account" +msgstr "Analytický účet" + +#. module: contract_recurring_plans +#: field:account.analytic.invoice.line,analytics_id:0 +msgid "Analytic Distribution" +msgstr "" diff --git a/contract_show_invoice/i18n/sk_SK.po b/contract_show_invoice/i18n/sk_SK.po new file mode 100644 index 000000000..ebb37f717 --- /dev/null +++ b/contract_show_invoice/i18n/sk_SK.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_show_invoice +# +# Translators: +# ivbo , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-05-21 10:53+0000\n" +"PO-Revision-Date: 2016-05-24 14:08+0000\n" +"Last-Translator: ivbo \n" +"Language-Team: Slovak (Slovakia) (http://www.transifex.com/oca/OCA-contract-8-0/language/sk_SK/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sk_SK\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: contract_show_invoice +#: view:account.analytic.account:contract_show_invoice.account_analytic_account_button_invoice +#: model:ir.actions.act_window,name:contract_show_invoice.act_analytic_invoices +msgid "Invoices" +msgstr "Faktúry" + +#. module: contract_show_invoice +#: view:account.analytic.account:contract_show_invoice.account_analytic_account_button_invoice +msgid "Invoices related with this contract" +msgstr "Faktúry súvisiace s touto zmluvou" diff --git a/contract_show_recurring_invoice/i18n/sk_SK.po b/contract_show_recurring_invoice/i18n/sk_SK.po new file mode 100644 index 000000000..0c9160dfa --- /dev/null +++ b/contract_show_recurring_invoice/i18n/sk_SK.po @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_show_recurring_invoice +# +# Translators: +# ivbo , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-05-21 10:53+0000\n" +"PO-Revision-Date: 2016-05-24 14:08+0000\n" +"Last-Translator: ivbo \n" +"Language-Team: Slovak (Slovakia) (http://www.transifex.com/oca/OCA-contract-8-0/language/sk_SK/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sk_SK\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: contract_show_recurring_invoice +#: model:ir.model,name:contract_show_recurring_invoice.model_account_analytic_account +msgid "Analytic Account" +msgstr "Analytický účet" + +#. module: contract_show_recurring_invoice +#: field:account.invoice,contract_id:0 +msgid "Contract" +msgstr "Zmluva" + +#. module: contract_show_recurring_invoice +#: model:ir.model,name:contract_show_recurring_invoice.model_account_invoice +msgid "Invoice" +msgstr "Faktúra" + +#. module: contract_show_recurring_invoice +#: model:ir.actions.act_window,name:contract_show_recurring_invoice.act_recurring_invoices +msgid "Invoices" +msgstr "Faktúry" + +#. module: contract_show_recurring_invoice +#: view:account.analytic.account:contract_show_recurring_invoice.account_analytic_account_button_recurring_invoice +msgid "⇒ show invoices" +msgstr "⇒ ukázať faktúry" From b447d7fcd6e751d0d9701762faff15bca002c542 Mon Sep 17 00:00:00 2001 From: Carlos Incaser Date: Mon, 13 Jun 2016 20:11:56 +0200 Subject: [PATCH 19/29] [NEW] contract_invoice_merge_by_partner: New module --- contract_invoice_merge_by_partner/README.rst | 63 ++++++++++++++++++ contract_invoice_merge_by_partner/__init__.py | 5 ++ .../__openerp__.py | 17 +++++ .../models/__init__.py | 5 ++ .../models/account_analytic_analysis.py | 28 ++++++++ .../static/description/icon.png | Bin 0 -> 9455 bytes .../tests/__init__.py | 5 ++ .../test_contract_invoice_merge_by_partner.py | 11 +++ 8 files changed, 134 insertions(+) create mode 100644 contract_invoice_merge_by_partner/README.rst create mode 100644 contract_invoice_merge_by_partner/__init__.py create mode 100644 contract_invoice_merge_by_partner/__openerp__.py create mode 100644 contract_invoice_merge_by_partner/models/__init__.py create mode 100644 contract_invoice_merge_by_partner/models/account_analytic_analysis.py create mode 100644 contract_invoice_merge_by_partner/static/description/icon.png create mode 100644 contract_invoice_merge_by_partner/tests/__init__.py create mode 100644 contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py diff --git a/contract_invoice_merge_by_partner/README.rst b/contract_invoice_merge_by_partner/README.rst new file mode 100644 index 000000000..2371ab5d0 --- /dev/null +++ b/contract_invoice_merge_by_partner/README.rst @@ -0,0 +1,63 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +================================= +Contract Invoice Merge By Partner +================================= + +This module merges same partner invoices generated by contracts. + +Installation +============ + +To install this module you need *account_invoice_merge*, available in: + +* Install repository `OCA/account-invoicing `_. + +Usage +===== + +#. Go to ... + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/95/8.0 + +Known issues / Roadmap +====================== + +* If product supplier info min quantity is greater than procurement qty and we + have sale orders with distinct analytic account which contains this product, + each purchase order line takes seller min quantity. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. + +Credits +======= + +Contributors +------------ +* Carlos Dauden +* Pedro M. Baeza + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/contract_invoice_merge_by_partner/__init__.py b/contract_invoice_merge_by_partner/__init__.py new file mode 100644 index 000000000..cfa84f545 --- /dev/null +++ b/contract_invoice_merge_by_partner/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2016 Carlos Dauden +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/contract_invoice_merge_by_partner/__openerp__.py b/contract_invoice_merge_by_partner/__openerp__.py new file mode 100644 index 000000000..f6f67f5fa --- /dev/null +++ b/contract_invoice_merge_by_partner/__openerp__.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# © 2016 Carlos Dauden +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Contract Invoice Merge By Partner', + 'summary': 'This module merges same partner invoices generated by ' + 'contracts', + 'version': '8.0.1.0.0', + 'category': 'Account', + 'license': 'AGPL-3', + 'author': "Tecnativa, " + "Odoo Community Association (OCA)", + 'website': 'http://www.tecnativa.com', + 'depends': ['account_analytic_analysis', 'account_invoice_merge'], + 'installable': True, +} diff --git a/contract_invoice_merge_by_partner/models/__init__.py b/contract_invoice_merge_by_partner/models/__init__.py new file mode 100644 index 000000000..fc5ce8e98 --- /dev/null +++ b/contract_invoice_merge_by_partner/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2016 Carlos Dauden +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import account_analytic_analysis diff --git a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py new file mode 100644 index 000000000..23c46dcfd --- /dev/null +++ b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# © 2016 Carlos Dauden +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import api, models + + +class PurchaseOrderLine(models.Model): + _inherit = 'account.analytic.account' + + @api.multi + def _recurring_create_invoice(self, automatic=False): + invoices = self.env['account.invoice'].browse( + super(PurchaseOrderLine, self)._recurring_create_invoice(automatic) + ) + res = [] + unlink_list = [] + for partner in invoices.mapped('partner_id'): + inv_to_merge = invoices.filtered(lambda x: x.partner_id == partner) + if len(inv_to_merge) > 1: + invoices_info = inv_to_merge.do_merge( + keep_references=True, date_invoice=False) + res.extend(invoices_info.keys()) + for inv_ids_list in invoices_info.values(): + unlink_list.append(inv_ids_list) + else: + res.append(inv_to_merge.id) + return res diff --git a/contract_invoice_merge_by_partner/static/description/icon.png b/contract_invoice_merge_by_partner/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE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~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/contract_invoice_merge_by_partner/tests/__init__.py b/contract_invoice_merge_by_partner/tests/__init__.py new file mode 100644 index 000000000..181cf9bd9 --- /dev/null +++ b/contract_invoice_merge_by_partner/tests/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2016 Carlos Dauden +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_contract_invoice_merge_by_partner diff --git a/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py b/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py new file mode 100644 index 000000000..147689c9a --- /dev/null +++ b/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# © 2016 Carlos Dauden +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp.tests.common import TransactionCase + + +class TestContractInvoiceMergeByPartner(TransactionCase): + """ Use case : Prepare some data for current test case """ + def setUp(self): + super(TestContractInvoiceMergeByPartner, self).setUp() From c273694bbd125f040a73219f2eea623a0954876c Mon Sep 17 00:00:00 2001 From: Carlos Incaser Date: Tue, 14 Jun 2016 11:47:46 +0200 Subject: [PATCH 20/29] [IMP] contract_invoice_merge_by_partner: Tests and improvements. --- contract_invoice_merge_by_partner/README.rst | 6 +++- .../models/account_analytic_analysis.py | 7 ++-- .../test_contract_invoice_merge_by_partner.py | 33 +++++++++++++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/contract_invoice_merge_by_partner/README.rst b/contract_invoice_merge_by_partner/README.rst index 2371ab5d0..4dba40bc2 100644 --- a/contract_invoice_merge_by_partner/README.rst +++ b/contract_invoice_merge_by_partner/README.rst @@ -18,7 +18,11 @@ To install this module you need *account_invoice_merge*, available in: Usage ===== -#. Go to ... +#. Go to *Sales > Contracts* and create some contrats with same partner +#. Go to *Settings > Automation > Scheduled Actions* +#. Select *Generate Recurring Invoices from Contracts* +#. Set previous time that now in *Next Execution Date* +#. Go to *Invoicing > Customer Invoices* and show merged invoice .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot diff --git a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py index 23c46dcfd..5d31287cd 100644 --- a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py +++ b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py @@ -10,7 +10,8 @@ class PurchaseOrderLine(models.Model): @api.multi def _recurring_create_invoice(self, automatic=False): - invoices = self.env['account.invoice'].browse( + invoice_obj = self.env['account.invoice'] + invoices = invoice_obj.browse( super(PurchaseOrderLine, self)._recurring_create_invoice(automatic) ) res = [] @@ -22,7 +23,9 @@ class PurchaseOrderLine(models.Model): keep_references=True, date_invoice=False) res.extend(invoices_info.keys()) for inv_ids_list in invoices_info.values(): - unlink_list.append(inv_ids_list) + unlink_list.extend(inv_ids_list) else: res.append(inv_to_merge.id) + if unlink_list: + invoice_obj.browse(unlink_list).unlink() return res diff --git a/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py b/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py index 147689c9a..e7defcd66 100644 --- a/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py +++ b/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py @@ -9,3 +9,36 @@ class TestContractInvoiceMergeByPartner(TransactionCase): """ Use case : Prepare some data for current test case """ def setUp(self): super(TestContractInvoiceMergeByPartner, self).setUp() + #self.partner = self.env.ref('base.res_partner_2') + self.partner = self.env['res.partner'].create( + {'customer': True, + 'name': "Test Customer" + }) + self.product = self.env.ref('product.product_product_consultant') + self.uom = self.env.ref('product.product_uom_hour') + self.contract1 = self.env['account.analytic.account'].create({ + 'name': 'Test contract', + 'partner_id': self.partner.id, + 'type': 'contract', + 'recurring_invoices': True, + 'recurring_rule_type': 'monthly', + 'recurring_interval': 1, + 'recurring_invoice_line_ids': [ + (0, 0, {'quantity': 2.0, + 'price_unit': 100.0, + 'name': self.product.name, + 'product_id': self.product.id, + 'uom_id': self.uom.id})], + }) + self.contract2 = self.contract1.copy() + self.contract3 = self.contract1.copy() + self.contract4 = self.contract1.copy() + + def test_invoices_merged(self): + self.env['account.analytic.account']._cron_recurring_create_invoice() + invoices = self.env['account.invoice'].search( + [('partner_id', '=', self.partner.id)]) + inv_draft = invoices.filtered(lambda x: x.state == 'draft') + self.assertEqual(len(inv_draft), 1) + inv_cancel = invoices.filtered(lambda x: x.state == 'cancel') + self.assertFalse(inv_cancel) From 2a34a8cbc7936ddfd276b86a83adffb47e0f6f7d Mon Sep 17 00:00:00 2001 From: Carlos Incaser Date: Tue, 14 Jun 2016 14:29:45 +0200 Subject: [PATCH 21/29] [FIX] contract_invoice_merge_by_partner: Minor fix --- contract_invoice_merge_by_partner/README.rst | 8 +------- .../models/account_analytic_analysis.py | 3 +-- .../tests/test_contract_invoice_merge_by_partner.py | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/contract_invoice_merge_by_partner/README.rst b/contract_invoice_merge_by_partner/README.rst index 4dba40bc2..62a31b8da 100644 --- a/contract_invoice_merge_by_partner/README.rst +++ b/contract_invoice_merge_by_partner/README.rst @@ -18,7 +18,7 @@ To install this module you need *account_invoice_merge*, available in: Usage ===== -#. Go to *Sales > Contracts* and create some contrats with same partner +#. Go to *Sales > Contracts* and create some contracts with same partner #. Go to *Settings > Automation > Scheduled Actions* #. Select *Generate Recurring Invoices from Contracts* #. Set previous time that now in *Next Execution Date* @@ -28,12 +28,6 @@ Usage :alt: Try me on Runbot :target: https://runbot.odoo-community.org/runbot/95/8.0 -Known issues / Roadmap -====================== - -* If product supplier info min quantity is greater than procurement qty and we - have sale orders with distinct analytic account which contains this product, - each purchase order line takes seller min quantity. Bug Tracker =========== diff --git a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py index 5d31287cd..a695ab29d 100644 --- a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py +++ b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py @@ -19,8 +19,7 @@ class PurchaseOrderLine(models.Model): for partner in invoices.mapped('partner_id'): inv_to_merge = invoices.filtered(lambda x: x.partner_id == partner) if len(inv_to_merge) > 1: - invoices_info = inv_to_merge.do_merge( - keep_references=True, date_invoice=False) + invoices_info = inv_to_merge.do_merge() res.extend(invoices_info.keys()) for inv_ids_list in invoices_info.values(): unlink_list.extend(inv_ids_list) diff --git a/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py b/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py index e7defcd66..84863d113 100644 --- a/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py +++ b/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py @@ -35,7 +35,7 @@ class TestContractInvoiceMergeByPartner(TransactionCase): self.contract4 = self.contract1.copy() def test_invoices_merged(self): - self.env['account.analytic.account']._cron_recurring_create_invoice() + self.env['account.analytic.account']._recurring_create_invoice() invoices = self.env['account.invoice'].search( [('partner_id', '=', self.partner.id)]) inv_draft = invoices.filtered(lambda x: x.state == 'draft') From fca51219649a5a6905fef9ca756c722615d85f30 Mon Sep 17 00:00:00 2001 From: Carlos Incaser Date: Tue, 14 Jun 2016 15:22:18 +0200 Subject: [PATCH 22/29] [IMP] contract_invoice_merge_by_partner: Field contract_invoice_merge in partner --- .../__openerp__.py | 3 ++ contract_invoice_merge_by_partner/i18n/es.po | 33 +++++++++++++++++++ .../models/__init__.py | 1 + .../models/account_analytic_analysis.py | 4 +-- .../models/res_partner.py | 11 +++++++ .../test_contract_invoice_merge_by_partner.py | 4 +-- .../views/res_partner_view.xml | 19 +++++++++++ 7 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 contract_invoice_merge_by_partner/i18n/es.po create mode 100644 contract_invoice_merge_by_partner/models/res_partner.py create mode 100644 contract_invoice_merge_by_partner/views/res_partner_view.xml diff --git a/contract_invoice_merge_by_partner/__openerp__.py b/contract_invoice_merge_by_partner/__openerp__.py index f6f67f5fa..7ac7a2cde 100644 --- a/contract_invoice_merge_by_partner/__openerp__.py +++ b/contract_invoice_merge_by_partner/__openerp__.py @@ -13,5 +13,8 @@ "Odoo Community Association (OCA)", 'website': 'http://www.tecnativa.com', 'depends': ['account_analytic_analysis', 'account_invoice_merge'], + 'data': [ + 'views/res_partner_view.xml', + ], 'installable': True, } diff --git a/contract_invoice_merge_by_partner/i18n/es.po b/contract_invoice_merge_by_partner/i18n/es.po new file mode 100644 index 000000000..b8c2a8906 --- /dev/null +++ b/contract_invoice_merge_by_partner/i18n/es.po @@ -0,0 +1,33 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_invoice_merge_by_partner +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-06-14 13:16+0000\n" +"PO-Revision-Date: 2016-06-14 15:19+0100\n" +"Last-Translator: Carlos Dauden \n" +"Language-Team: Tecnativa \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.5.4\n" +"Language: es_ES\n" +"X-Poedit-SourceCharset: UTF-8\n" + +#. module: contract_invoice_merge_by_partner +#: model:ir.model,name:contract_invoice_merge_by_partner.model_account_analytic_account +msgid "Analytic Account" +msgstr "Cuenta analítica" + +#. module: contract_invoice_merge_by_partner +#: field:res.partner,contract_invoice_merge:0 +msgid "Contract invoice merge" +msgstr "Fusionar facturas de contratos" + +#. module: contract_invoice_merge_by_partner +#: model:ir.model,name:contract_invoice_merge_by_partner.model_res_partner +msgid "Partner" +msgstr "Empresa" diff --git a/contract_invoice_merge_by_partner/models/__init__.py b/contract_invoice_merge_by_partner/models/__init__.py index fc5ce8e98..17b40b5bf 100644 --- a/contract_invoice_merge_by_partner/models/__init__.py +++ b/contract_invoice_merge_by_partner/models/__init__.py @@ -3,3 +3,4 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import account_analytic_analysis +from . import res_partner diff --git a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py index a695ab29d..eb3668310 100644 --- a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py +++ b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py @@ -18,13 +18,13 @@ class PurchaseOrderLine(models.Model): unlink_list = [] for partner in invoices.mapped('partner_id'): inv_to_merge = invoices.filtered(lambda x: x.partner_id == partner) - if len(inv_to_merge) > 1: + if partner.contract_invoice_merge and (len(inv_to_merge) > 1): invoices_info = inv_to_merge.do_merge() res.extend(invoices_info.keys()) for inv_ids_list in invoices_info.values(): unlink_list.extend(inv_ids_list) else: - res.append(inv_to_merge.id) + res.extend(inv_to_merge.ids) if unlink_list: invoice_obj.browse(unlink_list).unlink() return res diff --git a/contract_invoice_merge_by_partner/models/res_partner.py b/contract_invoice_merge_by_partner/models/res_partner.py new file mode 100644 index 000000000..34cc712e1 --- /dev/null +++ b/contract_invoice_merge_by_partner/models/res_partner.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# © 2016 Carlos Dauden +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import fields, models + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + contract_invoice_merge = fields.Boolean() diff --git a/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py b/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py index 84863d113..225a80418 100644 --- a/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py +++ b/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py @@ -9,10 +9,10 @@ class TestContractInvoiceMergeByPartner(TransactionCase): """ Use case : Prepare some data for current test case """ def setUp(self): super(TestContractInvoiceMergeByPartner, self).setUp() - #self.partner = self.env.ref('base.res_partner_2') self.partner = self.env['res.partner'].create( {'customer': True, - 'name': "Test Customer" + 'name': "Test Customer", + 'contract_invoice_merge': True, }) self.product = self.env.ref('product.product_product_consultant') self.uom = self.env.ref('product.product_uom_hour') diff --git a/contract_invoice_merge_by_partner/views/res_partner_view.xml b/contract_invoice_merge_by_partner/views/res_partner_view.xml new file mode 100644 index 000000000..bc0540db2 --- /dev/null +++ b/contract_invoice_merge_by_partner/views/res_partner_view.xml @@ -0,0 +1,19 @@ + + + + + + + Partner Form Contract Invoice Merge + res.partner + + + + + + + + + + From 7a3b4df8e1b11e50af80700eb506c749985095eb Mon Sep 17 00:00:00 2001 From: Carlos Incaser Date: Tue, 14 Jun 2016 16:22:28 +0200 Subject: [PATCH 23/29] [IMP] contract_invoice_merge_by_partner: Add account-invoicing to OCA dependences --- oca_dependencies.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/oca_dependencies.txt b/oca_dependencies.txt index 34f82ae94..a7ff11915 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -1 +1,2 @@ +account-invoicing bank-payment From c3bdff329bf4d1281c4eda4a198d83d685ff1f5e Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Wed, 29 Jun 2016 13:10:08 +0100 Subject: [PATCH 24/29] Improvements on the implementation --- .../models/account_analytic_analysis.py | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py index eb3668310..1fe7e1be3 100644 --- a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py +++ b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py @@ -12,19 +12,17 @@ class PurchaseOrderLine(models.Model): def _recurring_create_invoice(self, automatic=False): invoice_obj = self.env['account.invoice'] invoices = invoice_obj.browse( - super(PurchaseOrderLine, self)._recurring_create_invoice(automatic) - ) + super(PurchaseOrderLine, self)._recurring_create_invoice(automatic)) res = [] unlink_list = [] - for partner in invoices.mapped('partner_id'): + for partner in set(invoices.mapped('partner_id')): inv_to_merge = invoices.filtered(lambda x: x.partner_id == partner) - if partner.contract_invoice_merge and (len(inv_to_merge) > 1): - invoices_info = inv_to_merge.do_merge() - res.extend(invoices_info.keys()) - for inv_ids_list in invoices_info.values(): - unlink_list.extend(inv_ids_list) + if partner.contract_invoice_merge: + invoices_merged = inv_to_merge.do_merge() + res.extend(invoices_merged) + unlink_list.extend(inv_to_merge) else: - res.extend(inv_to_merge.ids) - if unlink_list: - invoice_obj.browse(unlink_list).unlink() + res.extend(inv_to_merge) + for inv in unlink_list: + inv.unlink() return res From 85942a1addaa5265305acb5149159d1b3878e5b2 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Thu, 30 Jun 2016 16:28:28 +0100 Subject: [PATCH 25/29] Fixed for loop and mass unlink --- .../models/account_analytic_analysis.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py index 1fe7e1be3..9ca946ea4 100644 --- a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py +++ b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py @@ -15,14 +15,15 @@ class PurchaseOrderLine(models.Model): super(PurchaseOrderLine, self)._recurring_create_invoice(automatic)) res = [] unlink_list = [] - for partner in set(invoices.mapped('partner_id')): - inv_to_merge = invoices.filtered(lambda x: x.partner_id == partner) + for partner in invoices.mapped('partner_id'): + inv_to_merge = invoices.filtered( + lambda x: x.partner_id.id == partner) if partner.contract_invoice_merge: invoices_merged = inv_to_merge.do_merge() res.extend(invoices_merged) unlink_list.extend(inv_to_merge) else: res.extend(inv_to_merge) - for inv in unlink_list: - inv.unlink() + if unlink_list: + invoice_obj.unlink([x.id for x in unlink_list]) return res From 26f984a7732491e87e4eb756caf0056a7ac71484 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Mon, 4 Jul 2016 11:53:11 +0100 Subject: [PATCH 26/29] Fix unlink, >1 filter and lines too long --- .../models/account_analytic_analysis.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py index 9ca946ea4..8d300c5b8 100644 --- a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py +++ b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py @@ -12,18 +12,19 @@ class PurchaseOrderLine(models.Model): def _recurring_create_invoice(self, automatic=False): invoice_obj = self.env['account.invoice'] invoices = invoice_obj.browse( - super(PurchaseOrderLine, self)._recurring_create_invoice(automatic)) + super(PurchaseOrderLine, self)._recurring_create_invoice( + automatic)) res = [] unlink_list = [] for partner in invoices.mapped('partner_id'): inv_to_merge = invoices.filtered( lambda x: x.partner_id.id == partner) - if partner.contract_invoice_merge: + if partner.contract_invoice_merge and len(inv_to_merge) > 1: invoices_merged = inv_to_merge.do_merge() res.extend(invoices_merged) unlink_list.extend(inv_to_merge) else: res.extend(inv_to_merge) if unlink_list: - invoice_obj.unlink([x.id for x in unlink_list]) + invoice_obj.browse(unlink_list).unlink() return res From b1d1b3200d15474662ca5353e882ca883465cd16 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Fri, 22 Jul 2016 01:37:24 +0200 Subject: [PATCH 27/29] [FIX] contract_invoice_merge_by_partner: Fix merge method --- contract_invoice_merge_by_partner/i18n/es.po | 26 ++++++++++------- .../models/account_analytic_analysis.py | 29 +++++++++---------- .../models/res_partner.py | 6 +++- .../test_contract_invoice_merge_by_partner.py | 10 +++---- 4 files changed, 39 insertions(+), 32 deletions(-) diff --git a/contract_invoice_merge_by_partner/i18n/es.po b/contract_invoice_merge_by_partner/i18n/es.po index b8c2a8906..0c2a8e7f5 100644 --- a/contract_invoice_merge_by_partner/i18n/es.po +++ b/contract_invoice_merge_by_partner/i18n/es.po @@ -1,33 +1,37 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * contract_invoice_merge_by_partner +# * contract_invoice_merge_by_partner # msgid "" msgstr "" "Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-06-14 13:16+0000\n" -"PO-Revision-Date: 2016-06-14 15:19+0100\n" -"Last-Translator: Carlos Dauden \n" -"Language-Team: Tecnativa \n" +"POT-Creation-Date: 2016-07-21 23:35+0000\n" +"PO-Revision-Date: 2016-07-21 23:35+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.4\n" -"Language: es_ES\n" -"X-Poedit-SourceCharset: UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" #. module: contract_invoice_merge_by_partner #: model:ir.model,name:contract_invoice_merge_by_partner.model_account_analytic_account msgid "Analytic Account" msgstr "Cuenta analítica" +#. module: contract_invoice_merge_by_partner +#: help:res.partner,contract_invoice_merge:0 +msgid "If checked, all the recurring invoices generated by the contracts of this partner will be merged on each run." +msgstr "Si está marcado, todas las facturas recurrentes generadas por los contratos de esta empresa serán fusionados en cada generación." + #. module: contract_invoice_merge_by_partner #: field:res.partner,contract_invoice_merge:0 -msgid "Contract invoice merge" -msgstr "Fusionar facturas de contratos" +msgid "Merge contracts invoices" +msgstr "Fusionar las facturas de los contratos" #. module: contract_invoice_merge_by_partner #: model:ir.model,name:contract_invoice_merge_by_partner.model_res_partner msgid "Partner" msgstr "Empresa" + diff --git a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py index 8d300c5b8..0fcb6dfb0 100644 --- a/contract_invoice_merge_by_partner/models/account_analytic_analysis.py +++ b/contract_invoice_merge_by_partner/models/account_analytic_analysis.py @@ -1,30 +1,29 @@ # -*- coding: utf-8 -*- # © 2016 Carlos Dauden +# © 2016 Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import api, models -class PurchaseOrderLine(models.Model): +class AccountAnalyticAccount(models.Model): _inherit = 'account.analytic.account' @api.multi def _recurring_create_invoice(self, automatic=False): - invoice_obj = self.env['account.invoice'] - invoices = invoice_obj.browse( - super(PurchaseOrderLine, self)._recurring_create_invoice( - automatic)) + invoice_ids = super( + AccountAnalyticAccount, self)._recurring_create_invoice(automatic) + invoices = self.env['account.invoice'].browse(invoice_ids) res = [] - unlink_list = [] + invoices2unlink = self.env['account.invoice'] for partner in invoices.mapped('partner_id'): - inv_to_merge = invoices.filtered( - lambda x: x.partner_id.id == partner) - if partner.contract_invoice_merge and len(inv_to_merge) > 1: - invoices_merged = inv_to_merge.do_merge() - res.extend(invoices_merged) - unlink_list.extend(inv_to_merge) + invoices2merge = invoices.filtered( + lambda x: x.partner_id == partner) + if partner.contract_invoice_merge and len(invoices2merge) > 1: + result = invoices2merge.do_merge() + res += result.keys() + invoices2unlink += invoices2merge else: - res.extend(inv_to_merge) - if unlink_list: - invoice_obj.browse(unlink_list).unlink() + res += invoices2merge.ids + invoices2unlink.unlink() return res diff --git a/contract_invoice_merge_by_partner/models/res_partner.py b/contract_invoice_merge_by_partner/models/res_partner.py index 34cc712e1..2f50523f2 100644 --- a/contract_invoice_merge_by_partner/models/res_partner.py +++ b/contract_invoice_merge_by_partner/models/res_partner.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # © 2016 Carlos Dauden +# © 2016 Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import fields, models @@ -8,4 +9,7 @@ from openerp import fields, models class ResPartner(models.Model): _inherit = 'res.partner' - contract_invoice_merge = fields.Boolean() + contract_invoice_merge = fields.Boolean( + string="Merge contracts invoices", + help="If checked, all the recurring invoices generated by the " + "contracts of this partner will be merged on each run.") diff --git a/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py b/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py index 225a80418..b45150d66 100644 --- a/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py +++ b/contract_invoice_merge_by_partner/tests/test_contract_invoice_merge_by_partner.py @@ -9,11 +9,11 @@ class TestContractInvoiceMergeByPartner(TransactionCase): """ Use case : Prepare some data for current test case """ def setUp(self): super(TestContractInvoiceMergeByPartner, self).setUp() - self.partner = self.env['res.partner'].create( - {'customer': True, - 'name': "Test Customer", - 'contract_invoice_merge': True, - }) + self.partner = self.env['res.partner'].create({ + 'customer': True, + 'name': "Test Customer", + 'contract_invoice_merge': True, + }) self.product = self.env.ref('product.product_product_consultant') self.uom = self.env.ref('product.product_uom_hour') self.contract1 = self.env['account.analytic.account'].create({ From 65ad90d40181bc7daeb211b32fb05e106db1aa6d Mon Sep 17 00:00:00 2001 From: Rafael Blasco Date: Sat, 30 Jul 2016 17:53:20 +0200 Subject: [PATCH 28/29] Add more detailed info in usage section Add more detailed info in usage section --- contract_invoice_merge_by_partner/README.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/contract_invoice_merge_by_partner/README.rst b/contract_invoice_merge_by_partner/README.rst index 62a31b8da..da47cae05 100644 --- a/contract_invoice_merge_by_partner/README.rst +++ b/contract_invoice_merge_by_partner/README.rst @@ -18,7 +18,12 @@ To install this module you need *account_invoice_merge*, available in: Usage ===== -#. Go to *Sales > Contracts* and create some contracts with same partner + + +#. Go to *Sales > Customer* choose a partner and in the tab "Sales & Purchases" + activate checkbox " Merge contracts invoices " +#. Go to *Sales > Contracts* and create some contracts with same partner you + activated checkbox " Merge contracts invoices " #. Go to *Settings > Automation > Scheduled Actions* #. Select *Generate Recurring Invoices from Contracts* #. Set previous time that now in *Next Execution Date* @@ -44,6 +49,7 @@ Contributors ------------ * Carlos Dauden * Pedro M. Baeza +* Rafael Blasco Maintainer ---------- From b2c18a324341b19d6a69a949e5a16ed5e00dc7fe Mon Sep 17 00:00:00 2001 From: Rafael Blasco Date: Sat, 30 Jul 2016 17:54:05 +0200 Subject: [PATCH 29/29] Update README.rst --- contract_invoice_merge_by_partner/README.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/contract_invoice_merge_by_partner/README.rst b/contract_invoice_merge_by_partner/README.rst index da47cae05..cc4465d2f 100644 --- a/contract_invoice_merge_by_partner/README.rst +++ b/contract_invoice_merge_by_partner/README.rst @@ -18,8 +18,6 @@ To install this module you need *account_invoice_merge*, available in: Usage ===== - - #. Go to *Sales > Customer* choose a partner and in the tab "Sales & Purchases" activate checkbox " Merge contracts invoices " #. Go to *Sales > Contracts* and create some contracts with same partner you