Manual Entitlement causing error to other entitlements
Details: Other entitlements like OpenSPP Cash Entitlement is not useable when OpenSPP Manual Entitlement is also installed.
Steps to replicate:
- Install both
OpenSPP Cash EntitlementandOpenSPP Manual Entitlement. - Go to Program and click Create Program
- Fill up required fields then go to
Configure the Entitlement ManagerTab. - in the Entitlement manager field, select
Cashthen fill all required fields. - then proceed on creating the program.
- Upon clicking the Create button, the error will show.
Cause of error: the function in this file https://github.com/OpenSPP/openspp-modules/blob/0d00c990ce20f3f2661f545baac31934c6fa21fd/spp_manual_entitlement/wizard/create_program_wizard.py#L16 was overwriten instead of extending. This function should be extended only since it is also used by other entitlement managers.
Possible solution: Use super() to extend the function. use this file for reference https://github.com/OpenSPP/openspp-modules/blob/0d00c990ce20f3f2661f545baac31934c6fa21fd/spp_entitlement_in_kind/wizard/create_program_wizard.py#L48
PR that introduces the error: https://github.com/OpenSPP/openspp-modules/pull/343
Traceback error:
RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
File "/Users/red/odoo/odoo/http.py", line 1764, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/Users/red/odoo/odoo/service/model.py", line 133, in retrying
result = func()
File "/Users/red/odoo/odoo/http.py", line 1791, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "/Users/red/odoo/odoo/http.py", line 1995, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "/Users/red/odoo/odoo/addons/base/models/ir_http.py", line 222, in _dispatch
result = endpoint(**request.params)
File "/Users/red/odoo/odoo/http.py", line 741, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "/Users/red/odoo/addons/web/controllers/dataset.py", line 28, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/Users/red/odoo/addons/web/controllers/dataset.py", line 20, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/Users/red/odoo/odoo/api.py", line 468, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/Users/red/odoo/odoo/api.py", line 453, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/Users/red/odoo/custom_addons/openspp-registry/spp_programs/wizard/create_program_wizard.py", line 101, in create_program
vals.update(rec._get_entitlement_manager(program_id))
TypeError: 'NoneType' object is not iterable
The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
RPCError@http://localhost:8080/web/assets/e68bd04/web.assets_web.min.js:2871:324
makeErrorFromResponse@http://localhost:8080/web/assets/e68bd04/web.assets_web.min.js:2874:175
@http://localhost:8080/web/assets/e68bd04/web.assets_web.min.js:2878:34