Merge lp:~openerp-dev/openobject-addons/6.0-opw-575823-ado into lp:openobject-addons/6.0

Proposed by Amit Dodiya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-575823-ado
Merge into: lp:openobject-addons/6.0
Diff against target: 17 lines (+7/-0)
1 file modified
stock/stock.py (+7/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-575823-ado
Reviewer Review Type Date Requested Status
Numérigraphe (community) Approve
Olivier Dony (Odoo) Pending
Naresh(OpenERP) Pending
Review via email: mp+110044@code.launchpad.net

Description of the change

Hello,

"[FIX]: When duplicating the inventory it will also duplicate the stock move from privious inventory"

Steps:
1). Open any inventory which is in done state
2). Duplicate that inventory
You will find the stock move also duplicate in Posted Inventory Tab.

Code is backp-ported from stable 6.1

Regards,
Amit

To post a comment you must log in.
Revision history for this message
Numérigraphe (numerigraphe) wrote :

Looks fine.
Lionel

review: Approve

Unmerged revisions

5257. By Amit Dodiya<email address hidden>

[FIX]: When duplicating the inventory it will also duplicate the stock move from privious inventory

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-04-30 14:27:39 +0000
3+++ stock/stock.py 2012-06-13 11:32:58 +0000
4@@ -2548,6 +2548,13 @@
5 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.inventory', context=c)
6 }
7
8+ def copy(self, cr, uid, id, default=None, context=None):
9+ if default is None:
10+ default = {}
11+ default = default.copy()
12+ default.update({'move_ids': [], 'date_done': False})
13+ return super(stock_inventory, self).copy(cr, uid, id, default, context=context)
14+
15 def _inventory_line_hook(self, cr, uid, inventory_line, move_vals):
16 """ Creates a stock move from an inventory line
17 @param inventory_line: