[FIX] crm,gamification: flexible reference to field
The field generation is most of the time following the pattern
`field_<table name>_<field name>`
but in case of name clash (e.g. res.partner.category - id and res.partner -
category_id), the id of ir.model.field is added at the end of the external id
during the field creation.
The more flexible way to link to an ir.model.field is to use the syntax
`search=[('model', '=', <model>), ('name', '=', <field name>)]`
to avoid errors as in #12192 when the "first" external id no longer exists.
Fixes #12192
Closes #12198
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
<field name="sequence">1</field>
|
||||
<field name="kind">on_time</field>
|
||||
<field name="filter_id" ref="filter_draft_lead"/>
|
||||
<field name="trg_date_id" ref="field_crm_lead_create_date"/>
|
||||
<field name="trg_date_id" search="[('model','=','crm.lead'),('name','=','create_date')]"/>
|
||||
<field name="trg_date_range">5</field>
|
||||
<field name="trg_date_range_type">day</field>
|
||||
<field name="server_action_ids" eval="[(6,0,[ref('action_email_reminder_lead')])]"/>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<field name="computation_mode">count</field>
|
||||
<field name="suffix">leads</field>
|
||||
<field name="model_id" eval="ref('crm.model_crm_lead')" />
|
||||
<field name="field_date_id" eval="ref('crm.field_crm_lead_create_date')" />
|
||||
<field name="field_date_id" search="[('model','=','crm.lead'),('name','=','create_date')]" />
|
||||
<!-- lead AND opportunity as don't want to be penalised for lead converted to opportunity -->
|
||||
<field name="domain">[('user_id','=',user.id), '|', ('type', '=', 'lead'), ('type', '=', 'opportunity')]</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user