how to verify vendor on the purchase order for a product is same as the vendor given on the product details in odoo12 community version
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
i got answer
class VendorValidate(models.Model):
_inherit = 'purchase.order'
@api.multi
def _add_supplier_to_product(self) :
vendor_list=[]
for order in self:
for line in order.order_line:
if order.partner_id.id not in line.product_id.variant_seller_ids.mapped('name.id'):
vendor_list.append(line.product_id.name)
else:
if vendor_list:
raise UserError("raise error")
Hello,
Can you give me some details about your case ?
Are you talking about Enterprise or Community ?
----------
Thanks.
Acespritech Solutions Pvt Ltd.
Apps on Odoo Store : https://www.odoo.com/apps/modules/browse?search=acespritech
Skype: acespritech
Website: http://www.acespritech.com
You need to provide more details about the purchase order and vendor. Also, enterprise information needs to be listed.
First why you want to verify , because here you are selecting vendor and you know from where you are going to purchase.
While the vendor list in product detail is simply the pricelist. If you have valid pricelist from the same vendor then you get the prices. If not still you can update the prices on purchase order itself.
BTW your requirements you can easily get/guess by adding product and supplier, if vendor is one defined on product then you can get the prices. Now if you got 0 prices means either you haven't defined vendor on product details or not matched the conditions.