Pankita Shah(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-1080651-shp into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1080651-shp/+merge/136369

Hello,

 -  i have fixed problem of physical inventory. which is deleted when it is in 
confirm and done state.
    solve this problem add constraint on state field

thanks

shp 

-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1080651-shp/+merge/136369
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-1080651-shp.
=== modified file 'stock/stock.py'
--- stock/stock.py	2012-11-26 18:28:11 +0000
+++ stock/stock.py	2012-11-27 11:19:23 +0000
@@ -2829,6 +2829,12 @@
         'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.inventory', context=c)
     }
 
+    def unlink(self, cr, uid, ids, context=None):
+        for t in self.read(cr, uid, ids, ['state'], context=context):
+            if t['state'] not in ('draft', 'cancel'):
+                raise osv.except_osv(_('Invalid Action!'), _('Cannot delete physical inventories which are already confirmed or done.'))
+        return super(stock_inventory, self).unlink(cr, uid, ids, context=context)
+
     def copy(self, cr, uid, id, default=None, context=None):
         if default is None:
             default = {}

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to