From 71f82e2ae4ddc43d9aff7c290edd1e5451096232 Mon Sep 17 00:00:00 2001
From: "mra (Open ERP)" <mra@tinyerp.com>
Date: Thu, 12 Feb 2009 12:19:03 +0530
Subject: [PATCH] fix bug number : 328134 -  can't associate a tax to a product
 if tax has 'Tax Application' set to 'All' - modify Financial
 Management->invoices also for same problem

bzr revid: mra@tinyerp.com-20090212064903-9js22bwgih61prxu
---
 addons/account/account.py | 6 +++---
 addons/account/product.py | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/addons/account/account.py b/addons/account/account.py
index 0e5a1e425b63..7b07167f18f0 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -1241,9 +1241,9 @@ class account_tax(osv.osv):
             context=None, count=False):
         if context and context.has_key('type'):
             if context['type'] in ('out_invoice','out_refund'):
-                args.append(('type_tax_use','=','sale'))
+                args.append(('type_tax_use','in',['sale','all']))
             elif context['type'] in ('in_invoice','in_refund'):
-                args.append(('type_tax_use','=','purchase'))
+                args.append(('type_tax_use','in',['purchase','all']))
         return super(account_tax, self).search(cr, uid, args, offset, limit, order, context, count)
 
     def name_get(self, cr, uid, ids, context={}):
@@ -2142,7 +2142,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
         vals_journal={}
         view_id = self.pool.get('account.journal.view').search(cr,uid,[('name','=','Journal View')])[0]
         seq_id = obj_sequence.search(cr,uid,[('name','=','Account Journal')])[0]
-        
+
         if obj_multi.seq_journal:
             seq_id_sale = obj_sequence.search(cr,uid,[('name','=','Sale Journal')])[0]
             seq_id_purchase = obj_sequence.search(cr,uid,[('name','=','Purchase Journal')])[0]
diff --git a/addons/account/product.py b/addons/account/product.py
index b26d9b122081..f061e22cb145 100644
--- a/addons/account/product.py
+++ b/addons/account/product.py
@@ -54,10 +54,10 @@ class product_template(osv.osv):
     _columns = {
         'taxes_id': fields.many2many('account.tax', 'product_taxes_rel',
             'prod_id', 'tax_id', 'Customer Taxes',
-            domain=[('parent_id','=',False),('type_tax_use','=','sale')]),
+            domain=[('parent_id','=',False),('type_tax_use','in',['sale','all'])]),
         'supplier_taxes_id': fields.many2many('account.tax',
             'product_supplier_taxes_rel', 'prod_id', 'tax_id',
-            'Supplier Taxes', domain=[('parent_id', '=', False),('type_tax_use','=','purchase')]),
+            'Supplier Taxes', domain=[('parent_id', '=', False),('type_tax_use','in',['purchase','all'])]),
         'property_account_income': fields.property(
             'account.account',
             type='many2one',
-- 
GitLab