Pedro M. Baeza ce8c1fac59 [FIX] contract: Reset next invoicing date when terminating a line
Steps to reproduce the problem:

- Create a new contract
- Set "Recurrence at line level?"
- Add a new line, with following data:

  * Invoice Every: 1 Month(s)
  * Date Start: 2022-06-01
  * Invoicing type: Pre-paid
- Save and click on "Create invoices" button
- Now edit again and put "Date End": 2022-06-30

Current behavior:

The line is still invoiceable (appears in blue), and if you click on
"Create invoices" button, you get the traceback:

```
  ...
  File "/mnt/data/odoo-addons-dir/contract/models/contract.py", line 534, in recurring_create_invoice
    invoice = self._recurring_create_invoice()
  File "/mnt/data/odoo-addons-dir/contract/models/contract.py", line 561, in _recurring_create_invoice
    invoices_values = self._prepare_recurring_invoices_values(date_ref)
  File "/mnt/data/odoo-addons-dir/contract/models/contract.py", line 516, in _prepare_recurring_invoices_values
    invoice_line_vals = line._prepare_invoice_line(move_form=move_form)
  File "/mnt/data/odoo-addons-dir/contract_layout_category_hide_detail/models/contract_line.py", line 12, in _prepare_invoice_line
    vals = super()._prepare_invoice_line(move_form)
  File "/mnt/data/odoo-addons-dir/product_contract/models/contract_line.py", line 22, in _prepare_invoice_line
    res = super(ContractLine, self)._prepare_invoice_line(move_form)
  File "/mnt/data/odoo-addons-dir/contract_variable_quantity/models/contract_line.py", line 44, in _prepare_invoice_line
    vals = super()._prepare_invoice_line(move_form)
  File "/mnt/data/odoo-addons-dir/contract/models/contract_line.py", line 545, in _prepare_invoice_line
    name = self._insert_markers(dates[0], dates[1])
  File "/mnt/data/odoo-addons-dir/contract/models/contract_line.py", line 595, in _insert_markers
    name = name.replace("#END#", last_date_invoiced.strftime(date_format))
AttributeError: 'bool' object has no attribute 'strftime'
```

Expected behavior:

Line is not invoiceable anymore, and "Create invoices" button disappears
(as no invoiceable line - but anyways, calling the method the same
doesn't trigger the invoice creation).

TT37880
2022-07-01 20:02:31 +02:00
2022-06-18 14:26:00 +02:00
2022-06-18 14:26:00 +02:00
2022-06-18 14:26:00 +02:00
2022-03-02 16:21:17 +00:00
2020-10-28 11:48:43 +00:00
2020-10-28 08:44:56 +00:00
2021-10-14 21:05:44 +00:00
2022-06-18 15:38:49 +00:00
2022-06-18 14:26:00 +02:00
2020-03-14 11:55:15 +01:00
2022-06-18 14:26:00 +02:00
2022-06-18 14:26:00 +02:00
2022-06-18 14:26:00 +02:00
2022-06-18 14:26:00 +02:00
2022-06-18 14:26:00 +02:00
2022-06-18 14:26:00 +02:00
2022-06-18 14:26:00 +02:00
2022-06-18 14:26:00 +02:00
2020-03-14 11:55:15 +01:00
2022-06-18 14:26:00 +02:00
2022-06-18 15:38:53 +00:00

Runboat Pre-commit Status Build Status codecov Translation Status

Contracts management

None

Available addons

addon version maintainers summary
agreement 13.0.1.0.0 ygol alexis-via Adds an agreement object
agreement_legal 13.0.2.5.1 max3903 ygol Manage Agreements, LOI and Contracts
agreement_maintenance 13.0.1.0.1 max3903 Manage maintenance agreements and contracts
agreement_rebate 13.0.1.0.1 Rebate in agreements
agreement_sale 13.0.1.0.0 alexis-via bealdav Agreement on sales
agreement_serviceprofile 13.0.1.0.0 max3903 Adds an Agreement Service Profile object
contract 13.0.2.8.0 Recurring - Contracts Management
contract_layout_category_hide_detail 13.0.1.0.0 Hide details for sections in Contract lines
contract_mandate 13.0.1.0.0 Mandate in contracts and their invoices
contract_payment_mode 13.0.1.0.0 Payment mode in contracts and their invoices
contract_sale 13.0.1.1.0 Contract from Sale
contract_variable_qty_timesheet 13.0.1.0.0 carlosdauden pedrobaeza Add formula to invoice
contract_variable_quantity 13.0.1.2.0 Variable quantity in contract recurrent invoicing
product_contract 13.0.1.0.1 sbejaoui Recurring - Product Contract

Licenses

This repository is licensed under AGPL-3.0.

However, each module can have a totally different license, as long as they adhere to Odoo Community Association (OCA) policy. Consult each module's __manifest__.py file, which contains a license key that explains its license.


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.

Description
No description provided
Readme 66 MiB
Languages
Python 60.4%
HTML 39%
JavaScript 0.4%
SCSS 0.2%