Hi Everyone.
Here i add a functional field to my form, Now when i put some
conditions as a return in my module it doesn't work.
product = fields.function(field.text("list of
products"),'get_product", searcher="search_product")
def get_product()
#find all the products within the pricelist then concrete the string
to have a long string of product names
re = "list of products: "
for con in pricelist[0].contract:
for pro in con.product_priceline
list = list + pro.product.template.name
res4[pricelist[0].id] = list
print "this is RES++++++++++++++"
print res4
print "this is end or RES+++++++++++++"
return res4
def search_product(self,name,clause):
res = []
#res.append(('type',) + clause[1:])
res.append(('product',) + clause[1:])
print res
return res
I have to note that product is a functional field which has been
extracted from a child of child field and it's value is a string (Text
field) which is a concrete of product names for this current
pricelist.
This field works properly , i assigned a textbox and all the values
are visible on it.
Now we want to use the power of build in search function to assign
search="1" to this function field.
The commented line which is "res.append(('type',) + clause[1:])"
works fine (Mention that type is not a functional field, it is a real
filed ! )
But the uncommented line which is " res.append(('product',) +
clause[1:]) " can't work and it cause an unlimited loop and client
crashes
Is this the correct way of doing search or not ?
I mean is it possible for a functional field to have a searcher method
which is refering to itself for search functions or not ?
Thanks.
--
[email protected] mailing list