Merge pull request #28 from akretion/sale-partner-shipping-filter-with-customer
[8.0] sale_partner_shipping_filter_with_customer module
This commit is contained in:
5
sale_partner_shipping_filter_with_customer/__init__.py
Normal file
5
sale_partner_shipping_filter_with_customer/__init__.py
Normal file
@@ -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 models
|
||||
21
sale_partner_shipping_filter_with_customer/__openerp__.py
Normal file
21
sale_partner_shipping_filter_with_customer/__openerp__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# coding: utf-8
|
||||
# © 2017 Chafique DELLI @ Akretion
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
{
|
||||
'name': 'Partner Shipping Filter with Customer',
|
||||
'summary': "Shows only delivery addresses that are linked "
|
||||
"with the customer",
|
||||
'version': '8.0.1.0.0',
|
||||
'category': 'Sale Management',
|
||||
'website': 'http://akretion.com',
|
||||
'author': 'Akretion, Odoo Community Association (OCA)',
|
||||
'license': 'AGPL-3',
|
||||
'installable': True,
|
||||
'depends': [
|
||||
'sale',
|
||||
],
|
||||
'data': [
|
||||
'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'
|
||||
|
||||
commercial_partner_id = fields.Many2one(
|
||||
related='partner_id.commercial_partner_id', readonly=True)
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_order_form" model="ir.ui.view">
|
||||
<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="commercial_partner_id" invisible="1"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='partner_shipping_id']" position="attributes">
|
||||
<attribute name="domain">['|',
|
||||
('id', '=', partner_id), '&',
|
||||
('type','=', 'delivery'), '&',
|
||||
('id', 'child_of', commercial_partner_id), ('parent_id', '!=', False)]</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user