Merge lp:~openerp-dev/openobject-addons/trunk-bug-999756-amp into lp:openobject-addons

Proposed by Amit Parik
Status: Work in progress
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-999756-amp
Merge into: lp:openobject-addons
Diff against target: 31 lines (+10/-1)
2 files modified
account/account_invoice.py (+8/-0)
account/account_invoice_workflow.xml (+2/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-999756-amp
Reviewer Review Type Date Requested Status
Mustufa Rangwala (Open ERP) (community) Needs Fixing
Review via email: mp+105936@code.launchpad.net

Description of the change

Hello,

As per my opinion we should be check the invoice line on proforma button(state). If there is no invoice line we should not allow to proforma it.

For proper use case see my comment on bug#999756.

Thank you!

To post a comment you must log in.
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

No need to write else inside that proforma_check_invoice_line method. I am not sure about updating workflow of invoice for that purpose.

Thanks,
Mustufa

review: Needs Fixing

Unmerged revisions

6795. By Amit Parik

[FIX] account : Check invoice line on proforma button

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_invoice.py'
2--- account/account_invoice.py 2012-05-08 08:45:49 +0000
3+++ account/account_invoice.py 2012-05-16 07:18:24 +0000
4@@ -778,6 +778,14 @@
5 for key, val in line2.items():
6 line.append((0,0,val))
7 return line
8+
9+ def proforma_check_invoice_line(self, cr, uid, ids, context=None):
10+ for inv in self.browse(cr, uid, ids, context=context):
11+ if not inv.invoice_line:
12+ raise osv.except_osv(_('No Invoice Lines !'), _('Please create some invoice lines.'))
13+ else:
14+ return True
15+ return True
16
17 def action_move_create(self, cr, uid, ids, context=None):
18 """Creates invoice related analytics and financial move lines"""
19
20=== modified file 'account/account_invoice_workflow.xml'
21--- account/account_invoice_workflow.xml 2012-03-19 10:38:23 +0000
22+++ account/account_invoice_workflow.xml 2012-05-16 07:18:24 +0000
23@@ -17,7 +17,8 @@
24 <record id="act_proforma2" model="workflow.activity">
25 <field name="wkf_id" ref="wkf"/>
26 <field name="name">proforma2</field>
27- <field name="action">write({'state':'proforma2'})</field>
28+ <field name="action">write({'state':'proforma2'})
29+proforma_check_invoice_line()</field>
30 <field name="kind">function</field>
31 </record>
32

Subscribers

People subscribed via source and target branches

to all changes: