OCA / sale-workflow

Odoo Sales, Workflow and Organization
GNU Affero General Public License v3.0
298 stars 1.04k forks source link

[17.0] sale_start_end_dates : start_date is also created by rental module from odoo #3369

Open CanMik opened 1 month ago

CanMik commented 1 month ago

Module

sale_start_end_dates

Describe the bug

With Odoo 17, in the module sale_renting there is identical field "start_date", "end_date", these fields are datetime fields

To Reproduce

Affected versions: 17.0

Steps to reproduce the behavior:

  1. Install sale_renting
  2. Go into Renting module
  3. Create a product that can be rented
  4. Create a sale_order with a rentable product
  5. You've got an error File "/usr/lib/python3/dist-packages/odoo/addons/sale_stock_renting/models/sale_order_line.py", line 98, in keyfunc = lambda line_id: (max(lines_grouping_key[line_id][0], now), lines_grouping_key[line_id][1], lines_grouping_key[line_id][2]) TypeError: '>' not supported between instances of 'datetime.datetime' and 'bool'

Expected behavior Chanege the type of start_date & end_date and complete compatibility with sale_renting module.

CanMik commented 1 month ago

Forgot to mention that this module has a link with "Account Invoice Start End Dates". In Odoo 17 there is two new fields that invalided the module "account_invoice_start_end_dates" -> deferred_start_date and deferred_end_sate.

So it needs to update this feature "Upon invoice creation, the values of the start/end dates of the sale order line are copied to the start/end dates of invoice lines."