Merge lp:~openerp-dev/openobject-addons/trunk-bug-1155793-nco into lp:openobject-addons

Proposed by Nimesh Contractor(Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1155793-nco
Merge into: lp:openobject-addons
Diff against target: 45 lines (+11/-0)
3 files modified
account/account.py (+5/-0)
account/res_config.py (+2/-0)
account/res_config_view.xml (+4/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1155793-nco
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+165971@code.launchpad.net

Description of the change

Hello,

Set "Allows canceling entries" feature in setting -> accounting configuration.

When cancel journal entry, and account_cancel module is not install then it raise the message to set "Allow cancelling entries".

Thank You.

To post a comment you must log in.

Unmerged revisions

8727. By Nimesh Contractor(Open ERP)

[FIX] set account cancel in accoting configration set the proper error message.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account.py'
2--- account/account.py 2013-04-29 15:14:10 +0000
3+++ account/account.py 2013-05-28 07:02:38 +0000
4@@ -1339,8 +1339,13 @@
5 return self.post(cursor, user, ids, context=context)
6
7 def button_cancel(self, cr, uid, ids, context=None):
8+ module = self.pool.get('ir.module.module')
9 for line in self.browse(cr, uid, ids, context=context):
10 if not line.journal_id.update_posted:
11+ module_account_cancel = module.search(cr, uid, [('name', '=', 'account_cancel'), ('state', '=', 'installed')])
12+ if not module_account_cancel:
13+ raise osv.except_osv(_('Error!'), _('You cannot modify a posted entry of this journal.\nGo to Settings -> Configuration -> Accounting -> Features -> Set Allow cancelling entries.'))
14+
15 raise osv.except_osv(_('Error!'), _('You cannot modify a posted entry of this journal.\nFirst you should set the journal to allow cancelling entries.'))
16 if ids:
17 cr.execute('UPDATE account_move '\
18
19=== modified file 'account/res_config.py'
20--- account/res_config.py 2013-05-08 13:14:38 +0000
21+++ account/res_config.py 2013-05-28 07:02:38 +0000
22@@ -100,6 +100,8 @@
23 * serve as base for an easy plug-in of various automated payment mechanisms, and
24 * provide a more efficient way to manage invoice payments.
25 This installs the module account_payment."""),
26+ 'module_account_cancel': fields.boolean('Allow cancelling entries',
27+ help="""This allows you to cancel accounting entries"""),
28 'module_account_voucher': fields.boolean('Manage customer payments',
29 help="""This includes all the basic requirements of voucher entries for bank, cash, sales, purchase, expense, contra, etc.
30 This installs the module account_voucher."""),
31
32=== modified file 'account/res_config_view.xml'
33--- account/res_config_view.xml 2013-02-13 16:41:57 +0000
34+++ account/res_config_view.xml 2013-05-28 07:02:38 +0000
35@@ -141,6 +141,10 @@
36 <field name="module_account_budget" class="oe_inline"/>
37 <label for="module_account_budget"/>
38 </div>
39+ <div>
40+ <field name="module_account_cancel" class="oe_inline"/>
41+ <label for="module_account_cancel"/>
42+ </div>
43 </div>
44 </group>
45 <separator string="eInvoicing &amp; Payments"/>

Subscribers

People subscribed via source and target branches

to all changes: