summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/stock_picking.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-12-10 13:21:14 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-12-10 13:21:14 +0700
commit1bf746c93dc5010e30490d0a5ed6a2a174726be0 (patch)
tree27be1d61e8d5985e4d202a2723a063445f782348 /indoteknik_custom/models/stock_picking.py
parentbab6a911535b771e988093725e0ba378c77297c6 (diff)
<iman> update code telegram print so when amount > 200jt
Diffstat (limited to 'indoteknik_custom/models/stock_picking.py')
-rw-r--r--indoteknik_custom/models/stock_picking.py34
1 files changed, 0 insertions, 34 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 2095e957..31c45531 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -468,40 +468,6 @@ class StockPicking(models.Model):
raise UserError('Harus Sales Admin yang Ask Return')
else:
raise UserError('Harus Purchasing yang Ask Return')
- telegram_data = {
- 'tittle': self.name,
- 'about': 'Permintaan retur ' + self.name,
- 'id_data': self.id,
- 'username': '@'+self.name.replace('/', '')
- }
- channel_data = self.env['website.telegram'].search([('tittle', '=', self.name)])
- if channel_data:
- for pick in self:
- self._check_telegram(pick)
- else:
- telegram = request.env['website.telegram'].create(telegram_data)
- telegram.create_channel()
- for pick in self:
- pick.approval_return_status = 'pengajuan1'
-
- def read(self, fields=None, load='_classic_read'):
- # Panggil method 'read' bawaan terlebih dahulu
- records = super(StockPicking, self).read(fields, load)
-
- # Jalankan _check_telegram untuk setiap record yang diakses
- for record in self:
- if record.approval_return_status == 'pengajuan1':
- record._check_telegram()
-
- return records
-
-
- def _check_telegram(self):
- telegram = self.env['website.telegram'].search([('id_data', '=', self.id)])
- if telegram:
- ask_return = telegram.receive_messages()
- if ask_return:
- self.approval_return_status = 'approved'
def calculate_line_no(self):