Merge pull request #3710 from expsa/kch_dev_odex25_mobile
Add new action
This commit is contained in:
commit
cffca5a511
|
|
@ -23,6 +23,7 @@
|
|||
},
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'data/data.xml',
|
||||
'views/attendance_zone_config_view.xml',
|
||||
'views/hr_employee_view.xml',
|
||||
'views/firebase_notifications.xml',
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ from odoo.http import request
|
|||
from ...http_helper import http_helper
|
||||
from ...validator import validator
|
||||
from datetime import date, datetime
|
||||
from ast import literal_eval
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -651,7 +652,16 @@ class HrOfficialMissionRelatedModelsController(http.Controller):
|
|||
# 2.2 Mission Destination
|
||||
@http.route(['/api/mission_destination'], type='http', auth='none', csrf=False, methods=['GET'])
|
||||
def get_mission_destination_list(self, **kw):
|
||||
destinations = request.env["mission.destination"].sudo().search([])
|
||||
param = request.env['ir.config_parameter'].sudo().get_param('mission.destination.domain', '[]')
|
||||
|
||||
# evaluate the string into a domain list
|
||||
try:
|
||||
domain = literal_eval(param)
|
||||
if not isinstance(domain, list):
|
||||
domain = []
|
||||
except Exception:
|
||||
domain = []
|
||||
destinations = request.env["mission.destination"].sudo().search(domain)
|
||||
data = []
|
||||
for dest in destinations:
|
||||
data.append({
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<record id="param_mission_destination_domain" model="ir.config_parameter">
|
||||
<field name="key">mission.destination.domain</field>
|
||||
<field name="value">[]</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
Loading…
Reference in New Issue