From f620c0114bb9f5d4cca171295627c4d293fd35d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Tue, 11 Oct 2016 08:39:29 +0200 Subject: [PATCH 1/2] [UPD] prefix versions with 8.0 --- project_billing_utils/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_billing_utils/__openerp__.py b/project_billing_utils/__openerp__.py index 259ea64..746c1c5 100644 --- a/project_billing_utils/__openerp__.py +++ b/project_billing_utils/__openerp__.py @@ -20,7 +20,7 @@ ############################################################################## { 'name': 'Analytic and project wizard for service companies', - 'version': '8.0.1.4', + 'version': '8.0.1.4.0', 'category': 'Generic Modules/Projects & Services', 'author': "Camptocamp,Odoo Community Association (OCA)", 'website': 'http://www.camptocamp.com', From a8fb44ab563cb261dcd2200c7715fd09394e7a03 Mon Sep 17 00:00:00 2001 From: Chandresh Thakkar Date: Sat, 23 Jun 2018 23:23:31 +0530 Subject: [PATCH 2/2] [MIG] Migrated project_billing_utils module for 9.0. --- oca_dependencies.txt | 1 + project_billing_utils/README.rst | 1 + project_billing_utils/__init__.py | 4 +--- project_billing_utils/__openerp__.py | 16 ++++++------- project_billing_utils/invoice_view.xml | 13 ---------- project_billing_utils/models/__init__.py | 6 +++++ .../{ => models}/analytic.py | 4 +++- project_billing_utils/{ => models}/invoice.py | 0 project_billing_utils/{ => models}/project.py | 1 - project_billing_utils/project_view.xml | 18 -------------- project_billing_utils/views/invoice_view.xml | 24 +++++++++++++++++++ project_billing_utils/views/project_view.xml | 18 ++++++++++++++ project_billing_utils/wizard/blank_invoice.py | 17 ++++--------- 13 files changed, 67 insertions(+), 56 deletions(-) delete mode 100644 project_billing_utils/invoice_view.xml create mode 100644 project_billing_utils/models/__init__.py rename project_billing_utils/{ => models}/analytic.py (94%) rename project_billing_utils/{ => models}/invoice.py (100%) rename project_billing_utils/{ => models}/project.py (97%) delete mode 100644 project_billing_utils/project_view.xml create mode 100644 project_billing_utils/views/invoice_view.xml create mode 100644 project_billing_utils/views/project_view.xml diff --git a/oca_dependencies.txt b/oca_dependencies.txt index 376cc3e..fdd4360 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -1,3 +1,4 @@ # list the OCA project dependencies, one per line # add a github url if you need a forked version project-service +reporting-engine diff --git a/project_billing_utils/README.rst b/project_billing_utils/README.rst index 6f4ff04..bbefaaf 100644 --- a/project_billing_utils/README.rst +++ b/project_billing_utils/README.rst @@ -42,6 +42,7 @@ Contributors * Alexandre Fayolle * Vincent Renaville * Damien Crier +* Serpent Consulting Services Pvt. Ltd. Maintainer ---------- diff --git a/project_billing_utils/__init__.py b/project_billing_utils/__init__.py index e3e11c8..8da5456 100644 --- a/project_billing_utils/__init__.py +++ b/project_billing_utils/__init__.py @@ -18,7 +18,5 @@ # along with this program. If not, see . # ############################################################################## -from . import project +from . import models from . import wizard -from . import invoice -from . import analytic diff --git a/project_billing_utils/__openerp__.py b/project_billing_utils/__openerp__.py index 746c1c5..713e1a5 100644 --- a/project_billing_utils/__openerp__.py +++ b/project_billing_utils/__openerp__.py @@ -20,22 +20,22 @@ ############################################################################## { 'name': 'Analytic and project wizard for service companies', - 'version': '8.0.1.4.0', + 'version': '9.0.1.0.0', 'category': 'Generic Modules/Projects & Services', - 'author': "Camptocamp,Odoo Community Association (OCA)", + 'author': 'Camptocamp,Odoo Community Association (OCA),' + 'Serpent Consulting Services Pvt. Ltd.', 'website': 'http://www.camptocamp.com', - 'depends': ['project', - 'hr_timesheet_invoice', - 'project_analytic_line_view'], + 'license': 'AGPL-3', + 'depends': ['project', 'hr_timesheet'], 'data': [ - 'invoice_view.xml', - 'project_view.xml', + 'views/invoice_view.xml', + 'views/project_view.xml', 'wizard/associate_aal_view.xml', 'wizard/dissociate_aal_view.xml', 'wizard/open_invoices_view.xml', 'wizard/blank_invoice_view.xml', ], - 'installable': False, + 'installable': True, 'auto_install': False, 'application': False, } diff --git a/project_billing_utils/invoice_view.xml b/project_billing_utils/invoice_view.xml deleted file mode 100644 index d898630..0000000 --- a/project_billing_utils/invoice_view.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - diff --git a/project_billing_utils/models/__init__.py b/project_billing_utils/models/__init__.py new file mode 100644 index 0000000..ca0c139 --- /dev/null +++ b/project_billing_utils/models/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import analytic +from . import invoice +from . import project diff --git a/project_billing_utils/analytic.py b/project_billing_utils/models/analytic.py similarity index 94% rename from project_billing_utils/analytic.py rename to project_billing_utils/models/analytic.py index 191ba8b..a7e6230 100644 --- a/project_billing_utils/analytic.py +++ b/project_billing_utils/models/analytic.py @@ -20,7 +20,7 @@ ############################################################################## """Changes to allow the dissociate analytic lines wizard to work.""" -from openerp import models, api +from openerp import models, api, fields class AccountAnalyticLine(models.Model): @@ -29,6 +29,8 @@ class AccountAnalyticLine(models.Model): _inherit = 'account.analytic.line' + invoice_id = fields.Many2one("account.invoice", "Invoice") + @api.multi def write(self, vals): """Put a key in the vals, since we have no context. Return super.""" diff --git a/project_billing_utils/invoice.py b/project_billing_utils/models/invoice.py similarity index 100% rename from project_billing_utils/invoice.py rename to project_billing_utils/models/invoice.py diff --git a/project_billing_utils/project.py b/project_billing_utils/models/project.py similarity index 97% rename from project_billing_utils/project.py rename to project_billing_utils/models/project.py index 06ab69d..bcd7804 100644 --- a/project_billing_utils/project.py +++ b/project_billing_utils/models/project.py @@ -36,7 +36,6 @@ def unlink(self): # If we found line linked with account we raise an error if account_lines: raise exceptions.Warning( - _('Invalid Action'), _('You cannot delete account %s as there are analytic ' 'lines linked to it') % project.name) else: diff --git a/project_billing_utils/project_view.xml b/project_billing_utils/project_view.xml deleted file mode 100644 index 02518f5..0000000 --- a/project_billing_utils/project_view.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - project.project.form - project.project - - - - 1 - - - - - - diff --git a/project_billing_utils/views/invoice_view.xml b/project_billing_utils/views/invoice_view.xml new file mode 100644 index 0000000..82008d5 --- /dev/null +++ b/project_billing_utils/views/invoice_view.xml @@ -0,0 +1,24 @@ + + + + + + + + account.analytic.line.form.project.invoice + account.analytic.line + + + + + + + + + + diff --git a/project_billing_utils/views/project_view.xml b/project_billing_utils/views/project_view.xml new file mode 100644 index 0000000..fb58fae --- /dev/null +++ b/project_billing_utils/views/project_view.xml @@ -0,0 +1,18 @@ + + + + + + + project.project.form + project.project + + + + 1 + + + + + + diff --git a/project_billing_utils/wizard/blank_invoice.py b/project_billing_utils/wizard/blank_invoice.py index dfe3a07..ad10261 100644 --- a/project_billing_utils/wizard/blank_invoice.py +++ b/project_billing_utils/wizard/blank_invoice.py @@ -38,20 +38,13 @@ def _prepare_invoice(self, project): """ if not project.partner_id: raise exceptions.Warning( - _('UserError'), _('The Partner is missing on the project:\n%s') % project.name) - if not project.pricelist_id: - raise exceptions.Warning( - _('UserError'), - _('The Customer Pricelist is ' - 'missing on the project:\n%s') % project.name) - partner = project.partner_id date_due = False - if partner.property_payment_term: - pterm_list = partner.property_payment_term.compute( + if partner.property_payment_term_id: + pterm_list = partner.property_payment_term_id.compute( value=1, date_ref=fields.Date.today()) if pterm_list: @@ -64,9 +57,9 @@ def _prepare_invoice(self, project): 'type': 'out_invoice', 'date_due': date_due, 'partner_id': partner.id, - 'payment_term': partner.property_payment_term.id or False, - 'account_id': partner.property_account_receivable.id, - 'currency_id': project.pricelist_id.currency_id.id, + 'payment_term': partner.property_payment_term_id.id or False, + 'account_id': partner.property_account_receivable_id.id, + 'currency_id': project.currency_id.id, } @api.multi