← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 661653] [NEW] [V5] sale/sale.py _invoiced_search returns wrong results for "unpaid"

 

Public bug reported:

searching for 'unpaid' also returns canceled invoices which makes no
sense

(the attached patch might be rejected, due to the fact that my chricar
branch - sale.py is heavily modified)

     def _invoiced_search(self, cursor, user, obj, name, args, context):
@@ -221,7 +231,7 @@
                 if arg[2]:
                     clause += 'AND inv.state = \'paid\''
                 else:
-                    clause += 'AND inv.state <> \'paid\''
+                    clause += 'AND inv.state not in ( \'paid\',\'cancel\')'
                     no_invoiced = True
         cursor.execute('SELECT rel.order_id ' \
                 'FROM sale_order_invoice_rel AS rel, account_invoice AS inv ' \

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
[V5] sale/sale.py _invoiced_search returns wrong results for "unpaid"
https://bugs.launchpad.net/bugs/661653
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP OpenObject.

Status in OpenObject Addons Modules: New

Bug description:
searching for 'unpaid' also returns canceled invoices which makes no sense

(the attached patch might be rejected, due to the fact that my chricar branch - sale.py is heavily modified)

     def _invoiced_search(self, cursor, user, obj, name, args, context):
@@ -221,7 +231,7 @@
                 if arg[2]:
                     clause += 'AND inv.state = \'paid\''
                 else:
-                    clause += 'AND inv.state <> \'paid\''
+                    clause += 'AND inv.state not in ( \'paid\',\'cancel\')'
                     no_invoiced = True
         cursor.execute('SELECT rel.order_id ' \
                 'FROM sale_order_invoice_rel AS rel, account_invoice AS inv ' \





Follow ups

References