Merge lp:~openerp-dev/openobject-addons/trunk-bug-1217365-cod into lp:openobject-addons

Proposed by Chirag Dodiya(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1217365-cod
Merge into: lp:openobject-addons
Diff against target: 12 lines (+2/-0)
1 file modified
account_asset/account_asset.py (+2/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1217365-cod
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+199431@code.launchpad.net

Description of the change

Hello,

    I have fixed this bug, "assets - it must not be allowed to delete assets",in assets i improved code for that user cant delete active assets(assets in running state).

Thanks,
Chirag Dodiya(cod).

To post a comment you must log in.

Unmerged revisions

9019. By Chirag Dodiya(OpenERP)

[FIX] improved code to not be allowed to delete active assets

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_asset/account_asset.py'
2--- account_asset/account_asset.py 2013-10-27 12:31:04 +0000
3+++ account_asset/account_asset.py 2013-12-18 10:15:40 +0000
4@@ -77,6 +77,8 @@
5
6 def unlink(self, cr, uid, ids, context=None):
7 for asset in self.browse(cr, uid, ids, context=context):
8+ if asset.state == 'open':
9+ raise osv.except_osv(_('Error!'), _('You cannot delete an asset which is in running state.'))
10 if asset.account_move_line_ids:
11 raise osv.except_osv(_('Error!'), _('You cannot delete an asset that contains posted depreciation lines.'))
12 return super(account_asset_asset, self).unlink(cr, uid, ids, context=context)

Subscribers

People subscribed via source and target branches

to all changes: