Skip to content

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Mar 26, 2025

Issue

For a German company, when confirming an invoice for an order the
delivery date (of the invoice) gets set to the invoice date, even when one was
manually provided beforehand.

Steps to reproduce

  • Install Sales, Inventory, Purchase and German localization
  • Switch to a German company
  • Create a product
  • Create a Sale Order for the product & confirm it
  • Validate the linked Delivery
  • Go back to the SO & create a (draft) Invoice
  • Set a delivery date & confirm the Invoice

-> The delivery date changed to the invoice date

Cause

When posting, we set the invoice date if no value was provided. This triggers
compute_delivery_date because it is overridden in the German localization to
depend on the invoice_date field. The override is present because delivery_date
is a legal requirement for the German localization.

However, forcing a value for invoice_date is also handled in the _post override
of the localization. We can thus change the compute into an onchange method (to
keep suggesting a value to the user).

This creates a problem of there being no value for delivery_date if invoice_date
is also False. This is because _post sets delivery_date = invoice_date before
calling the logic that forces a value for invoice_date. We should thus provide a
fallback value.


Ticket:
opw-4599301

Forward-Port-Of: #203373
Forward-Port-Of: #201731

Issue
-----
For a German company, when confirming an invoice for an order the delivery date
(of the invoice) gets set to the invoice date, even when one was manually
provided beforehand.

Steps to reproduce
-----
- Install Sales, Inventory, Purchase and German localization
- Switch to a German company
- Create a product
- Create a Sale Order for the product & confirm it
- Validate the linked Delivery
- Go back to the SO & create a (draft) Invoice
- Set a delivery date & confirm the Invoice

-> The delivery date changed to the invoice date

Cause
-----
When posting, we set the invoice date if no value was provided. This triggers
compute_delivery_date because it is overridden in the German localization to
depend on the invoice_date field. The override is present because delivery_date
is a legal requirement for the German localization.

However, forcing a value for invoice_date is also handled in the _post override
of the localization so the compute method is useless. We can just remove it.

This creates a problem of there being no value for delivery_date if invoice_date
is also False. This is because _post sets delivery_date = invoice_date before
calling the logic that forces a value for invoice_date. We should thus provide a
fallback value.

-----
Ticket:
opw-4599301

X-original-commit: c78ad2f
@robodoo
Copy link
Contributor

robodoo commented Mar 26, 2025

Pull request status dashboard

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Mar 26, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 26, 2025

This PR targets 18.0 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Mar 26, 2025
@robodoo robodoo closed this in 2647fdf Mar 27, 2025
gamarino pushed a commit to numaes/numa-public-odoo that referenced this pull request Mar 27, 2025
Issue
-----
For a German company, when confirming an invoice for an order the delivery date
(of the invoice) gets set to the invoice date, even when one was manually
provided beforehand.

Steps to reproduce
-----
- Install Sales, Inventory, Purchase and German localization
- Switch to a German company
- Create a product
- Create a Sale Order for the product & confirm it
- Validate the linked Delivery
- Go back to the SO & create a (draft) Invoice
- Set a delivery date & confirm the Invoice

-> The delivery date changed to the invoice date

Cause
-----
When posting, we set the invoice date if no value was provided. This triggers
compute_delivery_date because it is overridden in the German localization to
depend on the invoice_date field. The override is present because delivery_date
is a legal requirement for the German localization.

However, forcing a value for invoice_date is also handled in the _post override
of the localization so the compute method is useless. We can just remove it.

This creates a problem of there being no value for delivery_date if invoice_date
is also False. This is because _post sets delivery_date = invoice_date before
calling the logic that forces a value for invoice_date. We should thus provide a
fallback value.

-----
Ticket:
opw-4599301

closes odoo/odoo#203497

X-original-commit: c78ad2f7435568f81fb6598487acc2961492c343
Signed-off-by: John Laterre (jol) <jol@odoo.com>
@vandroogenbd vandroogenbd deleted the 18.0-17.0-opw-4599301-invoice_date_incorrect_recompute-drod-425438-fw branch March 28, 2025 08:03
adamsocrat pushed a commit to MINcomSmartSolutions/odoo that referenced this pull request Apr 23, 2025
Issue
-----
For a German company, when confirming an invoice for an order the delivery date
(of the invoice) gets set to the invoice date, even when one was manually
provided beforehand.

Steps to reproduce
-----
- Install Sales, Inventory, Purchase and German localization
- Switch to a German company
- Create a product
- Create a Sale Order for the product & confirm it
- Validate the linked Delivery
- Go back to the SO & create a (draft) Invoice
- Set a delivery date & confirm the Invoice

-> The delivery date changed to the invoice date

Cause
-----
When posting, we set the invoice date if no value was provided. This triggers
compute_delivery_date because it is overridden in the German localization to
depend on the invoice_date field. The override is present because delivery_date
is a legal requirement for the German localization.

However, forcing a value for invoice_date is also handled in the _post override
of the localization so the compute method is useless. We can just remove it.

This creates a problem of there being no value for delivery_date if invoice_date
is also False. This is because _post sets delivery_date = invoice_date before
calling the logic that forces a value for invoice_date. We should thus provide a
fallback value.

-----
Ticket:
opw-4599301

closes odoo#203497

X-original-commit: c78ad2f
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants