python - Newly created records in domain not shown in field OpenERP -
i have been working on search module in openerp-7. returning records in domain can show them on field. problem field not showing newly created records in domain. while on printing value of domain on console, desired records. don't seem why it's not allowing me view them in field. neither getting error.
my domain part of function follows:
res = cr.fetchall() p_id,p_name in res: domain.append((p_id)) print domain return {'domain':{'my_products':[('id','in',domain)]}}
to see records in one2many, don't have use 'domain', must use 'value' template save one2many records (see in server/bin/openerp/osv/fields.py around line 420) :
# --------------------------------------------------------- # relationals fields # --------------------------------------------------------- # # # values: (0, 0, { fields }) create # (1, id, { fields }) update # (2, id) remove (delete) # (3, id) unlink 1 (target id or target of relation) # (4, id) link # (5) unlink (only valid one2many) # #checkme: dans la pratique c'est quoi la syntaxe utilisee pour le 5? (5) ou (5, 0)?
so, in case, think work :
res = cr.fetchall() p_id,p_name in res: domain.append((p_id)) return {'value': {'my_products': [(4, x) x in domain]}}
Comments
Post a Comment