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')
|
|
|
|
sc_tracking_url = fields.Char(string='shipcloud tracking URL')
|
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)
|