summaryrefslogtreecommitdiff
path: root/indoteknik_api/models
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-02-23 10:45:13 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-02-23 10:45:13 +0700
commiteb805076e595f1c757c29357c3e581c89d492138 (patch)
tree10ba613372eb7469342e1d8d34561ca6dd885b8c /indoteknik_api/models
parentb94e4ff577c023d0ce1717c01c6080efc988acb7 (diff)
parent5c9214c1c846e61c5356e1b19341b070c2303198 (diff)
Merge branch 'staging' of bitbucket.org:altafixco/indoteknik-addons into staging
Diffstat (limited to 'indoteknik_api/models')
-rw-r--r--indoteknik_api/models/res_users.py7
-rw-r--r--indoteknik_api/models/sale_order.py4
2 files changed, 8 insertions, 3 deletions
diff --git a/indoteknik_api/models/res_users.py b/indoteknik_api/models/res_users.py
index 99a3838d..5032f3af 100644
--- a/indoteknik_api/models/res_users.py
+++ b/indoteknik_api/models/res_users.py
@@ -7,6 +7,7 @@ class ResUsers(models.Model):
def api_single_response(self, res_user, with_detail=''):
data = {
'id': res_user.id,
+ 'parent_id': res_user.parent_id.id or False,
'partner_id': res_user.partner_id.id,
'name': res_user.name,
'email': res_user.login,
@@ -32,7 +33,11 @@ class ResUsers(models.Model):
'city': None,
'district': None,
'sub_district': None,
- 'zip': user.zip or ''
+ 'zip': user.zip or '',
+ 'company_type_id': user.company_type_id.id or None,
+ 'industry_id': user.industry_id.id or None,
+ 'tax_name': user.nama_wajib_pajak or '',
+ 'npwp': user.npwp or '',
}
if user.kota_id:
diff --git a/indoteknik_api/models/sale_order.py b/indoteknik_api/models/sale_order.py
index 66ef27fa..ca6baff0 100644
--- a/indoteknik_api/models/sale_order.py
+++ b/indoteknik_api/models/sale_order.py
@@ -33,9 +33,9 @@ class SaleOrder(models.Model):
picking_count['assigned'] += 1
if picking.state == 'done':
picking_count['done'] += 1
- if picking_count['assigned'] > 0:
+ if picking_count['done'] > 0:
data['status'] = 'shipping'
- if picking_count['done'] > 0:
+ if picking_count['assigned'] > 0:
data['status'] = 'partial_shipping'
if sale_order.state == 'done':
data['status'] = 'done'