credativ team mailing list archive
-
credativ team
-
Mailing list archive
-
Message #05970
[Merge] lp:~credativ/credativ-openerp/sale_order_line_tax_filter-7.0 into lp:~credativ/credativ-openerp/addons-7.0
Kinner Vachhani has proposed merging lp:~credativ/credativ-openerp/sale_order_line_tax_filter-7.0 into lp:~credativ/credativ-openerp/addons-7.0.
Requested reviews:
credativ (credativ)
For more details, see:
https://code.launchpad.net/~credativ/credativ-openerp/sale_order_line_tax_filter-7.0/+merge/220414
--
https://code.launchpad.net/~credativ/credativ-openerp/sale_order_line_tax_filter-7.0/+merge/220414
Your team credativ is requested to review the proposed merge of lp:~credativ/credativ-openerp/sale_order_line_tax_filter-7.0 into lp:~credativ/credativ-openerp/addons-7.0.
=== added directory 'sale_order_line_tax_filter'
=== added file 'sale_order_line_tax_filter/__init__.py'
--- sale_order_line_tax_filter/__init__.py 1970-01-01 00:00:00 +0000
+++ sale_order_line_tax_filter/__init__.py 2014-05-21 09:56:32 +0000
@@ -0,0 +1,27 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2014 credativ Ltd (<http://credativ.co.uk>).
+# All Rights Reserved
+# $Id$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import sale
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
=== added file 'sale_order_line_tax_filter/__openerp__.py'
--- sale_order_line_tax_filter/__openerp__.py 1970-01-01 00:00:00 +0000
+++ sale_order_line_tax_filter/__openerp__.py 2014-05-21 09:56:32 +0000
@@ -0,0 +1,37 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2014 credativ Ltd (<http://credativ.co.uk>).
+# All Rights Reserved
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+##############################################################################
+
+{
+ "name": "Sales Order taxes domain",
+ "version": "1.0",
+ 'category' : 'Sales',
+ 'description' :"""
+This module will adds domain on sale order line tax field
+viz. domain = [(company_id,'=',company_id)]
+""",
+ 'website': 'http://www.credativ.co.uk',
+ "depends": ["sale"],
+ "author": "credativ Ltd",
+ 'data': ['sales_view.xml'],
+ 'installable': True,
+ 'auto_install': False,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
=== added file 'sale_order_line_tax_filter/sale.py'
--- sale_order_line_tax_filter/sale.py 1970-01-01 00:00:00 +0000
+++ sale_order_line_tax_filter/sale.py 2014-05-21 09:56:32 +0000
@@ -0,0 +1,41 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2014 credativ Ltd (<http://credativ.co.uk>).
+# All Rights Reserved
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv
+
+class sale_order(osv.osv):
+ _inherit = "sale.order"
+
+ def onchange_shop_id(self, cr, uid, ids, shop_id, context=None):
+ '''Change company_id on changing shop'''
+
+ res = super(sale_order,self).onchange_shop_id(cr, uid, ids, shop_id, context=context)
+ v = res.get('value',{})
+ if shop_id:
+ shop = self.pool.get('sale.shop').browse(cr, uid, shop_id, context=context)
+ if shop.company_id:
+ v['company_id'] = shop.company_id.id
+ return {'value':v}
+
+sale_order()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
=== added file 'sale_order_line_tax_filter/sales_view.xml'
--- sale_order_line_tax_filter/sales_view.xml 1970-01-01 00:00:00 +0000
+++ sale_order_line_tax_filter/sales_view.xml 2014-05-21 09:56:32 +0000
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="sale_order_line_tax_domain" model="ir.ui.view">
+ <field name="name">sale.order.line.tax.domain</field>
+ <field name="model">sale.order</field>
+ <field name="priority">20</field>
+ <field name="inherit_id" ref="sale.view_order_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='order_line']/tree//field[@name='tax_id']" position="replace">
+ <field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','<>','purchase'),('company_id','=',parent.company_id)]"/>
+ </xpath>
+ <xpath expr="//field[@name='order_line']/form//field[@name='tax_id']" position="replace">
+ <field name="tax_id" widget="many2many_tags" domain="[('parent_id','=',False),('type_tax_use','<>','purchase'),('company_id','=',parent.company_id)]"/>
+ </xpath>
+ </field>
+ </record>
+ </data>
+</openerp>
+ <!--//form/notebook/page[@string='Order Lines']/tree/field[@name='tax_id']-->
+ <!--//field[@name='order_line']/tree//field[@name='price_unit']-->
\ No newline at end of file
References