From bf61bc3567771a425ea36f48d3cb9393f1d2f455 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 8 Sep 2016 16:26:43 +0200 Subject: [PATCH] [IMP+FIX] contract: Better README + category + assign contract unconditionally --- contract/README.rst | 27 +++++++++++++++++++-------- contract/__openerp__.py | 3 +-- contract/models/contract.py | 5 ++--- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/contract/README.rst b/contract/README.rst index e369c2dc..fc7edb7d 100644 --- a/contract/README.rst +++ b/contract/README.rst @@ -21,9 +21,20 @@ To use this module, you need to: #. Go to Sales -> Contracts and select or create a new contract. #. Check *Generate recurring invoices automatically*. -#. Fill fields and add new lines. You have the possibility to use markers in - the description field to show the start and end date of the invoiced period. -#. A cron is created with daily interval, but if you are in debug mode can +#. Fill fields for selecting the recurrency and invoice parameters: + * Journal + * Pricelist + * Period. It can be any interval of days, weeks, months, months last day or + years. + * Start date and next invoice date. + * Invoicing type: pre-paid or post-paid. +#. Add the lines to be invoiced with the product, description, quantity and + price. +#. You have the possibility to use the markers #START# or #END# in the + description field to show the start and end date of the invoiced period. +#. Choosing between pre-paid and post-paid, you modify the dates that are shown + with the markers. +#. A cron is created with daily interval, but if you are in debug mode, you can click on *Create invoices* to force this action. #. Click *Show recurring invoices* link to show all invoices created by the contract. @@ -35,15 +46,15 @@ To use this module, you need to: Known issues / Roadmap ====================== -* Recovery states and others functional fields in Contracts. +* Recover states and others functional fields in Contracts. 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 `_. +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 ======= diff --git a/contract/__openerp__.py b/contract/__openerp__.py index 76011715..bc9a51cb 100644 --- a/contract/__openerp__.py +++ b/contract/__openerp__.py @@ -6,7 +6,7 @@ { 'name': 'Contracts Management recurring', 'version': '9.0.1.0.0', - 'category': 'Other', + 'category': 'Contract Management', 'license': 'AGPL-3', 'author': "OpenERP SA," "Tecnativa," @@ -20,5 +20,4 @@ 'views/account_invoice_view.xml', ], 'installable': True, - 'images': [], } diff --git a/contract/models/contract.py b/contract/models/contract.py index 4a15d27a..33b72d37 100644 --- a/contract/models/contract.py +++ b/contract/models/contract.py @@ -163,18 +163,17 @@ class AccountAnalyticAccount(models.Model): # Get other invoice line values from product onchange invoice_line._onchange_product_id() invoice_line_vals = invoice_line._convert_to_write(invoice_line._cache) - + # Insert markers name = line.name + contract = line.analytic_account_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 or '%m/%d/%Y' name = self._insert_markers( name, self.env.context['old_date'], self.env.context['next_date'], date_format) - invoice_line_vals.update({ 'name': name, 'account_analytic_id': contract.id,