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

hi am new to odoo development, this maybe something simple but i can't figer it out

i added this to the `sale.subscription`

subscription_tier = fields.Char(string='Subscription Tier', readonly=True, compute='_compute_subscription_tire')


then in my custom module, I wanted to create `Many2one` that did not show used values and that has `subscription_tier` value of `tier_i` or `tier_ii` or `tier_iii`

@api.onchange('user_name')
def onchange_test_domain_fiedl(self):

obj = self.search([])
available_ids = []
for i in obj:

available_ids.append(i.test_domain.id)
return {'domain': {'user_name': [|,&,('id', 'not in', available_ids),(('subscription_tier','=','tier_i'),('subscription_tier','=','tier_ii'),('subscription_tier','=','tier_iii'))]}}
user_name = fields.Many2one('sale.subscription', string='Name')


Thank you for your help

Imagine profil
Abandonează
Autor Cel mai bun răspuns

Change `test_domain` to `user_name` then follow the steps in Kenly's answer

https://stackoverflow.com/questions/61847066/odoo-13-create-domain-from-a-custom-field-in-sale-subscription/61851785#61851785

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
ian. 22
4152
1
dec. 21
3470
3
mai 20
5105
1
iun. 23
3095
1
ian. 23
2861