How to make product invisible in next line, if product is already selected in previous line of one2Many..????
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
2
Risposte
1574
Visualizzazioni
I think you need an @api.onchange function that returns a domain for the Many2one field. Sometthing like that:
@api.onchange('o2m_field')
def onchange_attack(self):
result = {
'domain': {'m2o_field': [('id', 'not in', self.one2many_field.ids)], },
}
And you also can use this domain in the field:
m2o_field = fields.Many2one('module.model' domain="[('id', 'not in', o2m_field)]")
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
Registrati
See dependent dropdown (many2one): https://goo.gl/CBP9og