Skip to content

Commit

Permalink
[IMP] delivery_deliverea: send incoterms
Browse files Browse the repository at this point in the history
  • Loading branch information
dalonsofl committed Dec 16, 2024
1 parent bce7c4c commit 19ec280
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions delivery_deliverea/models/delivery_carrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ def _prepare_deliverea_order(self, picking):
or "",
},
}
self._get_bulky_deliverea(picking, payload)
self._delete_empty_values(payload)
self._check_mandatory_fields(payload, MANDATORY_SENDER_FIELDS, carrier)
return payload
Expand Down Expand Up @@ -558,3 +559,17 @@ def deliverea_tracking_state_update(self, picking):
picking.date_delivered = datetime.strftime(
datetime.now(), DEFAULT_SERVER_DATETIME_FORMAT
)

def _get_bulky_deliverea(self, picking, payload):
# here we can add the zip code and the warehouse
bulky = {"incoterm": {"code": ""}}
incoterm_code = (
picking.sale_id.incoterm.code
if picking.sale_id and picking.sale_id.incoterm
else self.env.company.incoterm_id.code
)

if incoterm_code:
bulky["incoterm"]["code"] = incoterm_code
payload["bulky"] = bulky

Check warning on line 574 in delivery_deliverea/models/delivery_carrier.py

View check run for this annotation

Codecov / codecov/patch

delivery_deliverea/models/delivery_carrier.py#L573-L574

Added lines #L573 - L574 were not covered by tests
return payload

0 comments on commit 19ec280

Please sign in to comment.