c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #26287
[Bug 796570] [NEW] Sale and purchase taxes are not get from account.accout default tax
Public bug reported:
Default taxes defined in product's income or expense account
(product_template.property_income_account and
product_template.property_expense_account) does not work in sale orders
or purchase orders.
The situation can be generated like this:
1) create product. Define income account bot does not define any taxes direct to the product.
2) Define default tax to income- and expense accounts related to the product
3) Create SO and select the product you created. There is on taxes on that SO.
Expected behavior would be that if there is no taxes defined in
product, default taxes from income account should be used.
There is same situation with purchase orders as well.
This is a tricky situation when you are working with multi-company
database since product tax definition is not property.
Proposed fix:
With following path taxes seems to be added as they should (in my point of view). There is fix for procurement process as well.
---
addons/purchase/purchase.py:
32a33,34
>
>
667a670
> prod_tpl = self.pool.get('product.template').browse(cr, uid, product)
674a678
> context['company_id'] = self.browse(cr, uid, ids[0], context).company_id
705a710,714
> taxes = prod.supplier_taxes_id or\
> prod_tpl.property_account_expense.tax_ids or\
> prod_tpl.categ_id.property_account_expense_categ.tax_ids
>
>
707c716
< 'taxes_id':map(lambda x: x.id, prod.supplier_taxes_id),
---
> 'taxes_id': taxes,
713d721
< taxes = self.pool.get('account.tax').browse(cr, uid,map(lambda x: x.id, prod.supplier_taxes_id))
798a807
> prod_tpl = self.pool.get('product.template').browse(cr, uid, procurement.product_id.id, context=context)
811c820,822
< taxes_ids = procurement.product_id.product_tmpl_id.supplier_taxes_id
---
> taxes_ids = prod_tpl.supplier_taxes_id or\
> prod_tpl.property_account_expense.tax_ids or\
> prod_tpl.property_account_expense_categ.tax_ids
---
---
addons/sale/sale.py
1018a1019
> product_tpl = self.pool.get('product.template')
1031a1033
> product_tpl = product_tpl.browse(cr, uid, product, context=context)
1073a1076,1079
> if not result['tax_id']:
> result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_tpl.property_account_income.tax_ids)
> if not result['tax_id']:
> result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_tpl.categ_id.property_account_income_categ.tax_ids)
---
** Affects: openobject-addons
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/796570
Title:
Sale and purchase taxes are not get from account.accout default tax
Status in OpenERP Modules (addons):
New
Bug description:
Default taxes defined in product's income or expense account
(product_template.property_income_account and
product_template.property_expense_account) does not work in sale
orders or purchase orders.
The situation can be generated like this:
1) create product. Define income account bot does not define any taxes direct to the product.
2) Define default tax to income- and expense accounts related to the product
3) Create SO and select the product you created. There is on taxes on that SO.
Expected behavior would be that if there is no taxes defined in
product, default taxes from income account should be used.
There is same situation with purchase orders as well.
This is a tricky situation when you are working with multi-company
database since product tax definition is not property.
Proposed fix:
With following path taxes seems to be added as they should (in my point of view). There is fix for procurement process as well.
---
addons/purchase/purchase.py:
32a33,34
>
>
667a670
> prod_tpl = self.pool.get('product.template').browse(cr, uid, product)
674a678
> context['company_id'] = self.browse(cr, uid, ids[0], context).company_id
705a710,714
> taxes = prod.supplier_taxes_id or\
> prod_tpl.property_account_expense.tax_ids or\
> prod_tpl.categ_id.property_account_expense_categ.tax_ids
>
>
707c716
< 'taxes_id':map(lambda x: x.id, prod.supplier_taxes_id),
---
> 'taxes_id': taxes,
713d721
< taxes = self.pool.get('account.tax').browse(cr, uid,map(lambda x: x.id, prod.supplier_taxes_id))
798a807
> prod_tpl = self.pool.get('product.template').browse(cr, uid, procurement.product_id.id, context=context)
811c820,822
< taxes_ids = procurement.product_id.product_tmpl_id.supplier_taxes_id
---
> taxes_ids = prod_tpl.supplier_taxes_id or\
> prod_tpl.property_account_expense.tax_ids or\
> prod_tpl.property_account_expense_categ.tax_ids
---
---
addons/sale/sale.py
1018a1019
> product_tpl = self.pool.get('product.template')
1031a1033
> product_tpl = product_tpl.browse(cr, uid, product, context=context)
1073a1076,1079
> if not result['tax_id']:
> result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_tpl.property_account_income.tax_ids)
> if not result['tax_id']:
> result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_tpl.categ_id.property_account_income_categ.tax_ids)
---
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/796570/+subscriptions
Follow ups
-
[Bug 796570] Re: Sale and purchase taxes are not get from account.accout default tax
From: Fabien (Open ERP), 2011-09-17
-
[Bug 796570] Re: Sale and purchase taxes are not get from account.accout default tax
From: Mayur Maheshwari(OpenERP), 2011-07-08
-
[Bug 796570] Re: Sale and purchase taxes are not get from account.accout default tax
From: Launchpad Bug Tracker, 2011-07-08
-
[Bug 796570] Re: Sale and purchase taxes are not get from account.accout default tax
From: Mayur Maheshwari(OpenERP), 2011-07-08
-
[Bug 796570] Re: Sale and purchase taxes are not get from account.accout default tax
From: Vinay Rana (openerp), 2011-07-08
-
[Bug 796570] Re: Sale and purchase taxes are not get from account.accout default tax
From: Mustufa Rangwala (Open ERP), 2011-07-08
-
[Bug 796570] Re: Sale and purchase taxes are not get from account.accout default tax
From: Meera Trambadia (OpenERP), 2011-07-08
-
[Bug 796570] Re: Sale and purchase taxes are not get from account.accout default tax
From: Launchpad Bug Tracker, 2011-07-08
-
[Bug 796570] Re: Sale and purchase taxes are not get from account.accout default tax
From: Meera Trambadia (OpenERP), 2011-07-07
-
[Bug 796570] Re: Sale and purchase taxes are not get from account.accout default tax
From: Amit Parik (OpenERP), 2011-07-01
-
[Bug 796570] Re: Sale and purchase taxes are not get from account.accout default tax
From: Eetu Salpaharju, 2011-06-15
-
[Bug 796570] [NEW] Sale and purchase taxes are not get from account.accout default tax
From: Eetu Salpaharju, 2011-06-13
References