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
=== modified file 'account_asset/account_asset.py'
--- account_asset/account_asset.py 2013-10-27 12:31:04 +0000
+++ account_asset/account_asset.py 2013-12-18 10:15:40 +0000
@@ -77,6 +77,8 @@
7777
78 def unlink(self, cr, uid, ids, context=None):78 def unlink(self, cr, uid, ids, context=None):
79 for asset in self.browse(cr, uid, ids, context=context):79 for asset in self.browse(cr, uid, ids, context=context):
80 if asset.state == 'open':
81 raise osv.except_osv(_('Error!'), _('You cannot delete an asset which is in running state.'))
80 if asset.account_move_line_ids: 82 if asset.account_move_line_ids:
81 raise osv.except_osv(_('Error!'), _('You cannot delete an asset that contains posted depreciation lines.'))83 raise osv.except_osv(_('Error!'), _('You cannot delete an asset that contains posted depreciation lines.'))
82 return super(account_asset_asset, self).unlink(cr, uid, ids, context=context)84 return super(account_asset_asset, self).unlink(cr, uid, ids, context=context)

Subscribers

People subscribed via source and target branches

to all changes: