summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/commission_internal.py
diff options
context:
space:
mode:
authorFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2026-01-09 14:43:31 +0700
committerFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2026-01-09 14:43:31 +0700
commite8291422441d48909252471282c4b72372cccefb (patch)
tree60e1e280dc5bfc8d670523b04ff4582a8a35e9bb /indoteknik_custom/models/commission_internal.py
parentff058e22f64cd3e2dbd69d835f68877f530820c3 (diff)
parentae961c97d736359f6611db82ee484707f581ab0f (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into magento-solr-v1
Diffstat (limited to 'indoteknik_custom/models/commission_internal.py')
-rw-r--r--indoteknik_custom/models/commission_internal.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/indoteknik_custom/models/commission_internal.py b/indoteknik_custom/models/commission_internal.py
index cd6da380..840700c6 100644
--- a/indoteknik_custom/models/commission_internal.py
+++ b/indoteknik_custom/models/commission_internal.py
@@ -1,4 +1,4 @@
-from odoo import models, api, fields
+from odoo import models, api, fields, _
from odoo.exceptions import AccessError, UserError, ValidationError
from datetime import timedelta, date
import logging
@@ -178,6 +178,11 @@ class CommissionInternal(models.Model):
# fill later TODO @stephan
def calculate_commission_internal_result(self):
+ if self.commission_internal_result:
+ raise UserError('Hapus semua isi table result jika ingin di create result ulang')
+
+ self.message_post(body=("Commission Internal Result generated by %s at %s.") % (self.env.user.name, fields.Datetime.now()))
+
exception = ['ONGKOS KIRIM SO/20']
query = [
('commission_internal_id.id', '=', self.id),
@@ -259,6 +264,7 @@ class CommissionInternal(models.Model):
'res_name': data['res_name'],
'res_id': data['res_id'],
'name': data['name'],
+ 'customer': data['customer'],
'salesperson': data['salesperson'],
'totalamt': data['amount_total'],
'uang_masuk_line_id': data['uang_masuk_line_id'],
@@ -271,7 +277,6 @@ class CommissionInternal(models.Model):
'helper1': data['helper1'],
'helper2': data['helper2']
}])
- print(1)
# this button / method works for train data in July 2025
def calculate_commission_internal_from_keyword(self):
@@ -286,6 +291,7 @@ class CommissionInternal(models.Model):
self._calculate_keyword_undefined()
# execute helper2 for parse the label into INV/ or SO/ and switch SO to INV if available
self._parse_label_helper2()
+ self.message_post(body=("Commission Internal Line calculated by %s at %s.") % (self.env.user.name, fields.Datetime.now()))
def generate_commission_from_generate_ledger(self):
if self.commission_internal_line:
@@ -321,6 +327,7 @@ class CommissionInternal(models.Model):
'balance': ledger.balance
}])
count += 1
+ self.message_post(body=("Commission Internal Line generated by %s at %s") % (self.env.user.name, fields.Datetime.now()))
_logger.info("Commission Internal Line generated %s" % count)
@@ -390,3 +397,4 @@ class CommissionInternalResult(models.Model):
helper3 = fields.Char(string='Helper3')
helper4 = fields.Char(string='Helper4')
helper5 = fields.Char(string='Helper5')
+ customer = fields.Char(string='Customer')