Rifakat (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-580795-production_lot-rha into 
lp:openobject-addons/6.0.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)
Related bugs:
  Bug #1067365 in OpenERP Addons: "copying production lot copies its stock 
moves, creation date and revisions"
  https://bugs.launchpad.net/openobject-addons/+bug/1067365

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-580795-production_lot-rha/+merge/131871

Hello,

Duplication of Production Lot also duplicates its Creation Date, Stock Moves
and Revisions.

Creation Date should be current date, Stock Moves and Revisions should be reset
when we duplicate it, those information should not be copied.

Thanks for your review,
Rifakat Haradwala
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-580795-production_lot-rha/+merge/131871
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-580795-production_lot-rha.
=== modified file 'stock/stock.py'
--- stock/stock.py	2012-08-17 07:46:56 +0000
+++ stock/stock.py	2012-10-29 11:53:20 +0000
@@ -1443,6 +1443,16 @@
         """
         value = self.pool.get('action.traceability').action_traceability(cr,uid,ids,context)
         return value
+    
+    def copy(self, cr, uid, id, default=None, context=None):
+        if context is None: context = {}
+        if default is None:
+            default = {}
+        else:
+            default = default.copy()
+        default.update(date=time.strftime('%Y-%m-%d %H:%M:%S'), revisions=[], move_ids=[])     
+        return super(stock_production_lot, self).copy(cr, uid, id, default=default, context=context)
+    
 stock_production_lot()
 
 class stock_production_lot_revision(osv.osv):

_______________________________________________
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