Skip to content

Commit

Permalink
[IMP] delivery: mandate the tracking reference for amazon SO
Browse files Browse the repository at this point in the history
Added a hook in delivery to check if an Amazon order's delivery is Amazon compliant.

Enterprise PR: odoo/enterprise#19065
task-2573260

closes odoo#73413

X-original-commit: 9b407bf
Related: odoo/enterprise#19523
Signed-off-by: Antoine Vandevenne (anv) <[email protected]>
  • Loading branch information
Demesmaeker committed Jul 8, 2021
1 parent 68dc680 commit 04de84f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addons/delivery/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def _send_confirmation_email(self):
if pick.carrier_id:
if pick.carrier_id.integration_level == 'rate_and_ship' and pick.picking_type_code != 'incoming':
pick.send_to_shipper()
pick._check_carrier_details_compliance()
return super(StockPicking, self)._send_confirmation_email()

def _pre_put_in_pack_hook(self, move_line_ids):
Expand Down Expand Up @@ -184,6 +185,11 @@ def send_to_shipper(self):
self.message_post(body=msg)
self._add_delivery_cost_to_so()

def _check_carrier_details_compliance(self):
"""Hook to check if a delivery is compliant in regard of the carrier.
"""
pass

def print_return_label(self):
self.ensure_one()
self.carrier_id.get_return_label(self)
Expand Down

0 comments on commit 04de84f

Please sign in to comment.