Skip to content

[18.0] [MIG] sale_invoice_policy#3346

Merged
OCA-git-bot merged 55 commits intoOCA:18.0from
acsone:18.0-mig-sale_invoice_policy
Jun 2, 2025
Merged

[18.0] [MIG] sale_invoice_policy#3346
OCA-git-bot merged 55 commits intoOCA:18.0from
acsone:18.0-mig-sale_invoice_policy

Conversation

@marielejeune
Copy link
Copy Markdown
Contributor

@marielejeune marielejeune commented Oct 8, 2024

Migration of sale_invoice_policy. I based this PR on #3376 to include the needed fixes/improvements. I've checked nothing was changed in this addon in v17.

@marielejeune marielejeune marked this pull request as draft October 8, 2024 14:06
@marielejeune marielejeune force-pushed the 18.0-mig-sale_invoice_policy branch from 5abf01d to bcdb778 Compare October 8, 2024 14:29
@marielejeune marielejeune marked this pull request as ready for review October 8, 2024 14:29
@marielejeune marielejeune force-pushed the 18.0-mig-sale_invoice_policy branch from bcdb778 to 6ac4533 Compare October 8, 2024 14:30
@rousseldenis
Copy link
Copy Markdown
Contributor

/ocabot migration sale_invoice_policy

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Oct 23, 2024
@marielejeune marielejeune force-pushed the 18.0-mig-sale_invoice_policy branch 2 times, most recently from 1a71668 to 942d999 Compare November 18, 2024 10:49
@marielejeune marielejeune marked this pull request as draft November 18, 2024 10:50
@marielejeune marielejeune marked this pull request as ready for review November 18, 2024 10:59
@marielejeune marielejeune marked this pull request as draft November 18, 2024 11:08
@marielejeune marielejeune force-pushed the 18.0-mig-sale_invoice_policy branch from 942d999 to 91bd254 Compare November 18, 2024 13:23
@marielejeune marielejeune marked this pull request as ready for review November 18, 2024 13:24
Copy link
Copy Markdown

@BT-dmoreno BT-dmoreno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes across versions were minimal, and they looks all good to me.

@BT-dmoreno
Copy link
Copy Markdown

@marielejeune could you please re-run the two failed tests? The logs have expired and I have no idea what the complain was about.

@marielejeune marielejeune force-pushed the 18.0-mig-sale_invoice_policy branch from 91bd254 to 288624c Compare May 12, 2025 06:49
@marielejeune
Copy link
Copy Markdown
Contributor Author

Hi @BT-dmoreno here there are. I'm going to have a look to fix them asap, but I'm just coming back from holidays, so let me a few days :-)

@BT-dmoreno
Copy link
Copy Markdown

Hi @marielejeune, hope everything is going fine after your holidays. Please let me know if there is some way I can help you to finish with is missing here? Looks like there's just a little bit missing.

OCA-git-bot and others added 12 commits May 21, 2025 12:34
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_invoice_policy
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_invoice_policy/
Don't use the 'required' parameter to compute the quantities to invoice or not.
In fact, this should only depends on the invoice policy itself.
As ORM appends new depends() parameters to existing ones, simplify the writing
…he amount

As for the 'qty_to_invoice' field, the 'untaxed_amount_to_invoice' field should not
depends on the required option to compute its value
As we don't want to rewrite Odoo core method inside this module, we
should not rewrite the method to compute the untaxed amount to invoice.

Instead, save the product invoice policy, change it to sale order one without
recomputing context, call the super() method and then, restore its former value.
…olicy

With default behavior in Odoo, the invoicing policy depends on products configuration.
So, include this as possible value for sale order invoicing policy. Possible values are so:

  - Products Invoice Policy: each product applies its invoicing policy (by sale line)
  - Ordered quantities: the whole sale order will apply the invoicing policy on ordered quantities
  - Delivered Quantities: the whole sale order will apply the invoicing policy on delivered quantities

That said, the 'required' configuration is no more useful as the invoicing policy is now required
on sale order level.
…ecompute()

To avoid marking 'invoice_policy' product field as dirty for products temporary value,
use the working context manager 'protecting()' instead of deprecated 'norecompute() one.

Put the whole process in its own contextmanager.
@marielejeune marielejeune force-pushed the 18.0-mig-sale_invoice_policy branch from 288624c to b0741bb Compare May 21, 2025 10:43
@marielejeune
Copy link
Copy Markdown
Contributor Author

Hi @BT-dmoreno tests are fixed, sorry for the delay!

@BT-dmoreno
Copy link
Copy Markdown

Really thanks a lot @marielejeune 🥇.

@OCA/crm-sales-marketing-maintainers looks like everything is ready here, could you please check and merge this PR?

@OCA-git-bot
Copy link
Copy Markdown
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@BT-dmoreno
Copy link
Copy Markdown

@OCA/crm-sales-marketing-maintainers do you think everything is fine now? In case it's all good, could you please merge this PR?
Thank you very much for taking the time for this PR.

@dreispt
Copy link
Copy Markdown
Member

dreispt commented Jun 2, 2025

/ocabot merge nobump

@OCA-git-bot
Copy link
Copy Markdown
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 18.0-ocabot-merge-pr-3346-by-dreispt-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Jun 2, 2025
Signed-off-by dreispt
@OCA-git-bot
Copy link
Copy Markdown
Contributor

It looks like something changed on 18.0 in the meantime.
Let me try again (no action is required from you).
Prepared branch 18.0-ocabot-merge-pr-3346-by-dreispt-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Jun 2, 2025
Signed-off-by dreispt
@OCA-git-bot
Copy link
Copy Markdown
Contributor

It looks like something changed on 18.0 in the meantime.
Let me try again (no action is required from you).
Prepared branch 18.0-ocabot-merge-pr-3346-by-dreispt-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit b8965a3 into OCA:18.0 Jun 2, 2025
7 checks passed
@OCA-git-bot
Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at 68cae11. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.