Tejas Tank (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-1102612-tta into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #1102612 in OpenERP Addons: "[Trunk/7.0]Journals can not be deleted, even 
when they have no entries"
  https://bugs.launchpad.net/openobject-addons/+bug/1102612

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1102612-tta/+merge/144653

Hello,

Fixed Bug: 1102612

 * Journals can not be deleted, even when they have no entries.

 * Reported Bug: https://bugs.launchpad.net/openobject-addons/+bug/1102612


-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1102612-tta/+merge/144653
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-1102612-tta.
=== modified file 'account/account_cash_statement.py'
--- account/account_cash_statement.py	2012-12-17 15:23:03 +0000
+++ account/account_cash_statement.py	2013-01-24 09:13:24 +0000
@@ -335,6 +335,14 @@
     _defaults = {
         'cashbox_line_ids' : _default_cashbox_line_ids,
     }
+    
+    def unlink(self, cr, uid, ids, context=None, check=True):
+        for journal in self.browse(cr, uid, ids, context=context):
+            if journal.cashbox_line_ids:
+                raise osv.except_osv(_('User Error!'),
+                            _('You cannot remove an account that contains Cash Control items.')) 
+        result = super(account_journal, self).unlink(cr, uid, ids, context)
+        return result
 
 account_journal()
 

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : openerp-dev-gtk@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to