Merge lp:~openerp-dev/openobject-addons/6.0-opw-580795-rha1 into lp:openobject-addons/6.0

Proposed by Rifakat Husen (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-580795-rha1
Merge into: lp:openobject-addons/6.0
Diff against target: 20 lines (+10/-0)
1 file modified
stock/stock.py (+10/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-580795-rha1
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+142238@code.launchpad.net

Description of the change

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

To post a comment you must log in.

Unmerged revisions

5409. By Rifakat Husen (OpenERP)

[FIX] stock: Duplication of production Lot also duplicates its Creation Date, Stock Moves

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/stock.py'
2--- stock/stock.py 2012-08-17 07:46:56 +0000
3+++ stock/stock.py 2013-01-08 05:44:22 +0000
4@@ -1443,6 +1443,16 @@
5 """
6 value = self.pool.get('action.traceability').action_traceability(cr,uid,ids,context)
7 return value
8+
9+ def copy(self, cr, uid, id, default=None, context=None):
10+ if context is None: context = {}
11+ if default is None:
12+ default = {}
13+ else:
14+ default = default.copy()
15+ default.update(date=time.strftime('%Y-%m-%d %H:%M:%S'), revisions=[], move_ids=[])
16+ return super(stock_production_lot, self).copy(cr, uid, id, default=default, context=context)
17+
18 stock_production_lot()
19
20 class stock_production_lot_revision(osv.osv):