Commit Graph
2 Commits
Author SHA1 Message Date
Arthur Gossuin (goa) 04bee306bb [IMP] delivery: picking/order ref in DeliveryPackage
Before this commit, to aaccess some values of the DeliveryPackage
objects, we needed to take the value from the related picking. for
example, for the `payment country code` linked to the package, we need
to retrieve the value from the related picking or order.

To avoid passing too much data to the request objects, it is convenient
to be able to access to the order/picking related to the package
directly from the package.

Because these objects are not children of odoo.models.Model, I do not
need to follow the convention for the names, however, calling the
picking > picking_id in the DeliveryPackage suggests that the picking is
actually a odoo.models.Model child, which should be the case if it
exists.

reference-branch= https://github.com/odoo-dev/enterprise/tree/master-dhl_add_commercial_invoice-goa

closes odoo/odoo#83404

Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-01-26 13:11:21 +00:00
Arthur Gossuin (goa) 6b0ab28791 [REF] delivery: Packages and Commodities in base
Each delivery provider, requires some information about the packages
that need to be sent as well as about the commodities (for commecial
invoices). Since this is needed by each provider, and the required
values are very similar, these packages and commodities can be done one
step ahead: in the base delivery module.

These new `_get` functions return a list of custom objects containing
the most important values concerning packages and commodities, and can
be called directly from the child classes.

closes odoo/odoo#82891

Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-01-18 13:40:37 +00:00