I have a model A where a field1 which migrate in a model B. I want to display data of others fields of the model A when i choose the field1 in the view of model B. Notice that there are the same fields in two models. Thank
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kirjanpito
- Varastointi
- PoS
- Project
- MRP
Tämä kysymys on merkitty
1
Vastaa
5990
Näkymät
Hello,
class modelA(models.Model):
_name='model.a'
field1 = fields.Char(string='field1')
fieldA = fields.Char(string='fieldA')
class modelB(models.Model):
_name='model.b'
field1 = fields.Many2one('model.a', string='field1')
fieldB = fields.Char(related='field1.fieldA', string='Field B')
Hope this helps.
Nautitko keskustelusta? Älä vain lue, vaan osallistu!
Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!
Rekisteröidy
It would be more helpful if you can post your code or sample code to help you.