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

Odoo13

in SO and PO I write many  "product name" that maybe need myself or my customer need those .in between

1 :if user make mistake one product name with any quantity could in several line of SO or PO .

2.maybe my customer in  part list that posted to me, product "X"  with quantity = 5 ,but his write this need in 2 line,for example : in item 10 his write 2 number and another line write 3,it means his needs is 5 ,i think odoo must fix it automatically ,or flag notification .

with whicht solution i can fix  ?

could odoo has check mark in setting to prevent this human mistake??



Avatar
Discard
Best Answer

Hi,

This cannot be stated as odoo bug, this has also got use cases, where if the sales person want to some quantities in some rate or with discount and few of them in another price or without the discount.


If you want to add this feature into odoo, you can check for the availability of third party modules or you can create one of your own.


You can add a constrains for the corresponding model like this, this will prevent selecting of duplicate products in order line.

_sql_constraints = [('order_product_uniq', 'unique (order_id,product_id)',     
'Duplicate products in order line not allowed !')]

Thanks

Avatar
Discard
Author

thanx for ur reply But I'm new in odoo,and i dont know where i use that code or how to add constrain . i will be grateful if u could tel me/advise me .