diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-12-04 15:31:54 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-12-04 15:31:54 +0700 |
| commit | 6ad0aa164ed76c8889fd76bff99f5d57b1ac1b2e (patch) | |
| tree | 3b3859e987565acf372fb01e75c0cd537f052710 | |
| parent | 1094670e6fc35e5150b612b32e1f497b36c022b3 (diff) | |
<iman> add telegram
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 14 | ||||
| -rw-r--r-- | indoteknik_custom/models/website_telegram.py | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 7fc6d96a..88bbe3cf 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -145,6 +145,20 @@ class SaleOrder(models.Model): ('NP', 'Non Pareto') ]) + def action_print_proforma_invoice(self): + """Cetak laporan Jasper secara langsung""" + self.ensure_one() + # Konfigurasi laporan Jasper + report_action = self.env['ir.actions.report'].search([ + ('model', '=', 'sale.order'), + ('report_name', '=', 'Proforma Invoice New') + ], limit=1) + + if report_action: + return report_action.report_action(self) + else: + raise ValueError('Report not found!') + @api.onchange('payment_status') def _is_continue_transaction(self): if not self.is_continue_transaction: diff --git a/indoteknik_custom/models/website_telegram.py b/indoteknik_custom/models/website_telegram.py index 8bd789a1..e17da371 100644 --- a/indoteknik_custom/models/website_telegram.py +++ b/indoteknik_custom/models/website_telegram.py @@ -45,8 +45,8 @@ class WebsiteTelegram(models.Model): peer=InputPeerChannel(channel_id=channel.channel_id, access_hash=result.chats[0].access_hash), )) self.invite_link = channel_link.link - username_to_add = ['@imsep81', '6285764475716', '@stephanchrst'] - # username_to_add = ['@imsep81'] + # username_to_add = ['@imsep81', '6285764475716', '@stephanchrst'] + username_to_add = ['@imsep81'] for name in username_to_add: user_to_add = await client.get_entity(name) result_add_user = await client(functions.channels.InviteToChannelRequest( |
