From fe8fa28064c6d2a672e03864190b46472eb18390 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 23 Mar 2009 21:57:37 +0100 Subject: [PATCH] bugfix bzr revid: fp@tinyerp.com-20090323205737-04i2qnne8jpujvv5 --- addons/account/partner.py | 3 ++- addons/stock/stock.py | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/addons/account/partner.py b/addons/account/partner.py index 1de5e14f113..0ea8e2be169 100644 --- a/addons/account/partner.py +++ b/addons/account/partner.py @@ -139,7 +139,8 @@ class res_partner(osv.osv): return [('id','in',map(lambda x:x[0], res))] _columns = { - 'credit': fields.function(_credit_debit_get, fnct_search=_credit_search, method=True, string='Total Receivable', multi='dc', help="Total amount this customer owes you."), + 'credit': fields.function(_credit_debit_get, + fnct_search=_credit_search, method=True, string='Total Receivable', multi='dc', help="Total amount this customer owes you."), 'debit': fields.function(_credit_debit_get, fnct_search=_debit_search, method=True, string='Total Payable', multi='dc', help="Total amount you have to pay to this supplier."), 'debit_limit': fields.float('Payable Limit'), 'property_account_payable': fields.property( diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 096a41d2469..d24f1dd632f 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -460,13 +460,17 @@ class stock_picking(osv.osv): def action_confirm(self, cr, uid, ids, context={}): self.write(cr, uid, ids, {'state': 'confirmed'}) todo = [] + todo2 = [] for picking in self.browse(cr, uid, ids): for r in picking.move_lines: if r.state=='draft': todo.append(r.id) + else: + todo2.append(r.id) todo = self.action_explode(cr, uid, todo, context) if len(todo): self.pool.get('stock.move').action_confirm(cr, uid, todo, context) + self.pool.get('stock.move').action_chain(cr, uid, todo+todo2, context) return True def test_auto_picking(self, cr, uid, ids): @@ -1009,8 +1013,12 @@ class stock_move(osv.osv): def action_confirm(self, cr, uid, ids, context={}): # ids = map(lambda m: m.id, moves) - moves = self.browse(cr, uid, ids) self.write(cr, uid, ids, {'state':'confirmed'}) + return [] + + def action_chain(self, cr, uid, ids, context={}): + moves = self.browse(cr, uid, ids) + for picking, todo in self._chain_compute(cr, uid, moves, context).items(): ptype = self.pool.get('stock.location').picking_type_get(cr, uid, todo[0][0].location_dest_id, todo[0][1][0]) pickid = self.pool.get('stock.picking').create(cr, uid, {