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

i Activate Dropshipping its working well 

when i create sale order auto purchase order is generated 

Case is 

i have custom field in Purchase.order.line field name is sh_sec_uom its not automatically filled 

other then if i go purchase order and put product_id then its automatically filled .....

code is here 

```

class sh_purchase_order_line(models.Model): 

 _inherit = "purchase.order.line"


@api.multi @api.onchange('product_id', 'product_uom') 

 def onchange_secondary_uom(self): 

 if self: for rec in self: 

 if rec.product_id.sh_is_secondary_unit == True and rec.product_id.uom_id: 

 rec.sh_sec_uom = rec.product_id.sh_secondary_uom.id

```

this code is working file when i crate purchase order line 

its not working when i create sale order and auto purchase order is created in dropshipping 

where i can customized to full fill my requirements 



Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

I think you can fill the field by inheriting the function 

_prepare_purchase_order_line
this is the default function for creating purchase order from sale order
Awatar
Odrzuć
Autor

This Answer Should be Accepted why above ?

this person understand i want to ...

Powiązane posty Odpowiedzi Widoki Czynność
1
sty 25
3344
2
sie 24
5822
6
gru 22
8749
1
maj 25
5988
0
mar 24
2121