Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
3657 Vizualizări

ello teamI have one field many2one that I use in one form. However when I try upload a XML with some  value fields its get error because I am trying to upload char in one field that is many2one.Could you help me ?.

cost = fields.Many2one('guimarc.linechargerule', default='',string='')
Imagine profil
Abandonează

not enough information. Many2one is a relation field, so it is a like a DB foreign key to another model.

Cel mai bun răspuns

The many2one field needs an integer ID as value, char will throw an error. If you are doing through XML data then I can give you an example.

<record id="module_category" model="model.name">
    <field name="name">Name</field>
</record>

<record id="group_user" model="res.groups">
<field
name="name">User</field>
<field
name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
<field
name="category_id" ref="module_category"/>
</record>

Here Category id is a many2one field
Imagine profil
Abandonează