OCA / contract

GNU Affero General Public License v3.0
170 stars 522 forks source link

[15.0] stop contract line causes error creating new invoice #985

Closed iTecan closed 1 month ago

iTecan commented 1 year ago

Module

contract

Describe the bug

When a contract has two contract lines or more and you want to stop a contract line, the value of next date appears as False and that causes the invoice not being generated

To Reproduce

Affected versions: 15.0

Steps to reproduce the behavior:

  1. Create a contract with two contract lines
  2. Create an invoice
  3. Stop a contract line
  4. Try to create a few new invoices

Expected behavior The new invoice should appear without the stopped contract line

Additional context Add any other context about the problem here. (e.g. OS, Python version, ...)

OS: Ubuntu 20.04 Python 3.8

method: _insert_markers line 605: name = name.replace("#END#", last_date_invoiced.strftime(date_format))

ThijsvOers commented 8 months ago

When I reproduce this bug on version 16.0 with one line I also get an error after stopping the contract (line) and then click on the 'create invoices' button.

The error: File "/odoo/custom/contract/models/contract_line.py", line 606, in _insert_markers name = name.replace("#END#", last_date_invoiced.strftime(date_format)) AttributeError: 'bool' object has no attribute 'strftime'

github-actions[bot] commented 2 months ago

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.