diff --git a/contract_discount/README.rst b/contract_discount/README.rst deleted file mode 100644 index 0d868aba..00000000 --- a/contract_discount/README.rst +++ /dev/null @@ -1,60 +0,0 @@ -.. 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 Discount -================= - -This module was written to extend the functionality of contracts to support to -set a discount on contract invoice lines. - -Configuration -============= - -To configure this module, you need to go to settings -> Configuration -> -Sales and activate "Allow setting a discount on the sales order lines" to see -discount in contracts. - -Usage -===== - -.. 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 - -For further information, please visit: - -* https://www.odoo.com/forum/help-1 - -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 ------------- - -* Ángel Moya - - -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_discount/__init__.py b/contract_discount/__init__.py deleted file mode 100644 index c98792e9..00000000 --- a/contract_discount/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- -from . import models -from . import tests diff --git a/contract_discount/__openerp__.py b/contract_discount/__openerp__.py deleted file mode 100644 index 24ac160d..00000000 --- a/contract_discount/__openerp__.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- - -############################################################################### -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2015 Domatix (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################### - -{ - 'name': 'Contract Discount', - 'summary': 'Discounts for contracts and their invoices', - 'version': '8.0.1.0.0', - 'author': 'Domatix, Odoo Community Association (OCA)', - 'website': 'http://www.domatix.com', - 'depends': ['account_analytic_analysis'], - 'category': 'Sales Management', - 'license': 'AGPL-3', - 'data': [ - 'views/contract_view.xml', - ], - 'test': ['test/contract_discount.yml'], - 'installable': False, - 'auto_install': False, -} diff --git a/contract_discount/i18n/contract_discount.pot b/contract_discount/i18n/contract_discount.pot deleted file mode 100644 index 566b127d..00000000 --- a/contract_discount/i18n/contract_discount.pot +++ /dev/null @@ -1,38 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * contract_discount -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-16 15:14+0000\n" -"PO-Revision-Date: 2015-09-16 15:14+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_discount -#: model:ir.model,name:contract_discount.model_account_analytic_account -msgid "Analytic Account" -msgstr "" - -#. module: contract_discount -#: field:account.analytic.invoice.line,discount:0 -msgid "Discount (%)" -msgstr "" - -#. module: contract_discount -#: code:addons/contract_discount/models/contract.py:40 -#, 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_discount/i18n/en.po b/contract_discount/i18n/en.po deleted file mode 100644 index a740d7d1..00000000 --- a/contract_discount/i18n/en.po +++ /dev/null @@ -1,41 +0,0 @@ -# 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: 2015-09-18 10:33+0000\n" -"PO-Revision-Date: 2015-09-18 10:33+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" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: en\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 "Analytic Account" - -#. module: contract_discount -#: field:account.analytic.invoice.line,discount:0 -msgid "Discount (%)" -msgstr "Discount (%)" - -#. module: contract_discount -#: code:addons/contract_discount/models/contract.py:41 -#, python-format -msgid "Discount should be less or equal to 100" -msgstr "Discount should be less or equal to 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 "Discount that is applied in generated invoices. It should be less or equal to 100" diff --git a/contract_discount/i18n/es.po b/contract_discount/i18n/es.po deleted file mode 100644 index 66906fb9..00000000 --- a/contract_discount/i18n/es.po +++ /dev/null @@ -1,41 +0,0 @@ -# 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: 2015-09-18 10:33+0000\n" -"PO-Revision-Date: 2015-09-18 10:34+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: \n" -"Language: es\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 "Cuenta analítica" - -#. module: contract_discount -#: field:account.analytic.invoice.line,discount:0 -msgid "Discount (%)" -msgstr "Descuento (%)" - -#. module: contract_discount -#: code:addons/contract_discount/models/contract.py:41 -#, python-format -msgid "Discount should be less or equal to 100" -msgstr "El descuento debe ser menor o igual que 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 "El descuento se aplica en las facturas generadas. Debe ser menor o igual que 100" diff --git a/contract_discount/i18n/pt_BR.po b/contract_discount/i18n/pt_BR.po deleted file mode 100644 index 21a0e5dc..00000000 --- a/contract_discount/i18n/pt_BR.po +++ /dev/null @@ -1,42 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * contract_discount -# -# Translators: -# Armando Vulcano Junior , 2015 -msgid "" -msgstr "" -"Project-Id-Version: contract (8.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-18 10:33+0000\n" -"PO-Revision-Date: 2015-09-18 20:02+0000\n" -"Last-Translator: Armando Vulcano Junior \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_discount -#: model:ir.model,name:contract_discount.model_account_analytic_account -msgid "Analytic Account" -msgstr "Conta Analítica" - -#. module: contract_discount -#: field:account.analytic.invoice.line,discount:0 -msgid "Discount (%)" -msgstr "Desconto (%)" - -#. module: contract_discount -#: code:addons/contract_discount/models/contract.py:41 -#, python-format -msgid "Discount should be less or equal to 100" -msgstr "Desconto deve ser inferior ou igual a 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 "Desconto que é aplicado em faturas geradas. Ele deve ser inferior ou igual a 100" diff --git a/contract_discount/i18n/sl.po b/contract_discount/i18n/sl.po deleted file mode 100644 index e47fb967..00000000 --- a/contract_discount/i18n/sl.po +++ /dev/null @@ -1,42 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * contract_discount -# -# Translators: -# Matjaž Mozetič , 2015 -msgid "" -msgstr "" -"Project-Id-Version: contract (8.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-23 16:26+0000\n" -"PO-Revision-Date: 2015-09-26 07:11+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_discount -#: model:ir.model,name:contract_discount.model_account_analytic_account -msgid "Analytic Account" -msgstr "Analitični konto" - -#. module: contract_discount -#: field:account.analytic.invoice.line,discount:0 -msgid "Discount (%)" -msgstr "Popust (%)" - -#. module: contract_discount -#: code:addons/contract_discount/models/contract.py:41 -#, python-format -msgid "Discount should be less or equal to 100" -msgstr "Popust mora biti enak ali manjši od 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 "Popust, ki se aplicira na ustvarjene račune. Biti mora enak ali manjši od 100" diff --git a/contract_discount/models/__init__.py b/contract_discount/models/__init__.py deleted file mode 100644 index b82ea877..00000000 --- a/contract_discount/models/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# -*- coding: utf-8 -*- -from . import contract diff --git a/contract_discount/models/contract.py b/contract_discount/models/contract.py deleted file mode 100644 index ef5fd665..00000000 --- a/contract_discount/models/contract.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- coding: utf-8 -*- -from openerp import models, fields, api -from openerp.addons.decimal_precision import decimal_precision as dp -from openerp.exceptions import ValidationError - -from openerp.tools.translate import _ - -from openerp.osv import fields as old_fields - - -class AccountAnalyticInvoiceLine(models.Model): - _inherit = "account.analytic.invoice.line" - - def _amount_line(self, cr, uid, ids, prop, unknow_none, unknow_dict, - context=None): - res = super(AccountAnalyticInvoiceLine, self)._amount_line( - cr, uid, ids, prop, unknow_none, unknow_dict, context=context) - for line in self.browse(cr, uid, ids, context=context): - discount = (line.discount or 0) / 100 - res[line.id] = res[line.id] * (1 - discount) - return res - - discount = fields.Float( - string='Discount (%)', - digits=dp.get_precision('Discount'), - copy=True, - help='Discount that is applied in generated invoices.' - ' It should be less or equal to 100') - - _columns = { - 'price_subtotal': old_fields.function( - _amount_line, string='Sub Total', - type="float", - digits_compute=dp.get_precision('Account')), - } - - @api.one - @api.constrains('discount') - def _check_discount(self): - if self.discount > 100: - raise ValidationError(_("Discount should be less or equal to 100")) - - -class AccountAnalyticAccount(models.Model): - _inherit = 'account.analytic.account' - - @api.model - def _prepare_invoice_line(self, line, fiscal_position): - res = super(AccountAnalyticAccount, self)._prepare_invoice_line( - line, fiscal_position) - res['discount'] = line.discount or 0 - return res diff --git a/contract_discount/test/contract_discount.yml b/contract_discount/test/contract_discount.yml deleted file mode 100644 index 3cefb475..00000000 --- a/contract_discount/test/contract_discount.yml +++ /dev/null @@ -1,49 +0,0 @@ -- - In order to test Contract Recurrent Invoice I create a new Contract with 25% discount -- - !record {model: account.analytic.account, id: contract_main_25}: - 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 - discount: 25.0 - name: Database Administration 25 - product_id: product.product_product_consultant - uom_id: product.product_uom_hour - - quantity: 2.0 - price_unit: 100.0 - discount: 50.0 - name: Database Administration 50 - product_id: product.product_product_consultant - uom_id: product.product_uom_hour -- - I test the contract -- - !python {model: account.analytic.account}: | - aid = ref('contract_discount.contract_main_25') - contract = self.browse(cr, uid, aid,context=context) - assert contract.recurring_invoice_line_ids[0].discount == 25, "The line discount (%s)is different than 25!"%(contract.recurring_invoice_line_ids[0].discount,) - assert contract.recurring_invoice_line_ids[0].price_subtotal == 150.0, "The price subtotal (%s)is different than 150!"%(contract.recurring_invoice_line_ids[0].price_subtotal,) - assert contract.recurring_invoice_line_ids[1].discount == 50, "The line discount (%s)is different than 50!"%(contract.recurring_invoice_line_ids[1].discount,) - assert contract.recurring_invoice_line_ids[1].price_subtotal == 100, "The price subtotal (%s)is different than 100!"%(contract.recurring_invoice_line_ids[1].price_subtotal,) -- - I generate all invoices from contracts having recurring invoicing -- - !python {model: account.analytic.account}: | - self.recurring_create_invoice(cr, uid, []) -- - I test the generated invoice -- - !python {model: account.invoice}: | - aid = ref('contract_discount.contract_main_25') - ids = self.search(cr, uid, [('invoice_line.account_analytic_id','=',aid)], context=context) - assert len(ids)>=1, 'No invoice created for the contract' - for invoice in self.browse(cr, uid, ids,context=context): - assert invoice.invoice_line[0].discount == 25, "The invoice discount (%s)is different than 25!"%(invoice.invoice_line[0].discount,) - assert invoice.invoice_line[1].discount == 50, "The invoice discount (%s)is different than 50!"%(invoice.invoice_line[1].discount,) - assert invoice.amount_untaxed == 250.0, "The invoice total (%s)is different than 250!"%(invoice.amount_untaxed,) diff --git a/contract_discount/tests/__init__.py b/contract_discount/tests/__init__.py deleted file mode 100644 index db9cc41a..00000000 --- a/contract_discount/tests/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- - -from . import test_contract_discount diff --git a/contract_discount/tests/test_contract_discount.py b/contract_discount/tests/test_contract_discount.py deleted file mode 100644 index 155d5c04..00000000 --- a/contract_discount/tests/test_contract_discount.py +++ /dev/null @@ -1,59 +0,0 @@ -# -*- coding: utf-8 -*- - -import openerp.tests.common as common -from openerp.exceptions import ValidationError - - -def create_simple_contract(self, discount=0): - - partner_id = self.ref('base.res_partner_2') - product_id = self.ref('product.product_product_consultant') - uom_id = self.ref('product.product_uom_hour') - - line_values = [(0, 0, {'quantity': 2.0, - 'price_unit': 100.0, - 'discount': discount, - 'name': 'Database Administration 25', - 'product_id': product_id, - 'uom_id': uom_id, - })] - values = { - 'name': 'Maintenance of Servers', - 'partner_id': partner_id, - 'type': 'contract', - 'recurring_invoices': 1, - 'recurring_interval': 1, - 'recurring_invoice_line_ids': line_values, - } - - return self.env['account.analytic.account']\ - .create(values) - - -class TestContractDiscount(common.TransactionCase): - - def setUp(self): - super(TestContractDiscount, self).setUp() - - def test_create_simple_contract_without_discount(self): - """Create contract without discount""" - create_simple_contract(self) - - def test_create_simple_contract_with_discount(self): - """Create contract with discount""" - create_simple_contract(self, 50) - create_simple_contract(self, 100) - - def test_create_simple_contract_with_negative_discount(self): - """Create contract with negative discount""" - create_simple_contract(self, -10) - - def test_discount_greater_than_100_error(self): - """Create or write contract with greater than 100 discount""" - contract = create_simple_contract(self) - lines = contract.recurring_invoice_line_ids - with self.assertRaises(ValidationError): - lines.write({'discount': 110}) - - with self.assertRaises(ValidationError): - create_simple_contract(self, 150) diff --git a/contract_discount/views/contract_view.xml b/contract_discount/views/contract_view.xml deleted file mode 100644 index aeb781ca..00000000 --- a/contract_discount/views/contract_view.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - account.analytic.account.invoice.form.extension.form - - account.analytic.account - - - - - - - - - - \ No newline at end of file diff --git a/contract_journal/README.rst b/contract_journal/README.rst deleted file mode 100644 index 9ab4ce91..00000000 --- a/contract_journal/README.rst +++ /dev/null @@ -1,52 +0,0 @@ -.. 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 Journal -======================== - -This module allows to set a sales account journal for creating the invoices on it. - -Usage -===== - -.. 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 - -For further information, please visit: - -* https://www.odoo.com/forum/help-1 - -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 ------------- - -* Ángel Moya - - -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_journal/__init__.py b/contract_journal/__init__.py deleted file mode 100644 index a0fdc10f..00000000 --- a/contract_journal/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# -*- coding: utf-8 -*- -from . import models diff --git a/contract_journal/__openerp__.py b/contract_journal/__openerp__.py deleted file mode 100644 index fba51ae9..00000000 --- a/contract_journal/__openerp__.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8 -*- - -############################################################################### -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2015 Domatix (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################### - -{ - 'name': 'Contract Invoice Journal', - 'summary': 'Invoice Journal in contracts and their invoices', - 'version': '8.0.1.0.0', - 'author': 'Domatix, Odoo Community Association (OCA)', - 'website': 'http://www.domatix.com', - 'depends': ['account_analytic_analysis'], - 'category': 'Sales Management', - 'license': 'AGPL-3', - 'data': [ - 'views/contract_view.xml', - ], - 'test': ['test/contract_journal.yml'], - 'installable': False, - 'auto_install': False, -} diff --git a/contract_journal/i18n/es.po b/contract_journal/i18n/es.po deleted file mode 100644 index 6cc3ec5c..00000000 --- a/contract_journal/i18n/es.po +++ /dev/null @@ -1,28 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * contract_journal -# angel , 2015. -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-06-12 12:20+0000\n" -"PO-Revision-Date: 2015-06-22 11:43+0100\n" -"Last-Translator: angel \n" -"Language-Team: Domatix\n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 1.5.4\n" - -#. module: contract_journal -#: model:ir.model,name:contract_journal.model_account_analytic_account -msgid "Analytic Account" -msgstr "Cuenta analítica" - -#. module: contract_journal -#: field:account.analytic.account,journal_id:0 -msgid "Journal" -msgstr "Diario" diff --git a/contract_journal/models/__init__.py b/contract_journal/models/__init__.py deleted file mode 100644 index b82ea877..00000000 --- a/contract_journal/models/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# -*- coding: utf-8 -*- -from . import contract diff --git a/contract_journal/models/contract.py b/contract_journal/models/contract.py deleted file mode 100644 index c272e143..00000000 --- a/contract_journal/models/contract.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -from openerp import models, fields, api - - -class AccountAnalyticAccount(models.Model): - _inherit = 'account.analytic.account' - - @api.model - def _default_journal(self): - company_id = self.env.context.get( - 'company_id', self.env.user.company_id.id) - domain = [ - ('type', '=', 'sale'), - ('company_id', '=', company_id)] - return self.env['account.journal'].search(domain, limit=1) - - journal_id = fields.Many2one( - 'account.journal', - string='Journal', - default=_default_journal, - domain="[('type', '=', 'sale'),('company_id', '=', company_id)]") - - @api.model - def _prepare_invoice_data(self, contract): - invoice_vals = super(AccountAnalyticAccount, self).\ - _prepare_invoice_data( - contract) - if contract.journal_id: - invoice_vals['journal_id'] = contract.journal_id.id - return invoice_vals diff --git a/contract_journal/test/contract_journal.yml b/contract_journal/test/contract_journal.yml deleted file mode 100644 index da616482..00000000 --- a/contract_journal/test/contract_journal.yml +++ /dev/null @@ -1,84 +0,0 @@ -- - In order to test contract invoice journal create a contract with sale invoice journal -- - !record {model: account.analytic.account, id: contract_sale_journal}: - name: Maintenance of Servers - company_id: base.main_company - partner_id: base.main_partner - journal_id: account.sales_journal - 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 create a new custom journal -- - !record {model: account.journal, id: custom_journal}: - name: Custom Sales Journal - code: CSAJ - type: sale - sequence_id: account.sequence_sale_journal - default_credit_account_id: account.a_sale - default_debit_account_id: account.a_sale - analytic_journal_id: account.analytic_journal_sale - user_id: base.user_root -- - Create a contract with custom invoice journal -- - !record {model: account.analytic.account, id: contract_custom_journal}: - name: Maintenance of Servers - company_id: base.main_company - partner_id: base.main_partner - journal_id: contract_journal.custom_journal - 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 sale contract -- - !python {model: account.analytic.account}: | - aid = ref('contract_journal.contract_sale_journal') - contract = self.browse(cr, uid, aid,context=context) - assert contract.journal_id.id == ref('account.sales_journal'), "Sale Invoice Journal is not correct in contract" -- - I test the custom contract -- - !python {model: account.analytic.account}: | - aid = ref('contract_journal.contract_custom_journal') - contract = self.browse(cr, uid, aid,context=context) - assert contract.journal_id.id == ref('contract_journal.custom_journal'), "Custom Invoice Journal is not correct in contract" -- - I generate all invoices from contracts having recurring invoicing -- - !python {model: account.analytic.account}: | - self.recurring_create_invoice(cr, uid, []) -- - I test the generated invoice for sale journal contract -- - !python {model: account.invoice}: | - aid = ref('contract_journal.contract_sale_journal') - ids = self.search(cr, uid, [('invoice_line.account_analytic_id','=',aid)], context=context) - assert len(ids)>=1, 'No invoice created for the sale journal contract' - for invoice in self.browse(cr, uid, ids,context=context): - assert invoice.journal_id.id == ref('account.sales_journal'), "Sale Invoice Journal is not correct in invoice" -- - I test the generated invoice for custom journal contract -- - !python {model: account.invoice}: | - aid = ref('contract_journal.contract_custom_journal') - ids = self.search(cr, uid, [('invoice_line.account_analytic_id','=',aid)], context=context) - assert len(ids)>=1, 'No invoice created for the custom journal contract' - for invoice in self.browse(cr, uid, ids,context=context): - assert invoice.journal_id.id == ref('contract_journal.custom_journal'), "Custom Invoice Journal is not correct in invoice" - \ No newline at end of file diff --git a/contract_journal/views/contract_view.xml b/contract_journal/views/contract_view.xml deleted file mode 100644 index ae46720d..00000000 --- a/contract_journal/views/contract_view.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - account.analytic.account.journal.form - account.analytic.account - - - - - - - - - - - account.analytic.account.journal.list - account.analytic.account - - - - - - - - - - - account.analytic.account.journal.search - account.analytic.account - - - - - - - - - - \ No newline at end of file diff --git a/contract_show_recurring_invoice/README.rst b/contract_show_recurring_invoice/README.rst deleted file mode 100644 index e6affc1a..00000000 --- a/contract_show_recurring_invoice/README.rst +++ /dev/null @@ -1,57 +0,0 @@ -.. 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 Show Recurring Invoice -=============================== - -This module adds a button in contracts to show their recurring invoices. - -Usage -===== - -.. 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 - -For further information, please visit: - -* https://www.odoo.com/forum/help-1 - -Known issues / Roadmap -====================== - -* Add smart button with field that computes the total amount invoiced. - -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 ------------- - -* Ángel Moya - - -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_show_recurring_invoice/__init__.py b/contract_show_recurring_invoice/__init__.py deleted file mode 100644 index 14afd7b4..00000000 --- a/contract_show_recurring_invoice/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# -*- coding: utf-8 -*- -from . import models - - -def copy_recurring_invoice(cr, registry): - """Copy recurring invoice on contract.""" - cr.execute("UPDATE account_invoice " - "SET contract_id=aaa.id " - "FROM account_analytic_account aaa " - "WHERE aaa.code = account_invoice.origin") diff --git a/contract_show_recurring_invoice/__openerp__.py b/contract_show_recurring_invoice/__openerp__.py deleted file mode 100644 index d887d25b..00000000 --- a/contract_show_recurring_invoice/__openerp__.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- - -############################################################################### -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2015 Domatix (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################### -{ - 'name': 'Contract Show Recurring Invoice', - 'summary': 'Button in contracts to show their recurring invoices', - 'version': '8.0.1.0.0', - 'author': 'Domatix, Odoo Community Association (OCA)', - 'website': 'http://www.domatix.com', - 'depends': ['account_analytic_analysis'], - 'category': 'Sales Management', - 'license': 'AGPL-3', - 'data': [ - 'views/contract_view.xml', - ], - 'test': [ - 'test/contract_show_recurring_invoice_test.yml' - ], - "post_init_hook": "copy_recurring_invoice", - 'installable': False, - 'auto_install': False, -} diff --git a/contract_show_recurring_invoice/i18n/contract_show_recurring_invoice.pot b/contract_show_recurring_invoice/i18n/contract_show_recurring_invoice.pot deleted file mode 100644 index 51b30bc2..00000000 --- a/contract_show_recurring_invoice/i18n/contract_show_recurring_invoice.pot +++ /dev/null @@ -1,37 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * contract_show_recurring_invoice -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-10-10 16:58+0000\n" -"PO-Revision-Date: 2015-10-10 16:58+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_show_recurring_invoice -#: model:ir.model,name:contract_show_recurring_invoice.model_account_analytic_account -msgid "Analytic Account" -msgstr "" - -#. module: contract_show_recurring_invoice -#: model:ir.model,name:contract_show_recurring_invoice.model_account_invoice -msgid "Invoice" -msgstr "" - -#. module: contract_show_recurring_invoice -#: model:ir.actions.act_window,name:contract_show_recurring_invoice.act_recurring_invoices -msgid "Invoices" -msgstr "" - -#. module: contract_show_recurring_invoice -#: view:account.analytic.account:contract_show_recurring_invoice.account_analytic_account_button_recurring_invoice -msgid "⇒ show invoices" -msgstr "" - diff --git a/contract_show_recurring_invoice/i18n/es.po b/contract_show_recurring_invoice/i18n/es.po deleted file mode 100644 index 4e161a7a..00000000 --- a/contract_show_recurring_invoice/i18n/es.po +++ /dev/null @@ -1,37 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * contract_show_recurring_invoice -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-10-10 16:58+0000\n" -"PO-Revision-Date: 2015-10-10 19:01+0100\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" -"Plural-Forms: \n" -"X-Generator: Poedit 1.7.5\n" - -#. module: contract_show_recurring_invoice -#: model:ir.model,name:contract_show_recurring_invoice.model_account_analytic_account -msgid "Analytic Account" -msgstr "Cuenta analítica" - -#. module: contract_show_recurring_invoice -#: model:ir.model,name:contract_show_recurring_invoice.model_account_invoice -msgid "Invoice" -msgstr "Factura" - -#. module: contract_show_recurring_invoice -#: model:ir.actions.act_window,name:contract_show_recurring_invoice.act_recurring_invoices -msgid "Invoices" -msgstr "Facturas" - -#. module: contract_show_recurring_invoice -#: view:account.analytic.account:contract_show_recurring_invoice.account_analytic_account_button_recurring_invoice -msgid "⇒ show invoices" -msgstr "⇒ ver facturas" diff --git a/contract_show_recurring_invoice/models/__init__.py b/contract_show_recurring_invoice/models/__init__.py deleted file mode 100644 index 27ee6307..00000000 --- a/contract_show_recurring_invoice/models/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# -*- coding: utf-8 -*- -from . import contract -from . import invoice diff --git a/contract_show_recurring_invoice/models/contract.py b/contract_show_recurring_invoice/models/contract.py deleted file mode 100644 index 07bb0655..00000000 --- a/contract_show_recurring_invoice/models/contract.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from openerp import models, api - - -class AccountAnalyticAccount(models.Model): - _inherit = 'account.analytic.account' - - @api.model - def _prepare_invoice_data(self, contract): - invoice_vals = super(AccountAnalyticAccount, self).\ - _prepare_invoice_data( - contract) - invoice_vals['contract_id'] = contract.id - return invoice_vals diff --git a/contract_show_recurring_invoice/models/invoice.py b/contract_show_recurring_invoice/models/invoice.py deleted file mode 100644 index 531e3a78..00000000 --- a/contract_show_recurring_invoice/models/invoice.py +++ /dev/null @@ -1,11 +0,0 @@ -# -*- coding: utf-8 -*- - -from openerp import models, fields - - -class AccountInvoice(models.Model): - _inherit = 'account.invoice' - - contract_id = fields.Many2one( - 'account.analytic.account', - string='Contract') diff --git a/contract_show_recurring_invoice/test/contract_show_recurring_invoice_test.yml b/contract_show_recurring_invoice/test/contract_show_recurring_invoice_test.yml deleted file mode 100644 index ba040092..00000000 --- a/contract_show_recurring_invoice/test/contract_show_recurring_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_recurring_invoice.contract_main') - invoices = self.search(cr, uid,[('contract_id','=',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_recurring_invoice.contract_main') - invoices = self.search(cr, uid,[('contract_id','=',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_recurring_invoice/views/contract_view.xml b/contract_show_recurring_invoice/views/contract_view.xml deleted file mode 100644 index 6dd986c3..00000000 --- a/contract_show_recurring_invoice/views/contract_view.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - {'search_default_contract_id': - [active_id], - 'default_contract_id': active_id} - - Invoices - account.invoice - - - - - - account.analytic.account.button.invoice - - account.analytic.account - - - - - - - - \ No newline at end of file