From 935c643856c51096171de3e0d035b6bbe45c9b40 Mon Sep 17 00:00:00 2001 From: Sylvain LE GAL Date: Mon, 28 Oct 2024 15:02:00 +0100 Subject: [PATCH] fixup! fixup! fixup! [MIG] pos_place: Migration to 16.0 (from 12.0) --- pos_place/__manifest__.py | 2 +- pos_place/models/__init__.py | 2 +- pos_place/models/account_move.py | 4 +-- pos_place/security/ir_rule.xml | 4 +-- pos_place/views/view_account_invoice.xml | 29 --------------------- pos_place/views/view_account_move.xml | 33 ++++++++++++++++++++++++ 6 files changed, 38 insertions(+), 36 deletions(-) delete mode 100644 pos_place/views/view_account_invoice.xml create mode 100644 pos_place/views/view_account_move.xml diff --git a/pos_place/__manifest__.py b/pos_place/__manifest__.py index 6b3fc4fd74..beb9618390 100644 --- a/pos_place/__manifest__.py +++ b/pos_place/__manifest__.py @@ -16,7 +16,7 @@ "security/ir_rule.xml", "security/res_groups.xml", "security/ir.model.access.csv", - # "views/view_account_invoice.xml", + "views/view_account_move.xml", "views/view_pos_config.xml", "views/view_pos_place.xml", "views/view_pos_order.xml", diff --git a/pos_place/models/__init__.py b/pos_place/models/__init__.py index 684717770b..027bb556dc 100644 --- a/pos_place/models/__init__.py +++ b/pos_place/models/__init__.py @@ -1,4 +1,4 @@ -# from . import account_invoice +from . import account_move from . import pos_place from . import pos_config from . import pos_order diff --git a/pos_place/models/account_move.py b/pos_place/models/account_move.py index 3574dee401..fe757b9196 100644 --- a/pos_place/models/account_move.py +++ b/pos_place/models/account_move.py @@ -4,7 +4,7 @@ from odoo import fields, models -class AccountInvoice(models.Model): - _inherit = "account.invoice" +class AccountMove(models.Model): + _inherit = "account.move" place_id = fields.Many2one(string="Place", comodel_name="pos.place") diff --git a/pos_place/security/ir_rule.xml b/pos_place/security/ir_rule.xml index a931e906c4..c497b264bb 100644 --- a/pos_place/security/ir_rule.xml +++ b/pos_place/security/ir_rule.xml @@ -10,9 +10,7 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). Point of Sale Places - ['|', - ('company_id', '=', False), - ('company_id', '=', user.company_id.id)] + [('company_id', 'in', company_ids + [False])] diff --git a/pos_place/views/view_account_invoice.xml b/pos_place/views/view_account_invoice.xml deleted file mode 100644 index 827b9950e3..0000000000 --- a/pos_place/views/view_account_invoice.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - account.invoice - - - - - - - - - - account.invoice - - - - - - - - - diff --git a/pos_place/views/view_account_move.xml b/pos_place/views/view_account_move.xml new file mode 100644 index 0000000000..1cf7164cf6 --- /dev/null +++ b/pos_place/views/view_account_move.xml @@ -0,0 +1,33 @@ + + + + + + account.move + + + + + + + + + + account.move + + + + + + + + +