openerp - How can I add values through XML in OpenERP7? -
openerp - How can I add values through XML in OpenERP7? -
i have created new table called res.country.region, , have added new field existing table res.country.state, field region_id , indicates part state belongs to.
now, trying fill in (through xml file) field region_id existing state records, xml_id known. illustration of 1 of records of xml file:
<record model='res.country.state' id='es01'> <field name="region_id" ref="l10n_es_toponyms_region.espv"/> </record>
the problem getting integrity error, because openerp7 tells me trying introduce record in res.country.state required fields valueing null. , not trying introduce new records, updating 1 of columns.
how can manage this?
edit
error my_database openerp.sql_db: bad query: insert "res_country_state" (id,"region_id",create_uid,create_date,write_uid,write_date) values (104,16,1,(now() @ time zone 'utc'),1,(now() @ time zone 'utc')) traceback (most recent phone call last): file "/opt/openerp7/ocb-server/openerp/sql_db.py", line 226, in execute res = self._obj.execute(query, params) integrityerror: null value in column "code" violates not-null constraint
finally, found solution: if want update record introduced xml files, yo have set in id name of module had xml file, dot, , xml_id record had.
so:
<record model='res.country.state' id='module.es01'> <field name="region_id" ref="l10n_es_toponyms_region.espv"/> </record>
xml openerp record openerp-7
Comments
Post a Comment