Skip to content

Commit 911fb0a

Browse files
authored
Merge pull request #5313 from Tecnativa/17.0-ou-add-pos_restaurant
[17.0][OU-ADD] pos_restaurant: Migration to 17.0
2 parents 176b35b + c62af45 commit 911fb0a

File tree

5 files changed

+69
-2
lines changed

5 files changed

+69
-2
lines changed

docsource/modules160-170.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ Module coverage 16.0 -> 17.0
800800
+---------------------------------------------------+----------------------+-------------------------------------------------+
801801
| |new| pos_razorpay | | |
802802
+---------------------------------------------------+----------------------+-------------------------------------------------+
803-
| pos_restaurant | | |
803+
| pos_restaurant | Done | |
804804
+---------------------------------------------------+----------------------+-------------------------------------------------+
805805
| pos_restaurant_adyen | |No DB layout changes. |
806806
+---------------------------------------------------+----------------------+-------------------------------------------------+

openupgrade_scripts/scripts/point_of_sale/17.0.1.0.1/pre-migration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
]
1111

1212
_field_renames = [
13+
("pos.order", "pos_order", "multiprint_resume", "last_order_preparation_change"),
1314
("pos.order.line", "pos_order_line", "mp_skip", "skip_change"),
1415
]
1516

openupgrade_scripts/scripts/point_of_sale/17.0.1.0.1/upgrade_analysis_work.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ point_of_sale / pos.order / config_id (many2one) : is no
4545
# DONE: pre-migration: it's a related field, let's fill it session_id.config_id
4646

4747
point_of_sale / pos.order / last_order_preparation_change (char): NEW
48-
# NOTHING TO DO: new feature
48+
# DONE: pre-migration: renamed from multiprint_resume (pos_restaurant)
4949

5050
point_of_sale / pos.order / shipping_date (date) : NEW
5151
point_of_sale / pos.order / to_ship (boolean) : DEL
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright 2025 Tecnativa - Carlos Lopez
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
from openupgradelib import openupgrade
4+
5+
6+
def _restaurant_floor_convert_field_m2o_to_m2m(env):
7+
# Convert m2o to m2m in 'restaurant.floor'
8+
openupgrade.m2o_to_x2m(
9+
env.cr,
10+
env["restaurant.floor"],
11+
"restaurant_floor",
12+
"pos_config_ids",
13+
"pos_config_id",
14+
)
15+
16+
17+
@openupgrade.migrate()
18+
def migrate(env, version):
19+
_restaurant_floor_convert_field_m2o_to_m2m(env)
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---Models in module 'pos_restaurant'---
2+
obsolete model restaurant.printer (renamed to pos.printer in module point_of_sale)
3+
# NOTHING TO DO: handled in the point_of_sale module migration scripts
4+
5+
---Fields in module 'pos_restaurant'---
6+
pos_restaurant / pos.config / is_table_management (boolean) : DEL
7+
# NOTHING TO DO: Odoo dropped these fields in https://github.com/odoo/odoo/commit/e3ad1eb058db6329b7f6b8e4880e3610eee22dd9
8+
9+
pos_restaurant / pos.config / module_pos_restaurant_appointment (boolean): NEW
10+
# NOTHING TO DO: new feature used to install the pos_restaurant_appointment module in Enterprise
11+
12+
pos_restaurant / pos.order / multiprint_resume (char) : DEL
13+
pos_restaurant / pos.order.line / mp_skip (boolean) : DEL
14+
# NOTHING TO DO: handled in the point_of_sale module migration scripts
15+
# https://github.com/OCA/OpenUpgrade/blob/03bd8c9c4be30e276162ebf861cd6a5f4527df41/openupgrade_scripts/scripts/point_of_sale/17.0.1.0.1/pre-migration.py#L13
16+
17+
pos_restaurant / pos.config / is_order_printer (boolean) : module is now 'point_of_sale' ('pos_restaurant')
18+
pos_restaurant / pos.config / printer_ids (many2many) : module is now 'point_of_sale' ('pos_restaurant')
19+
pos_restaurant / pos.config / printer_ids (many2many) : relation is now 'pos.printer' ('restaurant.printer') [nothing to do]
20+
pos_restaurant / pos.order.line / uuid (char) : module is now 'point_of_sale' ('pos_restaurant')
21+
# NOTHING TO DO: moved to the point_of_sale module
22+
23+
pos_restaurant / pos.config / floor_ids (one2many) : table is now 'pos_config_restaurant_floor_rel' ('False')
24+
pos_restaurant / pos.config / floor_ids (one2many) : type is now 'many2many' ('one2many')
25+
pos_restaurant / restaurant.floor / pos_config_id (many2one) : DEL relation: pos.config
26+
pos_restaurant / restaurant.floor / pos_config_ids (many2many) : NEW relation: pos.config
27+
# DONE: post-migration: convert m2o to m2m
28+
29+
pos_restaurant / restaurant.printer / _order : module is now 'point_of_sale' ('pos_restaurant')
30+
pos_restaurant / restaurant.printer / display_name (char) : module is now 'point_of_sale' ('pos_restaurant')
31+
pos_restaurant / restaurant.printer / name (char) : module is now 'point_of_sale' ('pos_restaurant')
32+
pos_restaurant / restaurant.printer / printer_type (selection) : module is now 'point_of_sale' ('pos_restaurant')
33+
pos_restaurant / restaurant.printer / product_categories_ids (many2many): module is now 'point_of_sale' ('pos_restaurant')
34+
pos_restaurant / restaurant.printer / proxy_ip (char) : module is now 'point_of_sale' ('pos_restaurant')
35+
# NOTHING TO DO: handled in the point_of_sale module migration scripts
36+
37+
---XML records in module 'pos_restaurant'---
38+
DEL ir.actions.act_window: pos_restaurant.action_restaurant_printer_form
39+
DEL ir.model.access: pos_restaurant.access_restaurant_printer
40+
DEL ir.model.access: pos_restaurant.access_restaurant_printer_manager
41+
DEL ir.ui.menu: pos_restaurant.menu_restaurant_printer_all
42+
DEL ir.ui.view: pos_restaurant.view_restaurant_printer
43+
DEL ir.ui.view: pos_restaurant.view_restaurant_printer_form
44+
# NOTHING TO DO: moved to the point_of_sale module
45+
46+
NEW pos.config: pos_restaurant.pos_config_main_restaurant (noupdate)
47+
# NOTHING TO DO: new feature

0 commit comments

Comments
 (0)