In sales application, when creating a new quotation I am entering a specific pricelist and when I add a product the unit price is automatically updated to match the pricelist. I want to add a new feature where I check if the unit price is less than the price list (unit price changed manually) then I will request admin approval. How can I access the unit price in the one2many field here. Any help please?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilitat
- Inventari
- PoS
- Project
- MRP
This question has been flagged
1
Respondre
2394
Vistes
You can inherit the sales order lines model in the sales module and make a method with any of Odoo api decorations for example. @api.constrains or @api.onchange to notify the user with a ValidationError if he is not allowed to change the price
Example:
class SalesOrderLines(models.model):
_inherit = 'sale.order.line'
@api.constrains('unit_price')
def _const_price(self):
#your condition and raise ValidationError
Happy to help :) an upvote will be awesome
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrar-seRelated Posts | Respostes | Vistes | Activitat | |
---|---|---|---|---|
|
1
de juny 22
|
1524 | ||
|
1
d’abr. 24
|
1292 | ||
|
1
d’oct. 23
|
1433 | ||
|
1
de maig 23
|
1930 | ||
|
0
de set. 22
|
1917 |