delivery-carrier
delivery-carrier copied to clipboard
[16.0][IMP-FIX] delivery_auto_refresh - performance & compatibility & cleanup
In summary:
- Cleanup code (use a single context variable to prevent re-execution, make dedicated methods for each purpose).
- Increase performance (there was many recursive execution of the same delete/add line - code is now executed once and only what needs to be modified).
- Make the module compatible with sale_order_carrier_auto_assign. ~~Move carrier assignment to that module so that this module concentrate on cost delivery line update (i.e. refresh as from its name). See https://github.com/OCA/sale-workflow/pull/3081~~ Marked as migration v17.0 improvement
- Make module more robust. Implement SO line create/write
Depends on:
- ~~https://github.com/OCA/sale-workflow/pull/3081~~
Settings:
In details (one commit for each) - in reverse order:
- config parameters moved to company. "sale_" prefix added to the parameters
- add tests from https://github.com/OCA/delivery-carrier/pull/790 & https://github.com/OCA/delivery-carrier/pull/791
- improve help & readme
- refresh on SO line create/write
- set carrier: ~~use https://github.com/OCA/sale-workflow/pull/3081~~ integrated here and marked to move on v17.0
- refresh the minimum: Create or delete line only if necessary. Update existing line if necessary
- iterate over list, not set
- fix write & discount
- Don't pass discount variable in context
- fix create in batch (api.model_create_multi instead of api.model)
- docstring: Don't modify standard method docstring
Compatibility checks/fixes with other modules triggering refresh on SO create/write:
- [x] https://github.com/OCA/sale-workflow/tree/16.0/sale_product_packaging_container_deposit https://github.com/OCA/product-attribute/pull/1583
- [x] https://github.com/OCA/sale-workflow/tree/16.0/sale_order_carrier_auto_assign Solved
- [x] https://github.com/OCA/sale-promotion/pull/208 Looks good
- [x] https://github.com/OCA/sale-workflow/tree/16.0/sale_product_multi_add https://github.com/OCA/sale-workflow/pull/3084
cc @pedrobaeza @santostelmo @yvaucher @simahawk @francesco-ooops @renda-dev
Config parameters moved to company. sale_
prefix added to the parameters
Ready for final review
hi @pedrobaeza could you review this PR please ?
What a great day to merge this nice PR. Let's do it! Prepared branch 16.0-ocabot-merge-pr-799-by-pedrobaeza-bump-nobump, awaiting test results.
Congratulations, your PR was merged at 9a0492e261df597e71a5c0c459d2fdc57ddf70e6. Thanks a lot for contributing to OCA. ❤️
Thanks again for your efforts.
@pedrobaeza Thanks for your time on this review :)
This PR affects MT-5997 @moduon and https://github.com/OCA/delivery-carrier/pull/815 which is being reviewed by @yajo
@Gelojr @fcvalgar please deep functional review 😄 ❤️
Hello @jbaudoux ,
We don't want to use sale_order_carrier_auto_assign
module. It's mandatory?
We wouldn't be forced yo use it 😢
Let me know please! 😄
Thank you!
Hello @jbaudoux ,
We don't want to use
sale_order_carrier_auto_assign
module. It's mandatory?We wouldn't be forced yo use it 😢.
Let me know please! 😄
Thank you!
There is no new dependency in v16.
OK, sorry. I miss some comments 🙏🏼 . Thank you! 😄
It seems v16 settings layout broke:
It seems v16 settings layout broke:
@jbaudoux
@rousseldenis I'm not sure if it can help, but this is my attempt to fix the layout e6214da220132e6289d01741fd08d00229ee2efb