Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3789 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ

Did you ever solve this?

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 2 19
3655
0
thg 3 15
4272
0
thg 4 25
760
2
thg 8 17
5809
0
thg 3 15
4895