Why doesn't Odoo use Sales Order and Invoice Warning Messages from the Contact Internal Notes to appear when you are creating Tickets in Odoo Helpdesk? If Helpdesk is used for billing this should be considered. Im looking at developing a customization for this
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilità
- Magazzino
- PoS
- Project
- MRP
La domanda è stata contrassegnata
Hi,
Odoo does not show Sales Order or Invoice warning messages in Helpdesk tickets because the Helpdesk module was designed as a support tool, not as part of the commercial workflow. The warning logic (sale_warn / invoice_warn) is only implemented in Sales Orders and Invoices, so when you select a customer in Helpdesk, those checks are never triggered.
If you need this (for example, when Helpdesk is used for billable services), you can add a customization to extend helpdesk.ticket so that it calls the same partner warning logic used in Sales and Invoicing. This way, when a ticket is created or a customer is selected, the system will display or block based on the customer’s warning settings.
If you want to integrate this (especially if Helpdesk is used for billing or customer agreements), you can extend helpdesk.ticket to check partner warnings on creation/change.
Try the following code,
from odoo import models, api, _
from odoo.exceptions import UserError
class HelpdeskTicket(models.Model):
_inherit = "helpdesk.ticket"
@api.onchange("partner_id")
def _onchange_partner_id_warning(self):
if not self.partner_id:
return
partner = self.partner_id
# Check Sales Order Warning
if partner.sale_warn and partner.sale_warn != "no-message":
warning = {
"title": _("Sales Warning for %s") % partner.name,
"message": partner.sale_warn_msg
}
if partner.sale_warn == "block":
self.partner_id = False
return {"warning": warning}
return {"warning": warning}
# Check Invoice Warning
if partner.invoice_warn and partner.invoice_warn != "no-message":
warning = {
"title": _("Invoice Warning for %s") % partner.name,
"message": partner.invoice_warn_msg
}
if partner.invoice_warn == "block":
self.partner_id = False
return {"warning": warning}
return {"warning": warning}
* This mimics the same warning logic as sale.order and account.move.
* The warning pops up when selecting a customer in a ticket.
* If set to Block, it prevents using that customer.
Hope it helps
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
RegistratiPost correlati | Risposte | Visualizzazioni | Attività | |
---|---|---|---|---|
|
0
mar 25
|
1611 | ||
|
0
ott 24
|
1553 | ||
|
1
set 24
|
1680 | ||
|
1
ago 24
|
1794 | ||
|
1
lug 24
|
1619 |
Tested and confirmed working with Odoo 18 Thanks!