mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
Improve presentation by adding description to the shipping account by the end user.
This commit is contained in:
committed by
Jared Kipe
parent
5b60093a2b
commit
654cbc35b7
@@ -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')
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<field name="model">partner.shipping.account</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Shipping Accounts">
|
||||
<field name="description"/>
|
||||
<field name="name"/>
|
||||
<field name="delivery_type"/>
|
||||
<field name="partner_id"/>
|
||||
@@ -21,6 +22,7 @@
|
||||
<group>
|
||||
<group>
|
||||
<field name="partner_id"/>
|
||||
<field name="description"/>
|
||||
<field name="name"/>
|
||||
<field name="delivery_type"/>
|
||||
</group>
|
||||
@@ -37,6 +39,7 @@
|
||||
<field name="model">partner.shipping.account</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Shipping Account Search">
|
||||
<field name="description"/>
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="delivery_type"/>
|
||||
@@ -69,6 +72,7 @@
|
||||
<xpath expr="//field[@name='property_delivery_carrier_id']" position="after">
|
||||
<field name="shipping_account_ids" context="{'default_partner_id': active_id}">
|
||||
<tree>
|
||||
<field name="description"/>
|
||||
<field name="name"/>
|
||||
<field name="delivery_type"/>
|
||||
</tree>
|
||||
|
||||
Reference in New Issue
Block a user