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

[15.0][MIG] delivery_carrier_preference #453

Closed

Conversation

flachica
Copy link
Contributor

@flachica flachica commented Oct 1, 2022

No description provided.

grindtildeath and others added 30 commits October 1, 2022 15:52
Added dependency to product_total_weight_from_packaging to compute order weight

Refactor module to use delivery preference from stock picking

Add domain field to restrict application of carrier preference on pickings

Use odoo helper for weight uom

Remove sale order extension
* When a new picking was created in the "super" call, it would get the
carrier of the sale order (default implementation of
`_get_new_picking_values` in delivery).
* Modify the way to upgrade the groups and carriers during release:

  * filter moves without available quantity or which do not need a
  release, it prevents assigning a carrier on a picking with nothing
  available or for which we already set the carrier
  * as soon as a picking is assigned a new carrier, push it in a new
  group
  * the new group has the delivery method in the name, to prevent
  confusion with identical group names (default is the SO name)
  * after "super", new picking could have been created for the
  remaining, search them and assign them back to the old group and
  carrier
The shipping method must be set only on OUT pickings (so, the move is
related to a sale line), otherwise, on done, every picking of a chain
will try to deliver using the provider (DHL, ...).
The field exists in the model and is handled, but is missing on the
view.
When we have thousands of moves, the screen becomes hardly usable.
Make the comptutation faster.

* Compute the available quantity directly from quants with a read group
  (the qty_available computed field is too slow as it computes other
  quantities, and even much slower because of "mrp" overrides)
* The computation of the quantity promised to previous moves is very
  slow because it runs one query per move. Use a SQL query with LATERAL
  JOIN in order to run a single query for *all* the moves.

As I changed the computation, I went through it and improved / fixed
some things:

* Show a "previous_promised_qty" field which contains the result of
  the new query that returns the promised qty of previous moves. It
  is shown only with debug mode.
* Do no longer filter on the "previous moves" of the same warehouse:
  moves do not always have a "warehouse_id" set. Instead, all the
  quantities are computed on the same basis: in the view locations of
  all the warehouses, assuming that if we have the quantity anywhere
  in the stock, we can release (then make internal transfers).
* Compute both uom and real "ordered available to promise" quantity in
  the same compute method, the uom one being displayed to the user,
  while the real one is used during the release
* When both the priority and the date_priority of previous moves were
  equal, the previous quantity could be indeterministic, in this case,
  order by id in last resort
* Add tests for search methods
Currently translated at 100.0% (40 of 40 strings)

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

Translation: wms-14.0/wms-14.0-delivery_carrier_preference
Translate-URL: https://translation.odoo-community.org/projects/wms-14-0/wms-14-0-delivery_carrier_preference/
Currently translated at 100.0% (41 of 41 strings)

Translation: wms-14.0/wms-14.0-delivery_carrier_preference
Translate-URL: https://translation.odoo-community.org/projects/wms-14-0/wms-14-0-delivery_carrier_preference/es_AR/
The same way access rights are defined on shipping methods in standard
`delivery` addon.
OCA-git-bot and others added 5 commits October 1, 2022 15:52
`weight` field isn't added on stock move tree view by
`stock_available_to_promise_release` but by `sale_stock_available_to_promise_release`.

As we also depend on `delivery` which already depends on `sale`, it is not an
issue to depend on `sale_stock_available_to_promise_release`.
@flachica flachica force-pushed the 15.0-mig-delivery_carrier_preference branch from d0d0528 to 15371c7 Compare October 2, 2022 08:23
@rousseldenis
Copy link
Contributor

/ocabot migration delivery_carrier_preference

@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Mar 19, 2023
@github-actions github-actions bot closed this Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migration needs fixing stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.