Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3097 Widoki

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?

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor

Dear Niyas,

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

Powiązane posty Odpowiedzi Widoki Czynność
2
paź 23
5765
3
wrz 23
2604
0
maj 23
2594
1
maj 23
2078
1
kwi 23
1888