Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0] [MIG] sale_force_invoiced: migration to 17.0 #2961

Merged
merged 51 commits into from
Mar 29, 2024

Conversation

siemenv
Copy link

@siemenv siemenv commented Feb 19, 2024

No description provided.

JordiBForgeFlow and others added 30 commits February 19, 2024 10:28
* [ADD] module 'sale_force_invoiced' for 9.0

* [FIX] Travis
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_force_invoiced
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_force_invoiced/
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_force_invoiced
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_force_invoiced/de/
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_force_invoiced
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_force_invoiced/zh_CN/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-13.0/sale-workflow-13.0-sale_force_invoiced
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-13-0/sale-workflow-13-0-sale_force_invoiced/
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-13.0/sale-workflow-13.0-sale_force_invoiced
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-13-0/sale-workflow-13-0-sale_force_invoiced/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-13.0/sale-workflow-13.0-sale_force_invoiced
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-13-0/sale-workflow-13-0-sale_force_invoiced/
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-13.0/sale-workflow-13.0-sale_force_invoiced
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-13-0/sale-workflow-13-0-sale_force_invoiced/ca/
Sometimes you have a SO that Odoo computes as "Nothing to invoice"
but you want to force it to "Fully invoiced" anyway.

Example: SO with 2 lines, line one is delivered and invoiced,
second line is never going to be delivered nor invoiced (
because of different bussiness reasons). In this situation you
still want to mark the SO as fully invoiced.
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-14.0/sale-workflow-14.0-sale_force_invoiced
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-14-0/sale-workflow-14-0-sale_force_invoiced/fr/
adrianojprado and others added 9 commits February 19, 2024 10:28
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_force_invoiced
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_force_invoiced/pt_BR/
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_force_invoiced
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_force_invoiced/pt/
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_force_invoiced
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_force_invoiced/it/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_force_invoiced
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_force_invoiced/
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_force_invoiced
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_force_invoiced/fr/
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_force_invoiced
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_force_invoiced/it/
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_force_invoiced
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_force_invoiced/de/
@@ -21,6 +20,6 @@ class SaleOrder(models.Model):
def _compute_invoice_status(self):
res = super()._compute_invoice_status()
self.filtered(
lambda so: so.force_invoiced and so.state in ("sale", "done")
lambda so: so.force_invoiced and (so.state == "sale" or so.locked)
Copy link
Member

Choose a reason for hiding this comment

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

In principle, only orders in sale status can be locked. I think you can simplify the module by ignoring the locked field everywhere and just go by state sale. Note that orders in any other state will not be marked as invoiceable by Odoo: https://github.com/odoo/odoo/blob/3f6deca/addons/sale/models/sale_order.py#L530-L531 so even if orders were to be locked in any other status, this override might be considered meaningless for such orders. Or am i missing anything?

@StefanRijnhart
Copy link
Member

/ocabot migration sale_force_invoiced

@OCA-git-bot OCA-git-bot added this to the 17.0 milestone Feb 21, 2024
@OCA-git-bot OCA-git-bot mentioned this pull request Feb 21, 2024
68 tasks
@rousseldenis
Copy link
Sponsor Contributor

@JordiBForgeFlow @MiquelRForgeFlow @StefanRijnhart @siemenv

I would say this module is quite dangerous and something has to be put in README. If a sale order is put as force invoiced and a line is added that generates a delivery order, the sale order won't never been invoiced for that outgoing product.

@StefanRijnhart
Copy link
Member

Maybe a roadmap item can be added for a feature to ensure that only locked orders can be forced invoiced?

@siemenv thanks for the update. Due to squashing, your commit message now has two lines:

 [MIG] sale_force_invoiced: ignore locked state

[MIG] sale_force_invoiced: Migration to 17.0

Only the first line is visible in the commit history here on Github. It must say [MIG] sale_force_invoiced: Migration to 17.0.

Can you fix the commit message?

@siemenv siemenv force-pushed the 17.0-mig-sale_force_invoiced branch from c6e01d0 to 705d0e6 Compare March 15, 2024 08:04
@rousseldenis
Copy link
Sponsor Contributor

/ocabot migration sale_force_invoiced

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 17.0-ocabot-merge-pr-2961-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit d730001 into OCA:17.0 Mar 29, 2024
6 of 7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 8c82f24. 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.

None yet