diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 5c4de25465c..b93afede487 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -44,11 +44,17 @@ class account_move_line(osv.osv): fiscalyear_clause = (','.join([str(x) for x in fiscalyear_ids])) or '0' else: fiscalyear_clause = '%s' % context['fiscalyear'] + state=context.get('state',False) + where_move_state='' + if state: + if state.lower() not in ['all']: + where_move_state= " AND "+obj+".move_id in (select id from account_move where account_move.state = '"+state+"')" + if context.get('periods', False): - ids = ','.join([str(x) for x in context['periods']]) - return obj+".active AND "+obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) AND id in (%s))" % (fiscalyear_clause, ids) + ids = ','.join([str(x) for x in context['periods']]) + return obj+".active AND "+obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) AND id in (%s)) %s" % (fiscalyear_clause, ids,where_move_state) else: - return obj+".active AND "+obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s))" % (fiscalyear_clause,) + return obj+".active AND "+obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id in (%s) %s)" % (fiscalyear_clause,where_move_state) def default_get(self, cr, uid, fields, context={}): data = self._default_get(cr, uid, fields, context) diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index 9ffb5b0d588..4927fc32945 100644 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -87,6 +87,7 @@ class account_balance(report_sxw.rml_parse): ctx['fiscalyear'] = form['fiscalyear'] ctx['periods'] = form['periods'][0][2] ctx['target_move'] = form['target_move'] + ctx['state']=form['state'] accounts = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx) def cmp_code(x, y): return cmp(x.code, y.code) diff --git a/addons/account/report/aged_trial_balance.py b/addons/account/report/aged_trial_balance.py index 6017342b7bf..78187c703b9 100644 --- a/addons/account/report/aged_trial_balance.py +++ b/addons/account/report/aged_trial_balance.py @@ -53,7 +53,7 @@ class aged_trial_report(report_sxw.rml_parse): res = [] account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='line', - context={'fiscalyear': form['fiscalyear']}) + context={'fiscalyear': form['fiscalyear'],'state':form['state']}) self.cr.execute("SELECT DISTINCT res_partner.id AS id, " \ "res_partner.name AS name, res_partner.ref AS code " \ "FROM res_partner, account_move_line AS line, account_account " \ @@ -128,7 +128,7 @@ class aged_trial_report(report_sxw.rml_parse): def _get_total(self, fiscalyear, company_id): account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='line', - context={'fiscalyear': fiscalyear}) + context={'fiscalyear': fiscalyear,'state':self.datas['form']['state']}) self.cr.execute("SELECT SUM(debit - credit) " \ "FROM account_move_line AS line, account_account " \ "WHERE (line.account_id = account_account.id) " \ @@ -145,7 +145,7 @@ class aged_trial_report(report_sxw.rml_parse): def _get_before(self, date, fiscalyear, company_id): account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='line', - context={'fiscalyear': fiscalyear}) + context={'fiscalyear': fiscalyear,'state':self.datas['form']['state']}) self.cr.execute("SELECT SUM(debit - credit) " \ "FROM account_move_line AS line, account_account " \ "WHERE (line.account_id = account_account.id) " \ @@ -163,7 +163,7 @@ class aged_trial_report(report_sxw.rml_parse): def _get_for_period(self, period, fiscalyear, company_id): account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='line', - context={'fiscalyear': fiscalyear}) + context={'fiscalyear': fiscalyear,'state':self.datas['form']['state']}) self.cr.execute("SELECT SUM(debit - credit) " \ "FROM account_move_line AS line, account_account " \ "WHERE (line.account_id = account_account.id) " \ diff --git a/addons/account/report/general_ledger.py b/addons/account/report/general_ledger.py index 300a16c7ca7..90a787ab245 100644 --- a/addons/account/report/general_ledger.py +++ b/addons/account/report/general_ledger.py @@ -107,6 +107,7 @@ class general_ledger(report_sxw.rml_parse): ctx = self.context.copy() ctx['fiscalyear'] = form['fiscalyear'] ctx['periods'] = form['periods'][0][2] + ctx['state']=form['state'] query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx) self.cr.execute("SELECT l.date, j.code, l.ref, l.name, l.debit, l.credit "\ "FROM account_move_line l, account_journal j "\ @@ -126,6 +127,7 @@ class general_ledger(report_sxw.rml_parse): ctx = self.context.copy() ctx['fiscalyear'] = form['fiscalyear'] ctx['periods'] = form['periods'][0][2] + ctx['state']=form['state'] query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx) self.cr.execute("SELECT sum(debit) "\ "FROM account_move_line l "\ @@ -136,6 +138,7 @@ class general_ledger(report_sxw.rml_parse): ctx = self.context.copy() ctx['fiscalyear'] = form['fiscalyear'] ctx['periods'] = form['periods'][0][2] + ctx['state']=form['state'] query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx) self.cr.execute("SELECT sum(credit) "\ "FROM account_move_line l "\ @@ -148,6 +151,7 @@ class general_ledger(report_sxw.rml_parse): ctx = self.context.copy() ctx['fiscalyear'] = form['fiscalyear'] ctx['periods'] = form['periods'][0][2] + ctx['state']=form['state'] query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx) self.cr.execute("SELECT sum(debit) "\ "FROM account_move_line l "\ @@ -161,6 +165,7 @@ class general_ledger(report_sxw.rml_parse): ctx = self.context.copy() ctx['fiscalyear'] = form['fiscalyear'] ctx['periods'] = form['periods'][0][2] + ctx['state']=form['state'] query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx) self.cr.execute("SELECT sum(credit) "\ "FROM account_move_line l "\ diff --git a/addons/account/report/partner_balance.py b/addons/account/report/partner_balance.py index e6c65380737..912e8396ef2 100644 --- a/addons/account/report/partner_balance.py +++ b/addons/account/report/partner_balance.py @@ -82,7 +82,7 @@ class partner_balance(report_sxw.rml_parse): return [] account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='l', - context={'fiscalyear': self.datas['form']['fiscalyear']}) + context={'fiscalyear': self.datas['form']['fiscalyear'],'state':self.datas['form']['state']}) self.cr.execute( "SELECT p.ref, p.name, sum(debit) as debit, sum(credit) as credit, " \ "CASE WHEN sum(debit) > sum(credit) " \ @@ -120,7 +120,7 @@ class partner_balance(report_sxw.rml_parse): account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='account_move_line', - context={'fiscalyear': self.datas['form']['fiscalyear']}) + context={'fiscalyear': self.datas['form']['fiscalyear'],'state':self.datas['form']['state']}) self.cr.execute( 'SELECT sum(debit) ' \ 'FROM account_move_line ' \ @@ -138,7 +138,7 @@ class partner_balance(report_sxw.rml_parse): account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='account_move_line', - context={'fiscalyear': self.datas['form']['fiscalyear']}) + context={'fiscalyear': self.datas['form']['fiscalyear'],'state':self.datas['form']['state']}) self.cr.execute( 'SELECT sum(credit) ' \ 'FROM account_move_line ' \ @@ -156,7 +156,7 @@ class partner_balance(report_sxw.rml_parse): account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='account_move_line', - context={'fiscalyear': self.datas['form']['fiscalyear']}) + context={'fiscalyear': self.datas['form']['fiscalyear'],'state':self.datas['form']['state']}) self.cr.execute( 'SELECT sum(debit-credit) ' \ 'FROM account_move_line ' \ @@ -175,7 +175,7 @@ class partner_balance(report_sxw.rml_parse): account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='account_move_line', - context={'fiscalyear': self.datas['form']['fiscalyear']}) + context={'fiscalyear': self.datas['form']['fiscalyear'],'state':self.datas['form']['state']}) self.cr.execute( 'SELECT CASE WHEN sum(debit) > sum(credit) ' \ 'THEN sum(debit - credit) ' \ @@ -197,7 +197,7 @@ class partner_balance(report_sxw.rml_parse): account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='account_move_line', - context={'fiscalyear': self.datas['form']['fiscalyear']}) + context={'fiscalyear': self.datas['form']['fiscalyear'],'state':self.datas['form']['state']}) self.cr.execute( 'SELECT CASE WHEN sum(debit) < sum(credit) ' \ 'THEN sum(credit - debit) ' \ diff --git a/addons/account/report/third_party_ledger.py b/addons/account/report/third_party_ledger.py index 79bc6d4cc86..bf060555e7e 100644 --- a/addons/account/report/third_party_ledger.py +++ b/addons/account/report/third_party_ledger.py @@ -49,7 +49,7 @@ class third_party_ledger(report_sxw.rml_parse): def preprocess(self, objects, data, ids): account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='line', - context={'fiscalyear': data['form']['fiscalyear']}) + context={'fiscalyear': data['form']['fiscalyear'],'state':data['form']['state']}) self.cr.execute( "SELECT DISTINCT line.partner_id " \ "FROM account_move_line AS line, account_account AS account " \ @@ -79,7 +79,7 @@ class third_party_ledger(report_sxw.rml_parse): def lines(self, partner): account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='l', - context={'fiscalyear': self.datas['form']['fiscalyear']}) + context={'fiscalyear': self.datas['form']['fiscalyear'],'state':self.datas['form']['state']}) self.cr.execute( "SELECT l.date, j.code, l.ref, l.name, l.debit, l.credit " \ "FROM account_move_line l " \ @@ -103,7 +103,7 @@ class third_party_ledger(report_sxw.rml_parse): account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='account_move_line', - context={'fiscalyear': self.datas['form']['fiscalyear']}) + context={'fiscalyear': self.datas['form']['fiscalyear'],'state':self.datas['form']['state']}) self.cr.execute( "SELECT sum(debit) " \ "FROM account_move_line " \ @@ -119,7 +119,7 @@ class third_party_ledger(report_sxw.rml_parse): account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='account_move_line', - context={'fiscalyear': self.datas['form']['fiscalyear']}) + context={'fiscalyear': self.datas['form']['fiscalyear'],'state':self.datas['form']['state']}) self.cr.execute( "SELECT sum(credit) " \ "FROM account_move_line " \ @@ -137,7 +137,7 @@ class third_party_ledger(report_sxw.rml_parse): account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='account_move_line', - context={'fiscalyear': self.datas['form']['fiscalyear']}) + context={'fiscalyear': self.datas['form']['fiscalyear'],'state':self.datas['form']['state']}) self.cr.execute( "SELECT sum(debit) " \ "FROM account_move_line " \ @@ -155,7 +155,7 @@ class third_party_ledger(report_sxw.rml_parse): account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') line_query = account_move_line_obj._query_get(self.cr, self.uid, obj='account_move_line', - context={'fiscalyear': self.datas['form']['fiscalyear']}) + context={'fiscalyear': self.datas['form']['fiscalyear'],'state':self.datas['form']['state']}) self.cr.execute( "SELECT sum(credit) " \ "FROM account_move_line " \ diff --git a/addons/account/wizard/wizard_account_balance_report.py b/addons/account/wizard/wizard_account_balance_report.py index 09bc80ad523..a36dda780e8 100644 --- a/addons/account/wizard/wizard_account_balance_report.py +++ b/addons/account/wizard/wizard_account_balance_report.py @@ -35,12 +35,14 @@ dates_form = '''
+ ''' dates_fields = { 'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear', 'help': 'Keep empty for all open fiscal year'}, - 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'} + 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'}, + 'state':{'string':'State','type':'selection','selection': [('draft','Draft'), ('posted','Posted'),('all','All')],} } class wizard_report(wizard.interface): @@ -48,6 +50,7 @@ class wizard_report(wizard.interface): fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear') data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid) data['form']['target_move'] = False + data['form']['state']='all' if context.has_key('target_move'): data['form']['target_move'] = context['target_move'] return data['form'] diff --git a/addons/account/wizard/wizard_aged_trial_balance.py b/addons/account/wizard/wizard_aged_trial_balance.py index 51ea5c1384f..ec00fabcaee 100644 --- a/addons/account/wizard/wizard_aged_trial_balance.py +++ b/addons/account/wizard/wizard_aged_trial_balance.py @@ -47,6 +47,8 @@ _aged_trial_form = """ + + """ _aged_trial_fields = { @@ -55,7 +57,8 @@ _aged_trial_fields = { 'help': 'Keep empty for all open fiscal year'}, 'period_length': {'string': 'Period length (days)', 'type': 'integer', 'required': True, 'default': lambda *a:30}, 'sorting_on':{'string': 'Sorting On', 'type': 'selection', 'selection': [('partner','By Partner Name (asc)'), ('amount','By Amount (desc)')],'required': True, 'default': lambda *a:'partner'}, - 'computation':{'string': 'Computational Method', 'type': 'selection', 'selection': [("\'receivable\'",'On Receivables Only'), ("\'payable\'",'On Payables Only'), ("\'receivable\',\'payable\'",'On Receivables & Payables')], 'required': True, 'default': lambda *a:"\'receivable\'"} + 'computation':{'string': 'Computational Method', 'type': 'selection', 'selection': [("\'receivable\'",'On Receivables Only'), ("\'payable\'",'On Payables Only'), ("\'receivable\',\'payable\'",'On Receivables & Payables')], 'required': True, 'default': lambda *a:"\'receivable\'"}, + 'state':{'string':'State','type':'selection','selection': [('draft','Draft'), ('posted','Posted'),('all','All')],} } def _calc_dates(self, cr, uid, data, context): @@ -85,7 +88,7 @@ class wizard_report(wizard.interface): else: company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0] data['form']['company_id'] = company_id - + data['form']['state']='all' return data['form'] diff --git a/addons/account/wizard/wizard_general_ledger_report.py b/addons/account/wizard/wizard_general_ledger_report.py index edfe0001f3d..42bde367b84 100644 --- a/addons/account/wizard/wizard_general_ledger_report.py +++ b/addons/account/wizard/wizard_general_ledger_report.py @@ -35,18 +35,21 @@ dates_form = '''
+ ''' dates_fields = { 'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear', 'help': 'Keep empty for all open fiscal year'}, - 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'} + 'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'}, + 'state':{'string':'State','type':'selection','selection': [('draft','Draft'), ('posted','Posted'),('all','All')],} } class wizard_report(wizard.interface): def _get_defaults(self, cr, uid, data, context): fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear') data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid) + data['form']['state']='all' return data['form'] states = { diff --git a/addons/account/wizard/wizard_partner_balance_report.py b/addons/account/wizard/wizard_partner_balance_report.py index 13d32a3ad24..fea210cafa4 100644 --- a/addons/account/wizard/wizard_partner_balance_report.py +++ b/addons/account/wizard/wizard_partner_balance_report.py @@ -36,10 +36,12 @@ dates_form = '''
- + + + ''' dates_fields = { @@ -48,6 +50,7 @@ dates_fields = { 'help': 'Keep empty for all open fiscal year'}, 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, + 'state':{'string':'State','type':'selection','selection': [('draft','Draft'), ('posted','Posted'),('all','All')],} } class wizard_report(wizard.interface): @@ -61,6 +64,7 @@ class wizard_report(wizard.interface): else: company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0] data['form']['company_id'] = company_id + data['form']['state']='all' return data['form'] diff --git a/addons/account/wizard/wizard_third_party_ledger.py b/addons/account/wizard/wizard_third_party_ledger.py index df7f9c39b54..bcea02e7bda 100644 --- a/addons/account/wizard/wizard_third_party_ledger.py +++ b/addons/account/wizard/wizard_third_party_ledger.py @@ -39,6 +39,8 @@ dates_form = ''' + + ''' dates_fields = { @@ -47,6 +49,7 @@ dates_fields = { 'help': 'Keep empty for all open fiscal year'}, 'date1': {'string':'Start of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-01-01')}, 'date2': {'string':'End of period', 'type':'date', 'required':True, 'default': lambda *a: time.strftime('%Y-%m-%d')}, + 'state':{'string':'State','type':'selection','selection': [('draft','Draft'), ('posted','Posted'),('all','All')],} } class wizard_report(wizard.interface): @@ -60,7 +63,7 @@ class wizard_report(wizard.interface): else: company_id = pooler.get_pool(cr.dbname).get('res.company').search(cr, uid, [('parent_id', '=', False)])[0] data['form']['company_id'] = company_id - + data['form']['state']='all' return data['form'] states = { diff --git a/addons/product/product.py b/addons/product/product.py index 557ae8d5728..77878dcfb93 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -414,6 +414,16 @@ class product_product(osv.osv): 'price_margin': fields.float('Price Margin', digits=(16, int(config['price_accuracy']))), } + def onchange_uom(self, cursor, user, ids, uom_id,uom_po_id): + if uom_id and uom_po_id: + uom_obj=self.pool.get('product.uom') + uom=uom_obj.browse(cursor,user,[uom_id])[0] + uom_po=uom_obj.browse(cursor,user,[uom_po_id])[0] + print uom.category_id.id , uom_po.category_id.id + if uom.category_id.id != uom_po.category_id.id: + return {'value': {'uom_po_id': uom_id}} + return False + def _check_ean_key(self, cr, uid, ids): for partner in self.browse(cr, uid, ids): if not partner.ean13: diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 602714a8374..5b3bdbd279a 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -46,7 +46,7 @@ - + diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 25c85c316ea..81d152c07df 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1185,5 +1185,61 @@ class product_product(osv.osv): } product_product() +# Move wizard : +# get confirm or assign stock move lines of partner and put in current picking. +class stock_picking_move_wizard(osv.osv_memory): + _name='stock.picking.move.wizard' + def _get_picking(self,cr, uid, ctx): + if 'action_id' in ctx: + return ctx['action_id'] + return False + def _get_move_lines(self,cr,uid,ctx): + move_obj=self.pool.get('stock.move') + picking_obj=self.pool.get('stock.picking') + if 'action_id' in ctx: + picking=picking_obj.browse(cr,uid,[ctx['action_id']]) + if picking and len(picking): + move_line_ids=move_obj.search(cr,uid,[('state','in',['confirmed','assigned']),('address_id','=',picking[0].address_id.id)]) + move_lines=move_obj.read(cr,uid,move_line_ids) + #res=[] + #for move_line in move_lines: + # res.append((0,0,move_line)) + return [{'move_ids':(0,0,move_lines)}] + return [] + def _get_picking_address(self,cr,uid,ctx): + picking_obj=self.pool.get('stock.picking') + if 'action_id' in ctx: + picking=picking_obj.browse(cr,uid,[ctx['action_id']])[0] + return picking.address_id and picking.address_id.id + return False + + + _columns={ + 'name':fields.char('Name',size=64,invisible=True), + #'move_lines': fields.one2many('stock.move', 'picking_id', 'Move lines',readonly=True), + 'move_ids': fields.many2many('stock.move', 'picking_move_wizard_rel', 'picking_move_wizard_id', 'move_id', 'Move lines'), + 'address_id' : fields.many2one('res.partner.address', 'Dest. Address',invisible=True), + 'picking_id': fields.many2one('stock.picking', 'Packing list', select=True,invisible=True), + } + _defaults={ + 'picking_id':_get_picking, + 'address_id':_get_picking_address, + } + def action_move(self,cr,uid,ids,context=None): + move_obj=self.pool.get('stock.move') + picking_obj=self.pool.get('stock.picking') + for act in self.read(cr,uid,ids): + move_lines=move_obj.browse(cr,uid,act['move_ids']) + for line in move_lines: + picking_obj.write(cr,uid,[line.picking_id.id],{'move_lines':[(1,line.id,{'picking_id':act['picking_id']})]}) + picking_obj.write(cr,uid,[act['picking_id']],{'move_lines':[(1,line.id,{'picking_id':act['picking_id']})]}) + cr.commit() + old_picking=picking_obj.read(cr,uid,[line.picking_id.id])[0] + if not len(old_picking['move_lines']): + picking_obj.write(cr,uid,[old_picking['id']],{'state':'done'}) + return {'type':'ir.actions.act_window_close' } + +stock_picking_move_wizard() + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 2290b4504f4..f1d8550cd1d 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -1185,6 +1185,31 @@ + + + stock.picking.move.wizard.form + stock.picking.move.wizard + form + +
+ + + + +