← Back to team overview

openerp-india team mailing list archive

[Bug 995990] Re: account invoice report category not correct

 

** Description changed:

  The join between account_invoice_line and product_template is made as
  follow :
  
- left join product_template pt on (pt.id=pro.product_tmpl_id)
+ left join product_template pt on (pt.id=ail.product_id)
  
  The equivalence between template id and product id is only correct if no
  variant product (same template, different product) is or has been used
  on the database.
  
  As a result, the category of the product is wrong in the invoice
  analysis report.
  
  I included a patch that just modify the link in the view so that it
  takes the field product_tmpl_id from product_product instead of the
  product_id from account_invoice_line.
  
  ...
-                 from product_product as pro
-                 left join account_invoice_line as ail ON (ail.product_id = pro.id)
-                 left join account_invoice as ai ON (ai.id=ail.invoice_id)
-                 left join product_template pt on (pt.id=pro.product_tmpl_id)
-                 left join product_uom u on (u.id=ail.uos_id),
+                 from product_product as pro
+                 left join account_invoice_line as ail ON (ail.product_id = pro.id)
+                 left join account_invoice as ai ON (ai.id=ail.invoice_id)
+                 left join product_template pt on (pt.id=pro.product_tmpl_id)
+                 left join product_uom u on (u.id=ail.uos_id),
  ...
  
  Could you please resolve that ?
  
  Best regards

-- 
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/995990

Title:
  account invoice report category not correct

Status in OpenERP Addons (modules):
  New

Bug description:
  The join between account_invoice_line and product_template is made as
  follow :

  left join product_template pt on (pt.id=ail.product_id)

  The equivalence between template id and product id is only correct if
  no variant product (same template, different product) is or has been
  used on the database.

  As a result, the category of the product is wrong in the invoice
  analysis report.

  I included a patch that just modify the link in the view so that it
  takes the field product_tmpl_id from product_product instead of the
  product_id from account_invoice_line.

  ...
                  from product_product as pro
                  left join account_invoice_line as ail ON (ail.product_id = pro.id)
                  left join account_invoice as ai ON (ai.id=ail.invoice_id)
                  left join product_template pt on (pt.id=pro.product_tmpl_id)
                  left join product_uom u on (u.id=ail.uos_id),
  ...

  Could you please resolve that ?

  Best regards

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


References