[FIX] point_of_sale: Fixed AttributeError on Make Payment wizard when no demo data loaded.
lp bug: https://launchpad.net/bugs/856501 fixed bzr revid: uco@tinyerp.com-20110930071248-570qszd7rft2p6y3
This commit is contained in:
parent
6c1d725c21
commit
caf42da3e3
|
@ -260,9 +260,16 @@ class pos_order(osv.osv):
|
|||
args['name'] = args['name'] + ': ' + data['payment_name']
|
||||
account_def = property_obj.get(cr, uid, 'property_account_receivable', 'res.partner', context=context)
|
||||
args['account_id'] = order.partner_id and order.partner_id.property_account_receivable \
|
||||
and order.partner_id.property_account_receivable.id or account_def.id or curr_c.account_receivable.id
|
||||
and order.partner_id.property_account_receivable.id or account_def and account_def.id
|
||||
args['partner_id'] = order.partner_id and order.partner_id.id or None
|
||||
|
||||
if not args['account_id']:
|
||||
msg = 'There is no receivable account defined'
|
||||
if args['partner_id']:
|
||||
msg += ' for this partner: "%s" (id:%d)' % \
|
||||
(order.partner_id.name, order.partner_id.id,)
|
||||
raise osv.except_osv(_('Error !'), _('%s' %msg))
|
||||
|
||||
statement_id = statement_obj.search(cr,uid, [
|
||||
('journal_id', '=', int(data['journal'])),
|
||||
('company_id', '=', curr_company),
|
||||
|
|
Loading…
Reference in New Issue