openerp - Usage of Search Attribute in field tag in openerp7 -


can tell me use of search attribute in field tag.

sample documentation below

<field name="partner_id" search="[]" model="res.partner"/> 

sample openerp code below

 <field name="fields_id" search="[('model','=','res.partner'),('name','=','property_account_receivable')]"/>  # account/demo/account_minimal.xml   <field model="res.country.state" name="state_id" search="[('code','ilike','ca')]"/> # base/res/res_partner_demo.xml   <field name="account_debit" search="[('code', 'like', '4540%')]"/> # l10n_be_hr_payroll_account/l10n_be_hr_payroll_account_data.xml 

documentation explanation below

the search attribute allows find record associate when not know xml id. can specify search criteria find wanted record. criteria list of tuples of same form predefined search method. if there several results, arbitrary 1 chosen (the first one)

i having prob in understanding how above works. can me out how needs used. possible give dynamic search values global filter. time.

as per knowledge ids = self.search(cr, uid,[ '|', ('partner_id', '!=', 13),'!', ('name', 'ilike', 'abc'), ]) search partner id isn't 13 , ignore name of abc fetch record non-abc partner shops + partner 13

for prefix operators: '&' (default), '|', '!'

for operator =, !=, >, >=, <, <=, like, ilike, in, not in, child_of, parent_left, parent_right

hope understand.

vote this


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -