Add ability to add 'description' field to package, not just shipment
seit Januar 2023 muss für den Versand nach Mexiko eine Paketbeschreibung übergeben werden. UPS schreibt dazu: Hide quoted text However, as of January of 2023, the Mexican Tax Authority adopted the Carta Porte requirements, which mandate that all shipments to and within Mexico include a Package Description field that accurately describes the contents of the shipment. Sie übergeben die Beschreibung derzeit auf der shipment-Ebene: }, "carrier": "ups", "package": { "type": "parcel", "width": 20, "height": 4, "length": 27, "weight": 0.48 }, "service": "one_day", "incoterm": "dap", "description": "sim cards", "reference_number": "AM93\\OUT\\07008", "notification_mail": "roman.rohleder@gmail.com", "create_shipping_label": true } Sie müssen aber sowohl auf shipment-Ebene, als auch auf package-Ebene eine description angeben, damit ein Label erstellt wird. Z.B.: }, "carrier": "ups", "package": { "type": "parcel", "width": 20, "height": 4, "length": 27, "weight": 0.48", "description": "sim cards" }, "service": "one_day", "incoterm": "dap", "description": "sim cards", "reference_number": "AM93\\OUT\\07008", "notification_mail": "roman.rohleder@gmail.com", "create_shipping_label": true }
This commit is contained in:
parent
39dc362ed1
commit
38c2442567
|
@ -154,7 +154,7 @@ def gen_customs_decl(currency, invoice_nr, net_total, items, importer_ref=None,
|
||||||
return customs_decl
|
return customs_decl
|
||||||
|
|
||||||
|
|
||||||
def gen_package(width_cm, length_cm, height_cm, weight_kgs, value=None, currency=None):
|
def gen_package(width_cm, length_cm, height_cm, weight_kgs, value=None, currency=None, descr=None):
|
||||||
"""Generate a dict for a package in accordance with
|
"""Generate a dict for a package in accordance with
|
||||||
https://developers.shipcloud.io/reference/shipments_request_schema.html"""
|
https://developers.shipcloud.io/reference/shipments_request_schema.html"""
|
||||||
package = {
|
package = {
|
||||||
|
@ -171,6 +171,8 @@ def gen_package(width_cm, length_cm, height_cm, weight_kgs, value=None, currency
|
||||||
'amount': value,
|
'amount': value,
|
||||||
'currency': currency,
|
'currency': currency,
|
||||||
}
|
}
|
||||||
|
if descr:
|
||||||
|
package['description'] = descr
|
||||||
return package
|
return package
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,7 @@ class SCDeliveryCarrier(models.Model):
|
||||||
"""Convert an Odoo stock.picking or sale.order into a shipcloud package"""
|
"""Convert an Odoo stock.picking or sale.order into a shipcloud package"""
|
||||||
pkg = {}
|
pkg = {}
|
||||||
pkg['type'] = 'parcel'
|
pkg['type'] = 'parcel'
|
||||||
|
pkg['description'] = picking.sc_content_desc
|
||||||
if picking:
|
if picking:
|
||||||
pkg['weight'] = self._get_weight_with_tare(order, picking)
|
pkg['weight'] = self._get_weight_with_tare(order, picking)
|
||||||
pkg['length'] = picking.packaging_length
|
pkg['length'] = picking.packaging_length
|
||||||
|
|
Loading…
Reference in New Issue