Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3771 Weergaven

Hi!

The recordData object in javascript has all the fields data. In account.invoice this is object:






For the Many2one fields this is the data:




The "data" only has "display_name" and "id", but i need "vat" field.

Is there a way to get more fields? 

My first option is a rpc to get the partner data using the id (this.recordData.partner_id.data.id), i tried and it works.


var def = this._rpc({
model: 'res.partner',
method: 'search_read',
domain: [
['id', '=', this.recordData.partner_id.data.id]
],
}).then(function (result) {
partner_data = result[0];
});


My second option is a related field, also works.

partner_vat = fields.Char(related='partner_id.vat')


But i want to know if i can avoid this rpc call and avoid create a new related field.


Thanks.

Avatar
Annuleer

Did you ever solve this?

Gerelateerde posts Antwoorden Weergaven Activiteit
0
feb. 19
3640
0
mrt. 15
4262
0
apr. 25
740
2
aug. 17
5792
0
mrt. 15
4891