internetmarke/models/dp_shipping_service.py

28 lines
1.2 KiB
Python

from openerp import api, fields, models
# extnd delivery.carrier with DP
class SMCShippingDp(models.Model):
_inherit="delivery.carrier"
delivery_type = fields.Selection(selection_add=[('dp','Deutsche Post')])
dp_service_type = fields.Many2one(comodel_name = 'delivery.carrier.dp.service', string = 'DP Service')
# New model for DP Products/Services (from ProdWS)
class SMCShippingDpService(models.Model):
_name = "delivery.carrier.dp.service"
name = fields.Char(string="Name", required=1)
short_name = fields.Char(string="Short Name")
code = fields.Integer("Product Code", required=1)
prodws_id = fields.Integer("ProdWS ID")
cost_price = fields.Float("Price", required=1)
weight = fields.Float("Allowed Weight", required=1)
height = fields.Integer("Height")
width = fields.Integer("Width")
length = fields.Integer("Length")
international = fields.Boolean("International", required=1)
# extend stock.picking with fields for Shipment and Voucher ID
class StockPicking(models.Model):
_inerit = "stock.picking"
dp_shipping_number = fields.Char(string="DP Shipment ID")
dp_voucher_number = fields.Char(string="DP Voucher ID")