Rifakat (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-bug-793468-rha1 into 
lp:openobject-addons/6.0.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-bug-793468-rha1/+merge/72007

Hello,

This fix solves the problem for calling action_create_invoice() two times while 
sale and mrp modules are installed.

Regards,
Rifakat
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-bug-793468-rha1/+merge/72007
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-bug-793468-rha1.
=== modified file 'sale/sale.py'
--- sale/sale.py	2011-08-04 06:36:26 +0000
+++ sale/sale.py	2011-08-18 09:03:28 +0000
@@ -612,6 +612,12 @@
                     res.append(line.procurement_id.id)
         return res
 
+    def test_invoice(self, cr, uid, ids, *args):
+        for order in self.browse(cr, uid, ids, context={}):
+            if len(order.invoice_ids):
+                return False
+        return True
+
     # if mode == 'finished':
     #   returns True if all lines are done, False otherwise
     # if mode == 'canceled':

=== modified file 'sale/sale_workflow.xml'
--- sale/sale_workflow.xml	2011-01-14 00:11:01 +0000
+++ sale/sale_workflow.xml	2011-08-18 09:03:28 +0000
@@ -172,7 +172,7 @@
         <record id="trans_wait_invoice_invoice" model="workflow.transition">
             <field name="act_from" ref="act_wait_invoice"/>
             <field name="act_to" ref="act_invoice"/>
-            <field name="condition">(order_policy=='prepaid') or ((order_policy=='postpaid') and shipped)</field>
+            <field name="condition">(order_policy=='prepaid') or ((order_policy=='postpaid') and shipped and test_invoice())</field>
         </record>
 
         <record id="trans_wait_invoice_invoice_manual" model="workflow.transition">

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to