-
-
Notifications
You must be signed in to change notification settings - Fork 700
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df05e94
commit 82f67ee
Showing
5 changed files
with
79 additions
and
5 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
8 changes: 4 additions & 4 deletions
8
openupgrade_scripts/scripts/lunch/14.0.1.0/noupdate_changes.xml
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,16 +1,16 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<odoo> | ||
<record id="ir_rule_lunch_location_multi_company" model="ir.rule"> | ||
<field name="global"/> | ||
<!-- <field name="global"/>--> | ||
</record> | ||
<record id="ir_rule_lunch_product_multi_company" model="ir.rule"> | ||
<field name="global"/> | ||
<!-- <field name="global"/>--> | ||
</record> | ||
<record id="ir_rule_lunch_product_report_multi_company" model="ir.rule"> | ||
<field name="domain_force">['|', ('company_id', '=', False), ('company_id', 'in', company_ids), '|', ('category_id.company_id', '=', False), ('category_id.company_id', 'in', company_ids)]</field> | ||
<field name="global"/> | ||
<!-- <field name="global"/>--> | ||
</record> | ||
<record id="ir_rule_lunch_supplier_multi_company" model="ir.rule"> | ||
<field name="global"/> | ||
<!-- <field name="global"/>--> | ||
</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,8 @@ | ||
# Copyright 2021 ForgeFlow S.L. <https://www.forgeflow.com> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
from openupgradelib import openupgrade | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
openupgrade.load_data(env.cr, "lunch", "14.0.1.0/noupdate_changes.xml") |
37 changes: 37 additions & 0 deletions
37
openupgrade_scripts/scripts/lunch/14.0.1.0/pre-migration.py
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,37 @@ | ||
# Copyright 2021 ForgeFlow S.L. <https://www.forgeflow.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from openupgradelib import openupgrade | ||
|
||
|
||
def fast_fill_lunch_supplier_company_id(env): | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
ALTER TABLE lunch_supplier | ||
ADD COLUMN company_id integer""", | ||
) | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
UPDATE lunch_supplier ls | ||
SET company_id = rp.company_id | ||
FROM res_partner rp | ||
WHERE ls.partner_id = rp.id""", | ||
) | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
fast_fill_lunch_supplier_company_id(env) | ||
openupgrade.set_xml_ids_noupdate_value( | ||
env, | ||
"lunch", | ||
[ | ||
"lunch_mind_other_food_money", | ||
"lunch_mind_your_own_food_money", | ||
"lunch_order_rule_delete", | ||
"lunch_order_rule_write", | ||
"lunch_order_rule_write_manager", | ||
], | ||
True, | ||
) |
29 changes: 29 additions & 0 deletions
29
openupgrade_scripts/scripts/lunch/14.0.1.0/upgrade_analysis_work.txt
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,29 @@ | ||
---Models in module 'lunch'--- | ||
obsolete model lunch.order.temp [transient] | ||
---Fields in module 'lunch'--- | ||
lunch / lunch.product.category / active (boolean) : NEW hasdefault | ||
# NOTHING TO DO: default = true | ||
|
||
lunch / lunch.supplier / company_id (many2one) : is now stored | ||
# DONE: pre-migration: fast-populated | ||
|
||
---XML records in module 'lunch'--- | ||
NEW ir.rule: lunch.ir_rule_lunch_product_category_multi_company (noupdate) | ||
# NOTHING TO DO | ||
|
||
ir.rule: lunch.lunch_mind_other_food_money (noupdate) (noupdate switched) | ||
ir.rule: lunch.lunch_mind_your_own_food_money (noupdate) (noupdate switched) | ||
ir.rule: lunch.lunch_order_rule_delete (noupdate) (noupdate switched) | ||
ir.rule: lunch.lunch_order_rule_write (noupdate) (noupdate switched) | ||
ir.rule: lunch.lunch_order_rule_write_manager (noupdate) (noupdate switched) | ||
# DONE: pre-migration: switched noupdate | ||
|
||
NEW ir.ui.view: lunch.lunch_alert_view_kanban | ||
NEW ir.ui.view: lunch.lunch_location_kanban_view | ||
NEW ir.ui.view: lunch.lunch_order_view_form | ||
NEW ir.ui.view: lunch.lunch_product_category_view_kanban | ||
NEW ir.ui.view: lunch.lunch_product_category_view_search | ||
NEW ir.ui.view: lunch.lunch_product_report_view_tree | ||
DEL ir.ui.view: lunch.view_lunch_order_temp | ||
# NOTHING TO DO | ||
|