Skip to Content
Menu
This question has been flagged
1 Reply
4509 Views

If I do not have a specific vendors pricing assigned to a product, the price will always show up as $0.00 when adding to a purchase order.  How can I make it default to the Cost (standard_price) field instead of 0.00 ?

Odoo 10 CE

Avatar
Discard
Best Answer

Hi,

To get the cost price of the product in the order lines if the vendor and his price is not set for the products.

Navigate to purchase -> models -> purchase.py

Then search the function named _onchange_quantity , ie, def _onchange_quantity , in this add an extra line

if not seller:
    self.price_unit = self.product_id.standard_price #add this line
    return



You can override this method to achieve this


Thanks

Avatar
Discard

@Niyas Raphy this doesn't work for me in 10 CE, an ideas? It gives me error on startup...