odex30_standard/odex30_base/branch/controllers/main.py

14 lines
477 B
Python

# -*- coding: utf-8 -*-
# Part of BrowseInfo. See LICENSE file for full copyright and licensing details.
from odoo import http, _
from odoo.http import request
class SetBranch(http.Controller):
@http.route('/set_brnach', type='json', auth="public", methods=['POST'], website=True)
def custom_hours(self, BranchID, **post):
user_id = request.env['res.users'].sudo().search([('id','=',request.env.user.id)])
user_id.branch_id = BranchID
return