odoo/odoo#196546

Created by fw-bot
Merged at 1ca56e555cd21685fffc1ffec9e0a7a08bf843bb

Statuses:

label
odoo-dev:master-saas-17.4-sentry-5731062091-parseerror-event-sale-aamo-414104-fw
head
950a299505b7338d184fe2d999b26f3f502a1577
merged
5 months ago by Bugfix, Aayush Modi (aamo)
odoo/odoo
saas-17.4 #195433
18.0 #196470
saas-18.1 #196544
saas-18.2
saas-18.3
saas-18.4
master #196546

[FW][FIX] event_sale: prevent error on upgrading module

Currently a ParseError is arising when the user upgrades the event_sale module after deleting the Event Registration product from sales.

Steps to reproduce:

  • Install Sale_management and event module (without demo data)
  • Open Products in Sales > Delete Event Registration
  • Now upgrade event_sale module
  • The error appears in the log.

Traceback:

Exception: Cannot update missing record 'event_product.product_product_event'

ParseError: while parsing /home/odoo/src/odoo/saas-18.1/addons/event_sale/data/event_sale_data.xml:4, somewhere inside <record id="event_product.product_product_event" model="product.product">
            <field name="invoice_policy">order</field>
        </record>

This commit resolves the issue by preventing the creation of a product using forcecreate="False".

sentry-5731062091


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #195433