add customs content description
This commit is contained in:
parent
ccb3cb7da5
commit
ef447dd8f9
|
@ -136,13 +136,14 @@ class SCDeliveryCarrier(models.Model):
|
|||
}
|
||||
return res
|
||||
|
||||
def build_sc_customs_decl(self, picking):
|
||||
def build_sc_customs_decl(self, picking, explanation, currency='EUR'):
|
||||
items = [self.build_sc_customs_item(x) for x in picking.move_lines]
|
||||
total = 0.0
|
||||
for i in items:
|
||||
total += i['value_amount']
|
||||
customs = {
|
||||
'contents_type': 'commercial_goods',
|
||||
'contents_explanation': explanation,
|
||||
'currency': currency,
|
||||
'invoice_number': picking.name,
|
||||
'total_value_amount': total,
|
||||
|
@ -194,7 +195,7 @@ class SCDeliveryCarrier(models.Model):
|
|||
from_addr = self.build_sc_addr(warehouse)
|
||||
to_addr = self.build_sc_addr(recipient)
|
||||
pkg = self.build_sc_pkg(picking=pickings)
|
||||
customs = None #self.build_sc_customs_decl(pickings)
|
||||
customs = None #self.build_sc_customs_decl(pickings, content_desc)
|
||||
# build the actual shipment object
|
||||
shp = shipcloud.gen_shipment(from_addr, to_addr, pkg, pickings.name, customs_decl=customs,
|
||||
carrier=carrier_service.carrier, service=carrier_service.service,
|
||||
|
|
Loading…
Reference in New Issue