← Back to team overview

openerp-india team mailing list archive

[Bug 1059868] Re: purchase : product-dependent tax computation is broken :'(

 

Hello,

I have tested this issue with latest trunk on runbot but it can't be
reproduced from my side.

Thank you.
Saurang Suthar

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1059868

Title:
  purchase : product-dependent tax computation is broken :'(

Status in OpenERP Addons (modules):
  Confirmed

Bug description:
  On the current 6.1 branch.

  - Create a tax with :
      - computation based on Python code
      - applicability based on Python code
  - In the python_applicable field, enter anything using the "product". Example:  result=0.1*product.list_price
  - Create a product using this tax
  - Create a purchase order and try to save it :

  Traceback (most recent call last):
  (...)
    File "..../purchase/purchase.py", line 52, in _amount_all
  (...)
  AttributeError: 'int' object has no attribute 'list_price'

  There probably is the same problem with the partner_address_id

  
  In purchase/purchase.py:52
  Could you please replace :
  for c in self.pool.get('account.tax').compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty, order.partner_address_id.id, line.product_id.id, order.partner_id)['taxes']:
  with:
  for c in self.pool.get('account.tax').compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty, order.partner_address_id, line.product_id, order.partner_id)['taxes']:

  There are also unuseful "import time" and "import pooler" in the
  beginning (pyflakes report)

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1059868/+subscriptions


References