diff options
| -rw-r--r-- | indoteknik_custom/models/ir_actions_report.py | 2 | ||||
| -rw-r--r-- | indoteknik_custom/models/website_telegram.py | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/indoteknik_custom/models/ir_actions_report.py b/indoteknik_custom/models/ir_actions_report.py index 7b1dcee8..31bcf168 100644 --- a/indoteknik_custom/models/ir_actions_report.py +++ b/indoteknik_custom/models/ir_actions_report.py @@ -29,4 +29,4 @@ class IrActionsReport(models.Model): self._check_telegram(pick) else: telegram = self.env['website.telegram'].create(telegram_data) - telegram.create_channel() + telegram.create_channel(sale_order.name + " Telah di print Oleh " + self.env.user.name) diff --git a/indoteknik_custom/models/website_telegram.py b/indoteknik_custom/models/website_telegram.py index 7d76f27d..74955b7b 100644 --- a/indoteknik_custom/models/website_telegram.py +++ b/indoteknik_custom/models/website_telegram.py @@ -41,10 +41,10 @@ class WebsiteTelegram(models.Model): # Gabungkan semua nomor menjadi satu string, dipisahkan koma record.username_to_add = ', '.join(usernames) - def create_channel(self, *args, **kwargs): - asyncio.run(self._async_create_channel()) + def create_channel(self, message): + asyncio.run(self._async_create_channel(message)) - async def _async_create_channel(self): + async def _async_create_channel(self, message): async with TelegramClient(StringSession( '1BVtsOJABu30MWCBFwYvvaYbFoIWi43r5a7TUZ2IWwrnSlXIwEhJS5k2y4UKjoDeMPKwhgUWn9lMk02zQjM0ZDzq61YyhkRBvZuu3hCxMsrtP92bkuZtL2g3g1VgI8s7rMhOD_WaGrZbuj-TmbTwIEbN5i1J4raDW2kYzmlLRCbT74xxrGjpzWCnVv7CSS9L2juXuut0lLMgli3_JZbqDO1IyBYh4ZFQYbMf7zv6moDR4MQp1qfnFArsikQcfxjlNXKFcSoyA_GjiIFfCuymwQVtdERXOAH03M_lm8fYbjvgxEkJvxR6hdCnYMcKpIujEEo9SmMmK7Vnl29g1TCPO5tlrDNXq3Ng='), 27799517, 'df8ee44b0ed11108245037d47b511201') as client: @@ -68,10 +68,10 @@ class WebsiteTelegram(models.Model): users=[user_to_add.id], )) # message = 'https://erp.indoteknik.com/web#id=' + self.id_data + '&action=209&model=sale.order&view_type=form&cids=1&menu_id=101' - message = 'https://erp.indoteknik.com/web#id=' + self.id_data + '&action=357&model=sale.order&view_type=form&cids=1&menu_id=212' + message_template = 'https://erp.indoteknik.com/web#id=' + self.id_data + '&action=357&model=sale.order&view_type=form&cids=1&menu_id=212' message2 = self.tittle + ' di print oleh ' + self.env.user.name - result_massage = await client(SendMessageRequest(channel, message)) - result_massage2 = await client(SendMessageRequest(channel, message2)) + result_massage = await client(SendMessageRequest(channel, message_template)) + result_massage2 = await client(SendMessageRequest(channel, message)) # Send the poll to the channel using PeerChannel with the channel's ID # result_polling = await client(SendMediaRequest( |
