[FIX] point_of_sale: prevent traceback while uninstalling module

When users try to uninstall the "point_of_sale", a traceback will be generated.

Error:   TypeError: uninstall_hook() missing 1 required positional argument: 'registry'

This is because the https://github.com/odoo/odoo/pull/138189 added the
unistallhook from 16, but in the forword port of this PR, it did not change
the argument list according to the new unistall hook from saas-16.2.

This commit fixes the above issue by passing a valid argument
in the unistill hook.

code reference:
https://github.com/odoo/odoo/blob/saas-16.2/addons/point_of_sale/__init__.py#L11

sentry-4586084597

closes odoo/odoo#140591

X-original-commit: 9eda662a89943f3c6725e223bf30238ef8e661f2
Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
Signed-off-by: Pradip Yenpure (prye) <prye@odoo.com>
This commit is contained in:
prye-odoo
2023-11-07 11:21:56 +00:00
parent 495a5090a5
commit 04e5eff325
+1 -3
View File
@@ -6,9 +6,7 @@ from . import controllers
from . import report
from . import wizard
from odoo import api, SUPERUSER_ID
def uninstall_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
def uninstall_hook(env):
#The search domain is based on how the sequence is defined in the _get_sequence_values method in /addons/point_of_sale/models/stock_warehouse.py
env['ir.sequence'].search([('name', 'ilike', '%Picking POS%'), ('prefix', 'ilike', '%/POS/%')]).unlink()