odoo_shipcloud/models/shipcloud_shipping_service.py

24 lines
1.1 KiB
Python
Raw Permalink Normal View History

2021-02-14 18:18:25 +00:00
from openerp import api, fields, models
# extend deliver.carrier with shipcloud
class SMCShippingShipcloud(models.Model):
_inherit = 'delivery.carrier'
delivery_type = fields.Selection(selection_add=[('sc', 'shipcloud')])
2021-02-14 20:16:23 +00:00
sc_carrier_service = fields.Many2one(comodel_name='delivery.carrier.sc.carrier_service',
string='Shipcloud Carrier Service')
2021-02-14 18:18:25 +00:00
# extend stock.picking with fields related to shipcloud
class SMCStockPickingShipclodu(models.Model):
_inherit = 'stock.picking'
sc_shipment_id = fields.Char(string='shipcloud shipment ID', readonly=True, copy=False)
sc_tracking_url = fields.Char(string='shipcloud tracking URL', readonly=True, copy=False)
2021-02-14 21:25:58 +00:00
sc_content_desc = fields.Char(string='Description of Contents')
2021-02-14 20:16:23 +00:00
class SMCShippingScCarrierService(models.Model):
_name = 'delivery.carrier.sc.carrier_service'
name = fields.Char(string="Name", required=1)
carrier = fields.Char(string="shipcloud Carrier", required=1)
service = fields.Char(string="shipcloud Service", required=1)
label_size = fields.Char(string="shipcloud Label Size", required=1)