[FIX] event_[booth_]sale: don't allow event product on quotation template

Current behavior:

In a sale order: a wizard pops up to complete the link with the event
and attendee when we add an event product (same issue with event booth).

In quotation template: the wizard doesn't pop up when we add an event as
optional product.

When we create a sales order with the quotation template, the event
is added as product but the wizard still does not pop up, and therefore,
the SO is not linked to the event.

After this commit:

  Don't allow adding event (or event booth) as optional product to a
  quotation template.
  A same fix was already done on products (not optional) here:
  https://github.com/odoo/odoo/pull/100499

opw-3081853

closes odoo/odoo#113730

X-original-commit: a6bc38598f695ead9d9816b6858823b28b4ba95d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
This commit is contained in:
Nasreddin Boulif (bon)
2023-02-27 13:56:07 +01:00
parent d7ea3c1aec
commit b3be95860b
4 changed files with 14 additions and 0 deletions
@@ -10,3 +10,4 @@ from . import event_type_booth
from . import sale_order
from . import sale_order_line
from . import sale_order_template_line
from . import sale_order_template_option
@@ -0,0 +1,6 @@
from odoo import fields, models
class SaleOrderTemplateOption(models.Model):
_inherit = "sale.order.template.option"
product_id = fields.Many2one(domain="[('sale_ok', '=', True), ('detailed_type', 'not in', ['event', 'event_booth']), ('company_id', 'in', [company_id, False])]")
+1
View File
@@ -8,3 +8,4 @@ from . import product
from . import sale_order
from . import sale_order_line
from . import sale_order_template_line
from . import sale_order_template_option
@@ -0,0 +1,6 @@
from odoo import fields, models
class SaleOrderTemplateOption(models.Model):
_inherit = "sale.order.template.option"
product_id = fields.Many2one(domain="[('sale_ok', '=', True), ('detailed_type', '!=', 'event'), ('company_id', 'in', [company_id, False])]")