From 9a6918c3ee15cbed74af9fcf838a667dac166b32 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Fri, 10 Nov 2023 13:52:18 +0700 Subject: add other info in commision and add name in dunning run --- indoteknik_custom/models/commision.py | 4 ++++ indoteknik_custom/models/dunning_run.py | 1 + indoteknik_custom/views/customer_commision.xml | 8 ++++++++ 3 files changed, 13 insertions(+) diff --git a/indoteknik_custom/models/commision.py b/indoteknik_custom/models/commision.py index d4942a0d..a11d85c7 100644 --- a/indoteknik_custom/models/commision.py +++ b/indoteknik_custom/models/commision.py @@ -148,6 +148,10 @@ class CustomerCommision(models.Model): ('cashback', 'Cashback'), ('rebate', 'Rebate'), ], string='Commision Type', required=True) + bank_name = fields.Char(string='Bank', tracking=3) + account_name = fields.Char(string='Account Name', tracking=3) + bank_account = fields.Char(string='Account No', tracking=3) + note_transfer = fields.Char(string='Keterangan') # add status for type of commision, fee, rebate / cashback # include child or not? diff --git a/indoteknik_custom/models/dunning_run.py b/indoteknik_custom/models/dunning_run.py index 8e5b2c19..abfd68be 100644 --- a/indoteknik_custom/models/dunning_run.py +++ b/indoteknik_custom/models/dunning_run.py @@ -10,6 +10,7 @@ class DunningRun(models.Model): _name = 'dunning.run' _description = 'Dunning Run' _order = 'dunning_date desc, id desc' + _rec_name = 'number' number = fields.Char(string='Document No', index=True, copy=False, readonly=True) dunning_date = fields.Date(string='Dunning Date', required=True) diff --git a/indoteknik_custom/views/customer_commision.xml b/indoteknik_custom/views/customer_commision.xml index 008c79f8..993521ca 100644 --- a/indoteknik_custom/views/customer_commision.xml +++ b/indoteknik_custom/views/customer_commision.xml @@ -72,6 +72,14 @@ + + + + + + + +
-- cgit v1.2.3 From e7dc713b08b356100960e93d552b3a3a2a31727c Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Fri, 10 Nov 2023 16:28:06 +0700 Subject: Fix bug voucher --- indoteknik_custom/models/voucher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indoteknik_custom/models/voucher.py b/indoteknik_custom/models/voucher.py index 66c50c24..2eedc861 100644 --- a/indoteknik_custom/models/voucher.py +++ b/indoteknik_custom/models/voucher.py @@ -219,7 +219,7 @@ class Voucher(models.Model): tnc.append(f'
  • Voucher berlaku {self._res_remaining_time()} lagi
  • ') tnc.append(f'
  • Voucher tidak bisa digunakan apabila terdapat produk flash sale
  • ') if len(self.voucher_line) > 0: - brand_names = ', '.join([x.manufacture_id.x_name for x in self.voucher_line]) + brand_names = ', '.join([x.manufacture_id.x_name or '' for x in self.voucher_line]) tnc.append(f'
  • Voucher berlaku untuk produk dari brand {brand_names}
  • ') tnc.append(self.generate_detail_tnc()) tnc.append('') -- cgit v1.2.3 From 49846bc78d282516092c6c63db63d4ea01d42949 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Mon, 13 Nov 2023 15:31:43 +0700 Subject: remove divide tax while flashsale --- indoteknik_api/models/product_product.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py index aa9e0ad7..1db58d8e 100644 --- a/indoteknik_api/models/product_product.py +++ b/indoteknik_api/models/product_product.py @@ -273,7 +273,8 @@ class ProductProduct(models.Model): base_price = 0 if base_pricelist: - base_price = base_pricelist.computed_price / 1.11 + base_price = base_pricelist.computed_price + # base_price = base_pricelist.computed_price / 1.11 discount = 0 price_flashsale = 0 -- cgit v1.2.3 From 132d4b80f3d5dad792468bd14961f6a9540122e2 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Wed, 15 Nov 2023 10:32:25 +0700 Subject: add new role for wms and fix bug delete reconcile --- indoteknik_api/controllers/api_v1/user.py | 10 +++++++++- indoteknik_custom/models/account_move.py | 5 +++-- indoteknik_custom/models/users.py | 2 ++ indoteknik_custom/views/users.xml | 2 ++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/indoteknik_api/controllers/api_v1/user.py b/indoteknik_api/controllers/api_v1/user.py index 7a522d0c..2b297e5d 100644 --- a/indoteknik_api/controllers/api_v1/user.py +++ b/indoteknik_api/controllers/api_v1/user.py @@ -42,9 +42,17 @@ class User(controller.Controller): uid = request.session.authenticate( config.get('db_name'), email, password) user = request.env['res.users'].browse(uid) + role = [] + if user.is_inbound and user.is_outbound: + role.append('admin') + elif user.is_outbound: + role.append('outbound') + elif user.is_inbound: + role.append('inbound') data = { 'is_auth': True, - 'user': self.response_with_token(user) + 'role': role, + 'user': self.response_with_token(user), } return self.response(data) except: diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index fe9db583..d55cca38 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -48,8 +48,9 @@ class AccountMove(models.Model): def unlink(self): res = super(AccountMove, self).unlink() - if self.state == 'posted': - raise UserError('Data Hanya Bisa Di Cancel') + for rec in self: + if rec.state == 'posted': + raise UserError('Data Hanya Bisa Di Cancel') return res def button_cancel(self): diff --git a/indoteknik_custom/models/users.py b/indoteknik_custom/models/users.py index 2ff9933e..d95b56e7 100644 --- a/indoteknik_custom/models/users.py +++ b/indoteknik_custom/models/users.py @@ -12,6 +12,8 @@ class Users(models.Model): is_logistic_approver = fields.Boolean(string='Logistic Approver', help='Berhak Approval Penerimaan Barang') is_editor_product = fields.Boolean(string='Editor Product', help='Berhak Mengedit Data Product') is_admin_reconcile = fields.Boolean(string='Admin Reconcile', help='Berhak Mengedit Journal Reconcile') + is_inbound = fields.Boolean(string='Operator Inbound') + is_outbound = fields.Boolean(string='Operator Outbound') def notify_internal_users(self, message, title): users = self.search([('share', '=', False)]) diff --git a/indoteknik_custom/views/users.xml b/indoteknik_custom/views/users.xml index 020d8ddc..6519aeaa 100644 --- a/indoteknik_custom/views/users.xml +++ b/indoteknik_custom/views/users.xml @@ -14,6 +14,8 @@ + + -- cgit v1.2.3