Merge lp:~openerp-dev/openobject-addons/trunk-account_modify-aag into lp:openobject-addons

Proposed by Atik Agewan(OpenERP)
Status: Merged
Merged at revision: 4577
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-account_modify-aag
Merge into: lp:openobject-addons
Diff against target: 19 lines (+3/-3)
1 file modified
account/invoice.py (+3/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-account_modify-aag
Reviewer Review Type Date Requested Status
Rucha (Open ERP) (community) Approve
qdp (OpenERP) Pending
Review via email: mp+53430@code.launchpad.net

Description of the change

Account: Now we can restrict the deletion of account.invoice if it has a number

To post a comment you must log in.
Revision history for this message
Rucha (Open ERP) (rpa-openerp) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/invoice.py'
2--- account/invoice.py 2011-03-07 06:12:02 +0000
3+++ account/invoice.py 2011-03-15 12:53:30 +0000
4@@ -362,13 +362,13 @@
5 def unlink(self, cr, uid, ids, context=None):
6 if context is None:
7 context = {}
8- invoices = self.read(cr, uid, ids, ['state'], context=context)
9+ invoices = self.read(cr, uid, ids, ['state','internal_number'], context=context)
10 unlink_ids = []
11 for t in invoices:
12- if t['state'] in ('draft', 'cancel'):
13+ if t['state'] in ('draft', 'cancel') and t['internal_number']== False:
14 unlink_ids.append(t['id'])
15 else:
16- raise osv.except_osv(_('Invalid action !'), _('Cannot delete invoice(s) that are already opened or paid !'))
17+ raise osv.except_osv(_('Invalid action !'), _('Cannot delete invoice(s) that are already opened(or been in opened state ever) or paid!'))
18 osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
19 return True
20

Subscribers

People subscribed via source and target branches

to all changes: