Skip to content

Commit

Permalink
Merge PR #2813 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by dreispt
  • Loading branch information
OCA-git-bot committed Nov 27, 2021
2 parents b5be0cb + 82f67ee commit 7b2e07f
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docsource/modules130-140.rst
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ Module coverage 13.0 -> 14.0
+--------------------------------------------+-------------------------------------------------+
|link_tracker | Nothing to do |
+--------------------------------------------+-------------------------------------------------+
|lunch | |
|lunch | Done |
+--------------------------------------------+-------------------------------------------------+
|mail | Done |
+--------------------------------------------+-------------------------------------------------+
Expand Down
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>
8 changes: 8 additions & 0 deletions openupgrade_scripts/scripts/lunch/14.0.1.0/post-migration.py
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 openupgrade_scripts/scripts/lunch/14.0.1.0/pre-migration.py
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,
)
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

0 comments on commit 7b2e07f

Please sign in to comment.