When I create a new favorite filter in this view :
A new record is created in the table ir.filters.
But no external identifier for this new favorite filter. I was sure that there is an external identifier for almost all in Odoo. But no external identifier for custom filters (favorites)?
To modify this filter via a xml file, I can't put id with external identifier. May be the id could be written in INTEGER...
<record id="163" model="ir_filters">
I have used this code in my module. It creates a new record in ir.filters. This new filter appear in the « favorite » section and is selected by default.
<?xml version="1.0" encoding="UTF-8"?>
<record id="report_lapagept.filtre_lapagept" model="ir.filters">
<field name="domain">['|', '|', ['summary', 'ilike', 'lapagept'], ['shortdesc', 'ilike', 'lapagept'], ['name', 'ilike', 'lapagept']]</field>
<field name="user_id" eval="False"/>
<field name="action_id" type="int">37</field>
external ids are only present if record is created via import or module install...
if you create record trough gui it does not have external id..
But if you need external id of that record, you need to export it to csv file firs, then you can use assigned id from csv file
(usualy in form : __export__.model_name_XX where xx is db id, but not always.., if you export o2m or m2m fields, external ids can be in form : __export__.module_name_XX_YY where XX is db id, and YY is instance in this case, just remove _YY part and use it as external id)
but recomended way is to create such record in xml ( and assign external id respectivly) then remove record manualy created and upgrade/install module to re-create it with propper external id
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 1/14/15, 9:01 AM|
|Seen: 1575 times|
|Last updated: 3/16/15, 8:10 AM|