Skip to content

Commit 220ec59

Browse files
committed
rpc_helper: migrate to v16
1 parent 9d023ef commit 220ec59

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

rpc_helper/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
{
66
"name": "Disable RPC",
77
"summary": """Helpers for disabling RPC calls""",
8-
"version": "14.0.1.1.1",
9-
"development_status": "Alpha",
8+
"version": "16.0.1.0.0",
9+
"development_status": "Beta",
1010
"license": "LGPL-3",
1111
"website": "https://github.com/OCA/server-tools",
1212
"author": "Camptocamp, Odoo Community Association (OCA)",

rpc_helper/patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
def protected__execute_cr(cr, uid, obj, method, *args, **kw):
1111
# Same as original func in odoo.service.model.execute_cr
12-
odoo.api.Environment.reset() # clean cache etc if we retry the same transaction
12+
cr.reset()
1313
recs = odoo.api.Environment(cr, uid, {}).get(obj)
1414
if recs is None:
1515
raise UserError(_("Object %s doesn't exist", obj))

rpc_helper/tests/test_xmlrpc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
@common.tagged("post_install", "-at_install")
13-
class TestXMLRPC(common.HttpSavepointCase):
13+
class TestXMLRPC(common.HttpCase):
1414
@classmethod
1515
def setUpClass(cls):
1616
super().setUpClass()
@@ -23,7 +23,7 @@ def _set_disable_on_model(self, val):
2323
self.env["ir.model"]._get("res.partner").rpc_config_edit = json.dumps(
2424
{"disable": val}
2525
)
26-
self.env["ir.model"].flush()
26+
self.env.flush_all()
2727

2828
def tearDown(self):
2929
klass = type(self.env["res.partner"])
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../rpc_helper

setup/rpc_helper/setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import setuptools
2+
3+
setuptools.setup(
4+
setup_requires=['setuptools-odoo'],
5+
odoo_addon=True,
6+
)

0 commit comments

Comments
 (0)