Improve presentation by adding description to the shipping account by the end user.

This commit is contained in:
Kristen Marie Kulha
2018-05-11 18:26:33 -07:00
committed by Bhoomi Vaishnani
parent 32ab0b8188
commit b14fce7845
2 changed files with 9 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ class PartnerShippingAccount(models.Model):
_name = 'partner.shipping.account'
name = fields.Char(string='Account Num.', required=True)
description = fields.Char(string='Description')
partner_id = fields.Many2one('res.partner', string='Partner', help='Leave blank to allow as a generic 3rd party shipper.')
delivery_type = fields.Selection([
('other', 'Other'),
@@ -33,7 +34,10 @@ class PartnerShippingAccount(models.Model):
res = []
for acc in self:
res.append((acc.id, '%s: %s' % (get_name(acc.delivery_type), acc.name)))
if acc.description:
res.append((acc.id, acc.description))
else:
res.append((acc.id, '%s: %s' % (get_name(acc.delivery_type), acc.name)))
return res
@api.constrains('name', 'delivery_type')