bzr revid: fp@tinyerp.com-20090323205737-04i2qnne8jpujvv5
This commit is contained in:
Fabien Pinckaers 2009-03-23 21:57:37 +01:00
parent c72da62763
commit fe8fa28064
2 changed files with 11 additions and 2 deletions

View File

@ -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(

View File

@ -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, {