diff --git a/oca_dependencies.txt b/oca_dependencies.txt index 3c22dc8..2947015 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 +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/__manifest__.py b/project_billing_utils/__manifest__.py index 259ea64..289e7bc 100644 --- a/project_billing_utils/__manifest__.py +++ b/project_billing_utils/__manifest__.py @@ -20,22 +20,23 @@ ############################################################################## { 'name': 'Analytic and project wizard for service companies', - 'version': '8.0.1.4', + 'version': '10.0.1.0.0', 'category': 'Generic Modules/Projects & Services', - 'author': "Camptocamp,Odoo Community Association (OCA)", - 'website': 'http://www.camptocamp.com', + 'author': "Camptocamp,Odoo Community Association (OCA)," + "Serpent Consulting Services Pvt. Ltd.", + 'license': 'AGPL-3', + 'website': 'https://www.camptocamp.com', 'depends': ['project', - 'hr_timesheet_invoice', - 'project_analytic_line_view'], + '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..82797eb 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 odoo 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 98% rename from project_billing_utils/invoice.py rename to project_billing_utils/models/invoice.py index 2cdf022..6b71968 100644 --- a/project_billing_utils/invoice.py +++ b/project_billing_utils/models/invoice.py @@ -18,7 +18,7 @@ # along with this program. If not, see . # ############################################################################## -from openerp import models, api +from odoo import models, api class AccountInvoice(models.Model): diff --git a/project_billing_utils/project.py b/project_billing_utils/models/project.py similarity index 94% rename from project_billing_utils/project.py rename to project_billing_utils/models/project.py index 06ab69d..56101aa 100644 --- a/project_billing_utils/project.py +++ b/project_billing_utils/models/project.py @@ -18,8 +18,8 @@ # along with this program. If not, see . # ############################################################################## -from openerp import models, api, _ -from openerp import exceptions +from odoo import models, api, _ +from odoo import exceptions class ProjectProject(models.Model): @@ -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..e42b0b2 --- /dev/null +++ b/project_billing_utils/views/invoice_view.xml @@ -0,0 +1,22 @@ + + + + + + + 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..f915a7b --- /dev/null +++ b/project_billing_utils/views/project_view.xml @@ -0,0 +1,16 @@ + + + + + + project.project.form + project.project + + + + 1 + + + + + diff --git a/project_billing_utils/wizard/associate_aal.py b/project_billing_utils/wizard/associate_aal.py index efe9611..d847294 100644 --- a/project_billing_utils/wizard/associate_aal.py +++ b/project_billing_utils/wizard/associate_aal.py @@ -18,7 +18,7 @@ # along with this program. If not, see . # ############################################################################## -from openerp import models, api, fields, _ +from odoo import models, api, fields, _ class AssociateInvoice(models.TransientModel): diff --git a/project_billing_utils/wizard/associate_aal_view.xml b/project_billing_utils/wizard/associate_aal_view.xml index 697cc53..b1a0012 100644 --- a/project_billing_utils/wizard/associate_aal_view.xml +++ b/project_billing_utils/wizard/associate_aal_view.xml @@ -1,19 +1,18 @@ - - + Associate To Invoice associate.aal.to.invoice -
- + +
-
@@ -29,5 +28,4 @@ target="new" id="action_associate_invoice"/> -
-
+ diff --git a/project_billing_utils/wizard/blank_invoice.py b/project_billing_utils/wizard/blank_invoice.py index dfe3a07..ce8c5b1 100644 --- a/project_billing_utils/wizard/blank_invoice.py +++ b/project_billing_utils/wizard/blank_invoice.py @@ -18,9 +18,9 @@ # along with this program. If not, see . # ############################################################################## -from openerp import models, api, fields, _ -from openerp.tools.safe_eval import safe_eval -from openerp import exceptions +from odoo import models, api, fields, _ +from odoo.tools.safe_eval import safe_eval +from odoo import exceptions import time @@ -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 diff --git a/project_billing_utils/wizard/blank_invoice_view.xml b/project_billing_utils/wizard/blank_invoice_view.xml index 381d1ae..ee8a97a 100644 --- a/project_billing_utils/wizard/blank_invoice_view.xml +++ b/project_billing_utils/wizard/blank_invoice_view.xml @@ -1,6 +1,5 @@ - - + Create blank invoice @@ -11,8 +10,8 @@
-
@@ -27,5 +26,4 @@ context="{'inv_type':'out_invoice'}" id="action_create_customer_invoice"/> -
-
+ diff --git a/project_billing_utils/wizard/dissociate_aal.py b/project_billing_utils/wizard/dissociate_aal.py index 36e546e..e29d178 100644 --- a/project_billing_utils/wizard/dissociate_aal.py +++ b/project_billing_utils/wizard/dissociate_aal.py @@ -19,7 +19,7 @@ # ############################################################################## """Introduce a wizard to dissociate an Analytic Line from an Invoice.""" -from openerp import models, api +from odoo import models, api class DissociateInvoice(models.TransientModel): diff --git a/project_billing_utils/wizard/dissociate_aal_view.xml b/project_billing_utils/wizard/dissociate_aal_view.xml index 7564afe..88c7f02 100644 --- a/project_billing_utils/wizard/dissociate_aal_view.xml +++ b/project_billing_utils/wizard/dissociate_aal_view.xml @@ -1,6 +1,5 @@ - - + Dissociate To Invoice @@ -11,8 +10,8 @@
-
@@ -28,5 +27,4 @@ target="new" id="action_dissociate_aal_invoice"/> -
-
+ diff --git a/project_billing_utils/wizard/open_invoices.py b/project_billing_utils/wizard/open_invoices.py index b7845e2..579535e 100644 --- a/project_billing_utils/wizard/open_invoices.py +++ b/project_billing_utils/wizard/open_invoices.py @@ -18,8 +18,8 @@ # along with this program. If not, see . # ############################################################################## -from openerp import models, api -from openerp.tools.safe_eval import safe_eval +from odoo import models, api +from odoo.tools.safe_eval import safe_eval class OpenInvoicesFromProject(models.TransientModel): diff --git a/project_billing_utils/wizard/open_invoices_view.xml b/project_billing_utils/wizard/open_invoices_view.xml index 84e292a..e6974a3 100644 --- a/project_billing_utils/wizard/open_invoices_view.xml +++ b/project_billing_utils/wizard/open_invoices_view.xml @@ -1,6 +1,5 @@ - - + Open Related Invoices @@ -11,8 +10,8 @@
-
@@ -37,5 +36,4 @@ id="action_open_supplier_invoice"/> -
-
+