Sale and purchase taxes are not get from account.accout default tax
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Opinion
|
Low
|
OpenERP R&D Addons Team 2 | |||
OpenERP Community Backports (Addons) |
New
|
Undecided
|
Laurent Mignon (Acsone) | |||
Therp Backports (Deprecated) | Status tracked in Addons-6.1 | |||||
Addons-6.1 |
Fix Released
|
Wishlist
|
Stefan Rijnhart (Opener) | |||
Addons-7.0 |
New
|
Undecided
|
Unassigned |
Bug Description
Default taxes defined in product's income or expense account (product_
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/
32a33,34
>
>
667a670
> prod_tpl = self.pool.
674a678
> context[
705a710,714
> taxes = prod.supplier_
> prod_tpl.
> prod_tpl.
>
>
707c716
< 'taxes_
---
> 'taxes_id': taxes,
713d721
< taxes = self.pool.
798a807
> prod_tpl = self.pool.
811c820,822
< taxes_ids = procurement.
---
> taxes_ids = prod_tpl.
> prod_tpl.
> prod_tpl.
---
---
addons/sale/sale.py
1018a1019
> product_tpl = self.pool.
1031a1033
> product_tpl = product_
1073a1076,1079
> if not result['tax_id']:
> result['tax_id'] = self.pool.
> if not result['tax_id']:
> result['tax_id'] = self.pool.
---
Related branches
- Mustufa Rangwala (Open ERP) (community): Approve
- Meera Trambadia (OpenERP) (community): Needs Resubmitting
- qdp (OpenERP): Pending requested
-
Diff: 25 lines (+4/-2)1 file modifiedsale/sale.py (+4/-2)
- Rucha (Open ERP) (community): Approve
- qdp (OpenERP): Pending requested
-
Diff: 25 lines (+4/-4)1 file modifiedpurchase/purchase.py (+4/-4)
- OpenERP Core Team: Pending requested
-
Diff: 760 lines (+508/-43)18 files modifiedaccount/account_invoice.py (+2/-3)
account/product.py (+63/-0)
account/tests/__init__.py (+2/-0)
account/tests/test_default_tax.py (+162/-0)
delivery/sale.py (+3/-2)
delivery/stock.py (+5/-4)
hr_expense/hr_expense.py (+2/-10)
hr_timesheet_invoice/hr_timesheet_invoice.py (+6/-4)
mrp_repair/mrp_repair.py (+1/-1)
point_of_sale/point_of_sale.py (+0/-1)
purchase/purchase.py (+1/-2)
purchase/tests/__init__.py (+5/-0)
purchase/tests/test_default_tax.py (+106/-0)
purchase_requisition/purchase_requisition.py (+5/-2)
sale/sale.py (+1/-2)
sale/tests/__init__.py (+36/-0)
sale/tests/test_default_tax.py (+99/-0)
stock/stock.py (+9/-12)
- Holger Brunn (Therp): Disapprove
-
Diff: 760 lines (+508/-43)18 files modifiedaccount/account_invoice.py (+2/-3)
account/product.py (+63/-0)
account/tests/__init__.py (+2/-0)
account/tests/test_default_tax.py (+162/-0)
delivery/sale.py (+3/-2)
delivery/stock.py (+5/-4)
hr_expense/hr_expense.py (+2/-10)
hr_timesheet_invoice/hr_timesheet_invoice.py (+6/-4)
mrp_repair/mrp_repair.py (+1/-1)
point_of_sale/point_of_sale.py (+0/-1)
purchase/purchase.py (+1/-2)
purchase/tests/__init__.py (+5/-0)
purchase/tests/test_default_tax.py (+106/-0)
purchase_requisition/purchase_requisition.py (+5/-2)
sale/sale.py (+1/-2)
sale/tests/__init__.py (+36/-0)
sale/tests/test_default_tax.py (+99/-0)
stock/stock.py (+9/-12)
Changed in openobject-addons: | |
assignee: | nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3) |
importance: | Undecided → Low |
status: | New → Confirmed |
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Changed in openobject-addons: | |
milestone: | none → 6.1 |
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
Changed in therp-backports: | |
importance: | Undecided → Low |
importance: | Low → Wishlist |
status: | New → Fix Committed |
Changed in therp-backports: | |
assignee: | nobody → Stefan Rijnhart (Therp) (stefan-therp) |
Changed in therp-backports: | |
status: | Fix Committed → Fix Released |
milestone: | none → 6.1-maintenance |
Changed in therp-backports: | |
milestone: | 6.1-maintenance → 7.0-maintenance |
Changed in ocb-addons: | |
assignee: | nobody → Muschang Anthony (Acsone) (anthony-muschang) |
Changed in ocb-addons: | |
assignee: | Muschang Anthony (Acsone) (anthony-muschang) → Laurent Mignon (Acsone) (lmi) |
oh, there seems to be a small bug in my patch. In purchase.py line 'company_ id'] = self.browse(cr, uid, ids[0], context).company_id 'company_ id'] = self.browse(cr, uid, ids, context) [0].company_ id
context[
seems to raise list index out of range exception. Better line might be like
context[
But I'm not sure if that line is needed anyway.