Add description of contents

for/master
Harald Welte 2 years ago
parent 6ac659a755
commit be8ba42315
  1. 3
      models/shipcloud_delivery_carrier.py
  2. 1
      models/shipcloud_shipping_service.py
  3. 1
      views/sc_delivery_carrier.xml

@ -187,6 +187,7 @@ class SCDeliveryCarrier(models.Model):
order = self.env['sale.order'].search([('name','=',pickings.origin)])
recipient = pickings.partner_id
warehouse = pickings.picking_type_id.warehouse_id.partner_id
content_desc = pickings.sc_content_desc
carrier_service = self.sudo().sc_carrier_service
# build individual sub-objects of the shipment
@ -197,7 +198,7 @@ class SCDeliveryCarrier(models.Model):
# 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,
label_fmt=carrier_service.label_size)
label_fmt=carrier_service.label_size, descr=content_desc)
api = self._shipcloud_api()
try:
#print("SHP: %s" % shp)

@ -12,6 +12,7 @@ class SMCStockPickingShipclodu(models.Model):
_inherit = 'stock.picking'
sc_shipment_id = fields.Char(string='shipcloud shipment ID')
sc_tracking_url = fields.Char(string='shipcloud tracking URL')
sc_content_desc = fields.Char(string='Description of Contents')
class SMCShippingScCarrierService(models.Model):

@ -7,6 +7,7 @@
<field name="arch" type="xml">
<xpath expr="//label[@for='carrier_tracking_ref']" position="before">
<field name="sc_shipment_id" attrs="{'invisible':[('delivery_type', '!=', 'sc')]}"/>
<field name="sc_content_desc" attrs="{'invisible':[('delivery_type', '!=', 'sc')]}"/>
</xpath>
</field>
</record>

Loading…
Cancel
Save