도움말

0

[Odoo11] How to filter actions with company

Try to filter:
user.company_id.id
XML Code:

    <record id='fleet_position_action' model='ir.actions.act_window'>
        <field name="name">Histoy Map</field>
        <field name="res_model">gpsmap.positions</field>
        <field name="domain">[('deviceid.company_id.id','=','user.company_id.id')]</field>
    </record>


Error code:

  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3845, in _search
    self._cr.execute(query_str, where_clause_params)
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 232, in execute
    res = self._obj.execute(query, params)
psycopg2.DataError: invalid input syntax for integer: "user.company_id.id"
LINE 1: ...id FROM "res_company" WHERE ("res_company"."id" = 'user.comp...

Avatar
Discard
1 응답
0
Best Answer

Hello Eduardo


Please try this <field name="domain">[('deviceid.company_id','=',user.company_id.id)]</field> instead of <field name="domain">[('deviceid.company_id.id','=','user.company_id.id')]</field>

Regards,




Email:   odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

   

Avatar
Discard