Merge lp:~openerp-dev/openobject-addons/6.0-bug-793468-rha1 into lp:openobject-addons/6.0

Proposed by Rifakat Husen (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-bug-793468-rha1
Merge into: lp:openobject-addons/6.0
Diff against target: 29 lines (+7/-1)
2 files modified
sale/sale.py (+6/-0)
sale/sale_workflow.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-bug-793468-rha1
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+72007@code.launchpad.net

Description of the change

Hello,

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

Regards,
Rifakat

To post a comment you must log in.

Unmerged revisions

4776. By Rifakat Husen (OpenERP)

[FIX] sale: fixed the problem for action_create_invoice() called two times

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sale/sale.py'
2--- sale/sale.py 2011-08-04 06:36:26 +0000
3+++ sale/sale.py 2011-08-18 09:03:28 +0000
4@@ -612,6 +612,12 @@
5 res.append(line.procurement_id.id)
6 return res
7
8+ def test_invoice(self, cr, uid, ids, *args):
9+ for order in self.browse(cr, uid, ids, context={}):
10+ if len(order.invoice_ids):
11+ return False
12+ return True
13+
14 # if mode == 'finished':
15 # returns True if all lines are done, False otherwise
16 # if mode == 'canceled':
17
18=== modified file 'sale/sale_workflow.xml'
19--- sale/sale_workflow.xml 2011-01-14 00:11:01 +0000
20+++ sale/sale_workflow.xml 2011-08-18 09:03:28 +0000
21@@ -172,7 +172,7 @@
22 <record id="trans_wait_invoice_invoice" model="workflow.transition">
23 <field name="act_from" ref="act_wait_invoice"/>
24 <field name="act_to" ref="act_invoice"/>
25- <field name="condition">(order_policy=='prepaid') or ((order_policy=='postpaid') and shipped)</field>
26+ <field name="condition">(order_policy=='prepaid') or ((order_policy=='postpaid') and shipped and test_invoice())</field>
27 </record>
28
29 <record id="trans_wait_invoice_invoice_manual" model="workflow.transition">