[FIX] Stock : Partial Picking wizard was making the back order reference jump to 2 numbers,notification given on packing done.

lp bug: https://launchpad.net/bugs/379118 fixed

bzr revid: jvo@tinyerp.com-20091022074436-20u01i4vye2jk7l8
This commit is contained in:
Jay (Open ERP)
2009-10-22 13:14:36 +05:30
parent 4c63801b0d
commit 28bd548716
2 changed files with 17 additions and 5 deletions
+2 -1
View File
@@ -467,7 +467,8 @@ class stock_picking(osv.osv):
if default is None:
default = {}
default = default.copy()
default['name'] = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking')
if not default.get('name',False):
default['name'] = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking')
return super(stock_picking, self).copy(cr, uid, id, default, context)
def onchange_partner_in(self, cr, uid, context, partner_id=None):
+15 -4
View File
@@ -27,6 +27,7 @@ import pooler
import wizard
from osv import osv
import tools
_moves_arch = UpdateableStr()
_moves_fields = UpdateableDict()
@@ -34,8 +35,11 @@ _moves_fields = UpdateableDict()
_moves_arch_end = '''<?xml version="1.0"?>
<form string="Packing result">
<label string="The packing has been successfully made !" colspan="4"/>
<field name="back_order_notification" colspan="4" nolabel="1"/>
</form>'''
_moves_fields_end = {}
_moves_fields_end = {
'back_order_notification': {'string':'Back Order' ,'type':'text', 'readonly':True}
}
def make_default(val):
def fct(uid, data, state):
@@ -198,8 +202,15 @@ def _do_split(self, cr, uid, data, context):
else:
pick_obj.action_move(cr, uid, [pick.id])
wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_done', cr)
return {'new_picking':new_picking or False}
bo_name = ''
if new_picking:
bo_name = pick_obj.read(cr, uid, [new_picking], ['name'])[0]['name']
return {'new_picking':new_picking or False, 'back_order':bo_name}
def _get_default(self, cr, uid, data, context):
if data['form']['back_order']:
data['form']['back_order_notification'] = 'Back Order ' + tools.ustr(data['form']['back_order']) + ' Assigned to this Packing.'
return data['form']
class partial_picking(wizard.interface):
@@ -215,10 +226,10 @@ class partial_picking(wizard.interface):
},
'split': {
'actions': [ _do_split ],
'result': {'type': 'state', 'state': 'end'},
'result': {'type': 'state', 'state': 'end2'},
},
'end2': {
'actions': [ ],
'actions': [ _get_default ],
'result': {'type': 'form', 'arch': _moves_arch_end,
'fields': _moves_fields_end,
'state': (