Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
3096 Tampilan

I used the partner_id m2o from stock move in my custom module BUT when I tried to display it in the loop like:

partner_id.id (returns False) but when i tried the product_id.id it returns a value, 

In my stock.move I have 3 m2o fields (product_id,partner_id,and invoice_id)

I tried to loop the product_id.id and invoice_id.id, then it returns a value which means I have either sales or purchase but when I tried to loop the partner_id.id, it returns False, I tried the other fields of the partner_id like name or date but still it returns false. 

Then I tried to check if the partner_id.id is empty or not then it returns False which mean it is empty even though when I check the stock.move manually and there's a data on it


Each record of the stock move consist of product_id.id,invoice_id.id,partner_id.id,pcs,kgs,amount.  If there's a value return in product_id.id and invoice_id.id, it means there's a partner_id.id.


But, Why the partner_id.id returns False?

Avatar
Buang
Jawaban Terbai

Hi,

First of all make sure that there is a field partner_id in the stock.move, then you have to check whether there is a value in the field partner_id before using partner_id.id.

So by adding an if statement i hope you can solve your issue,

if partner_id:


Thanks

Avatar
Buang
Penulis

Dear Niyas,

If the partner_id.id don't have any value, it will return false?

Post Terkait Replies Tampilan Aktivitas
2
Okt 23
5763
3
Sep 23
2601
0
Mei 23
2594
1
Mei 23
2078
1
Apr 23
1887