-
-
Notifications
You must be signed in to change notification settings - Fork 715
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] product_ingredient: Create product_allergen_attribute in pre_in…
…it_hook
- Loading branch information
1 parent
bd7556a
commit fa5f660
Showing
4 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import models | ||
from .hooks import pre_init_hook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- This file is preloaded with pre_init_hook. Use other file if is needed --> | ||
<odoo noupdate="1"> | ||
|
||
<record id="product_allergen_attribute" model="product.attribute"> | ||
<field name="name">Allergens</field> | ||
<field name="create_variant">no_variant</field> | ||
<field name="display_type">select</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright 2023 Tecnativa - Carlos Dauden | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
from openupgradelib import openupgrade | ||
|
||
|
||
def pre_init_hook(cr): | ||
""" | ||
Create product_allergen_attribute to can be used in get_allergen_id() used in compute | ||
methods | ||
""" | ||
openupgrade.load_data(cr, "product_ingredient", "data/product_allergen_data.xml") |