İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
5384 Görünümler

Basically I added a new field on crm.lost.reason model called type. Now what I'm trying to do is to list down the list reason based on the type.

Model: crm.lead.lost

XML Form

<?xml version="1.0"?>

<form string="Lost Reason">

<group class="oe_title">

<field name="lost_reason_id" domain="<add condition to only list lost_reason_id.parent.type = 'xx type'>" widget="selection" />

</group>

<footer>

<button name="action_lost_reason_apply" string="Submit" type="object" class="btn-primary"/><button string="Cancel" class="btn-secondary" special="cancel"/>

</footer>

</form>


I want add a domain to filter only the reference table type = 'xxx value'. Is this possible? I'm trying it on Odoo studio 12 trial version.


Thanks

Avatar
Vazgeç
Üretici

Hi Bouabaker Abdallah

I would like to ask you how to reference the field from the related table? I'm trying to include on the domain: crm.lost.reason.x_studio_lost_reason = '<somevalue>'

Here's the relation:

Field Name: lost_reason_id / Field Type: many2one / Object Relation: crm.lost.reason

Model: crm.lost.reason / field: x_studio_lost_reason

Is it possible?

En İyi Yanıt

Hi

you want to use the value of the id in many2one field for example :

<field name="id" invisible="1"/>
<field name="my_field" domain="[('field_name', '=', id)]" />
Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
May 24
2631
4
Ara 23
3300
1
Kas 22
4994
2
Tem 22
3707
2
May 18
9881