コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3582 ビュー

How to know the name of model_id?
test with
- gpsmap.positions
- gpsmap_positions
- model_gpsmap.positions
- model_gpsmap_positions
- positions
- model_positions
and keep showing error


XML Code:

<record id="position_rule_user" model="ir.rule">
    <field name="name">User can only see positions</field>
    <field name="model_id" ref="gpsmap_positions"/>
    <field name="groups" eval="[(4, ref('gpsmap_group_user'))]"/>
    <field name="perm_read" eval="True"/>
    <field name="perm_write" eval="False"/>
    <field name="perm_create" eval="False"/>
    <field name="perm_unlink" eval="False"/>
</record>       


Py Code:

class positions(models.Model):
    _name = "gpsmap.positions"
    _description = 'GPS Positions'
    _order = "devicetime DESC"
    _pointOnVertex=""
    protocol                                    = fields.Char('Protocolo', size=15)
    deviceid                                    = fields.Many2one('fleet.vehicle',ondelete='set null', string="Vehiculo", index=True)


Error Code:

 File "/usr/lib/python3/dist-packages/odoo/tools/cache.py", line 89, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_model.py", line 1349, in xmlid_lookup
    raise ValueError('External ID not found in the system: %s' % xmlid)
odoo.tools.convert.ParseError: "External ID not found in the system: solesgps_map.gpsmap_positions" while parsing /usr/lib/python3/dist-packages/odoo/addons/        
アバター
破棄
最善の回答

Hi,

You can give the model like this,

module_name.model_MODEL_NAME

If your module name is sale_extended and the model name is sale.order, and we know sale order model is defined inside the module with technical name sale

So the model has to give like this, sale.model_sale_order .


See more : Record Rules in Odoo


Thanks

アバター
破棄
関連投稿 返信 ビュー 活動
2
7月 24
2710
1
6月 24
5169
1
10月 23
10899
1
10月 23
98
1
8月 23
2194