I need to create an automation so that no one can close an opportunity until and unless a quotation is made against it.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
Thank you, I think 2nd option suits us better. Can you guide how it can be done. Apologies I am new to Odoo
First, create a custom module that inherits from the crm.lead model and include the following code:
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class CustomCrmLead(models.Model):
_inherit = 'crm.lead'
def action_set_won_rainbowman(self):
if not self.quotation_count:
raise UserError(_("This opportunity cannot be marked as 'Won' until a quotation has been created."))
return super(CustomCrmLead, self).action_set_won_rainbowman()
I think you want to ensure that a lead can only be moved to the "Won" stage if an order has been created from it.
Here are two possible approaches:
- Hide the "Won" button unless an order is associated with the lead.
- Display a user error when the "Won" button is clicked without an associated order, prompting the user to create an order first.
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
2
sie 25
|
296 | ||
|
2
sie 25
|
1366 | ||
|
0
lut 25
|
1471 | ||
|
1
sty 25
|
2079 | ||
|
1
lis 24
|
155 |