summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIndoteknik . <it@fixcomart.co.id>2025-08-15 13:59:36 +0700
committerIndoteknik . <it@fixcomart.co.id>2025-08-15 13:59:36 +0700
commitc9111bcf2c71a5dac6f13dc5aceb55956127a055 (patch)
tree9e0a3dfab1bd58b39b04ba2911cadd6e779852ab
parent62b3f5f6aa6f6b5dfb06387487d2c1756a712778 (diff)
(andri) fix
-rw-r--r--indoteknik_api/controllers/api_v1/user.py16
-rw-r--r--indoteknik_custom/models/user_company_request.py4
2 files changed, 17 insertions, 3 deletions
diff --git a/indoteknik_api/controllers/api_v1/user.py b/indoteknik_api/controllers/api_v1/user.py
index 9044e69c..d134fc5a 100644
--- a/indoteknik_api/controllers/api_v1/user.py
+++ b/indoteknik_api/controllers/api_v1/user.py
@@ -674,7 +674,7 @@ class User(controller.Controller):
# request_company.send_company_request_mail_switch()
request_company.send_company_request_mail_switch()
- response['switch'] = 'Pending'
+ response['switch'] = 'pending'
return self.response(response)
@http.route(prefix + 'user/<id>/switch_progres', auth='public', methods=['GET', 'OPTIONS'], csrf=False)
@@ -699,6 +699,20 @@ class User(controller.Controller):
response['status'] = False
return self.response(response)
+ # @http.route(prefix + 'user/<id>/parent_status', auth='public', methods=['GET', 'OPTIONS'], csrf=False)
+ # # @controller.Controller.must_authorized()
+ # def parent_status(self, **kw):
+ # id = int(kw.get('id'))
+ # response = {
+ # 'parentId': None,
+ # 'parentName': None
+ # }
+ # partner = request.env['res.partner'].sudo().search([('id', '=', id)], limit=1)
+ # if partner and partner.parent_id:
+ # response['parentId'] = partner.parent_id.id
+ # response['parentName'] = partner.parent_id.name
+ # return self.response(response)
+
def get_user_by_email(self, email):
return request.env['res.users'].search([
('login', '=', email),
diff --git a/indoteknik_custom/models/user_company_request.py b/indoteknik_custom/models/user_company_request.py
index 2261545f..284575aa 100644
--- a/indoteknik_custom/models/user_company_request.py
+++ b/indoteknik_custom/models/user_company_request.py
@@ -105,8 +105,8 @@ class UserCompanyRequest(models.Model):
self.user_id.property_account_payable_id = user_company_id.property_account_payable_id if user_company_id else self.user_company_id.property_account_payable_id
self.user_id.property_payment_term_id = user_company_id.property_payment_term_id if user_company_id else self.user_company_id.property_payment_term_id
self.user_id.property_supplier_payment_term_id = user_company_id.property_supplier_payment_term_id if user_company_id else self.user_company_id.property_supplier_payment_term_id
- self.user_id.is_company = True
- self.user_id.active = True
+ # self.user_id.is_company = True
+ # self.user_id.active = True
self.user_company_id.active = True
user.send_company_switch_approve_mail() if vals.get('is_switch_account') == True else user.send_company_request_approve_mail()
else: