domain improvement
This commit is contained in:
committed by
Pierrick brun
parent
ea5fdcf4df
commit
0151c6a6e3
@@ -1,3 +1,5 @@
|
||||
# coding: utf-8
|
||||
# © 2017 Chafique DELLI @ Akretion
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import models
|
||||
|
||||
@@ -16,6 +16,6 @@
|
||||
'sale',
|
||||
],
|
||||
'data': [
|
||||
'sale_view.xml',
|
||||
'views/sale_view.xml',
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# coding: utf-8
|
||||
# © 2017 Chafique DELLI @ Akretion
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import sale
|
||||
12
sale_partner_shipping_filter_with_customer/models/sale.py
Normal file
12
sale_partner_shipping_filter_with_customer/models/sale.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# coding: utf-8
|
||||
# © 2017 Chafique DELLI @ Akretion
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from openerp import models, fields
|
||||
|
||||
|
||||
class SaleOrder(models.Model):
|
||||
_inherit = 'sale.order'
|
||||
|
||||
parent_id = fields.Many2one(related='partner_id.parent_id',
|
||||
readonly=True)
|
||||
@@ -7,8 +7,11 @@
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='partner_id']" position="after">
|
||||
<field name="parent_id" invisible="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='partner_shipping_id']" position="attributes">
|
||||
<attribute name="domain">['|', ('id', '=', partner_id), '&', ('parent_id', '=', partner_id), ('type','=', 'delivery')]</attribute>
|
||||
<attribute name="domain">['|', ('id', '=', partner_id), '&', ('type','=', 'delivery'), '|', ('parent_id', '=', partner_id), '&', ('parent_id', '=', parent_id), ('parent_id', '!=', False)]</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
Reference in New Issue
Block a user