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

[16.0][IMP] delivery_deliverea: send incoterms #888

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
return payload