Browse Source

[IMP+FIX] contract: Better README + category + assign contract unconditionally

pull/202/head
Pedro M. Baeza 8 years ago
parent
commit
bf61bc3567
  1. 27
      contract/README.rst
  2. 3
      contract/__openerp__.py
  3. 5
      contract/models/contract.py

27
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 <https://github.com/OCA/contract/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 <https://github.com/OCA/contract/issues/new?body=module:%20contract%0Aversion:%209.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/contract/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
=======

3
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': [],
}

5
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,

Loading…
Cancel
Save