Add journal_id in context for account_move_line search

bzr revid: ced-bfadcc4e44a91692fc1ca61a7bbc979f5db198e7
This commit is contained in:
ced 2007-11-30 09:32:48 +00:00
parent 31b572248f
commit 73d44969b1
1 changed files with 9 additions and 2 deletions

View File

@ -40,8 +40,15 @@ FIELDS = {
def search_entries(self, cr, uid, data, context):
pool = pooler.get_pool(cr.dbname)
order_obj = pool.get('payment.order')
line_obj = pool.get('account.move.line')
payment = order_obj.browse(cr, uid, data['id'],
context=context)
ctx = ''
if payment.mode:
ctx = '''context="{'journal_id': %d}"''' % payment.mode.journal.id
# Search for move line to pay:
line_ids = line_obj.search(cr, uid, [
('reconcile_id', '=', False),
@ -50,8 +57,8 @@ def search_entries(self, cr, uid, data, context):
FORM.string = '''<?xml version="1.0"?>
<form string="Populate Payment:">
<field name="entries" colspan="4" height="300" width="800" nolabel="1"
domain="[('id', 'in', [%s])]"/>
</form>''' % (','.join([str(x) for x in line_ids]))
domain="[('id', 'in', [%s])]" %s/>
</form>''' % (','.join([str(x) for x in line_ids]), ctx)
return {}
def create_payment(self, cr, uid, data, context):