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

[16.0][MIG] purchase_delivery_split_date: Migration to 16.0 #1687

Merged

Conversation

FernandoRomera
Copy link
Contributor

No description provided.

Lionel Sausin and others added 30 commits December 19, 2022 11:53
Use v8 API
Follow the OCA guidelines for manifest and README
PEP8
Extend _create_stock_move because the method we used to extend in v7 doesn't exist anymore.
Currently translated at 100.0% (2 of 2 strings)

Translation: purchase-workflow-12.0/purchase-workflow-12.0-purchase_delivery_split_date
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-12-0/purchase-workflow-12-0-purchase_delivery_split_date/zh_CN/
Currently translated at 100.0% (2 of 2 strings)

Translation: purchase-workflow-12.0/purchase-workflow-12.0-purchase_delivery_split_date
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-12-0/purchase-workflow-12-0-purchase_delivery_split_date/pt_BR/
This changeset implements a missing part in the module description. If
you have a purchase order with several lines, confirmed, then you change
the dates on some of the line, this would be reflected in the related
stock moves but not in the stock pickings which would not be split or
merged by date.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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

Translation: purchase-workflow-13.0/purchase-workflow-13.0-purchase_delivery_split_date
Translate-URL: https://translation.odoo-community.org/projects/purchase-workflow-13-0/purchase-workflow-13-0-purchase_delivery_split_date/de/
@FernandoRomera FernandoRomera force-pushed the 16.0-mig-purchase_delivery_split_date branch 3 times, most recently from 3bc85c3 to 79a192b Compare February 8, 2023 15:28
@FernandoRomera FernandoRomera force-pushed the 16.0-mig-purchase_delivery_split_date branch from 79a192b to 210ffd0 Compare February 8, 2023 15:32
@rousseldenis
Copy link
Contributor

@FernandoRomera Some things seem weird to me.

I will do a PR on your branch soon.

@rousseldenis
Copy link
Contributor

@gurneyalex Do you remember why you did this and why in this module (it seems functionally out of scope)?

b3e20e8

@rousseldenis
Copy link
Contributor

rousseldenis commented Feb 16, 2023

@FernandoRomera I did this : MallorcaSoft#1

  • Changed test setup to classmethod
  • Fixed unused onchange to replaced compute method for date_planned field (see my previous comment)
  • Split one model per file

@rousseldenis
Copy link
Contributor

I think I will also modify the code on purchase order as there are some operations that can be done by batch

@rousseldenis
Copy link
Contributor

I think I will also modify the code on purchase order as there are some operations that can be done by batch

Done in PR mentionned above. I think that one is ready

@FernandoRomera
Copy link
Contributor Author

@rousseldenis
Done.

@rousseldenis
Copy link
Contributor

And functionally works as expected

self.mapped("order_id")._check_split_pickings()
return res

def create(self, values):
Copy link
Contributor

Choose a reason for hiding this comment

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

@api.model_create_multi

Comment on lines +85 to +89
def create(self, values):
line = super().create(values)
if line.order_id.state == "purchase":
line.order_id._check_split_pickings()
return line
Copy link
Contributor

@lmignon lmignon Feb 24, 2023

Choose a reason for hiding this comment

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

Suggested change
def create(self, values):
line = super().create(values)
if line.order_id.state == "purchase":
line.order_id._check_split_pickings()
return line
@api.model_create_multi
def create(self, vals_list):
lines = super().create(vals_list)
lines.order_id.filtered(lambda l: l.state == "purchase")._check_split_pickings()
return lines

@gurneyalex
Copy link
Member

@gurneyalex Do you remember why you did this and why in this module (it seems functionally out of scope)?

b3e20e8

This does not seem to be out of scope to me.

Change 1:

consider this scenario:

  • User creates a PO, sets different dates on the lines and confirms -> you get different receptions based on the date lines.
  • User adds a line in the PO, saves -> I expect the delivery of the stock move to be done according to the date of the line and this was not done prior to the fix unless the line's planned date had been set / changed

Change 2:

scenario:

  • User creates a PO, sets dates on the PO lines, saves
  • User edits PO, changes quantity on one of the lines -> the lines planned date is reset as a side effect. This will cause frustration for the user as they will easily miss the date reset, or will be painfully aware of it and complain they need to put back the date to the original value after changing a quantity on a PO line. The change saves their time and sanity.

Please keep both in migrations of this module.

@kimirondon
Copy link

hello @FernandoRomera is this PR close to be merged?

@vincent-cowboy
Copy link

is the fix #1350 relevant to this PR?
also, there is a refactoring PR #1326 (linked to #1246)

@andreampiovesana
Copy link

merge?

@dreispt
Copy link
Member

dreispt commented Mar 18, 2023

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-1687-by-dreispt-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 4b7b5f6 into OCA:16.0 Mar 18, 2023
@OCA-git-bot
Copy link
Contributor

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