From e1621acf8c11052405aa3ca46ad160fedc310e0a Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Mon, 25 Aug 2025 13:45:25 +0700 Subject: (andri) on reminder --- indoteknik_custom/models/account_move.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 599b3220..905855c6 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -180,7 +180,7 @@ class AccountMove(models.Model): ('payment_state', 'not in', ['paid', 'in_payment', 'reversed']), ('invoice_date_due', 'in', target_dates), ('date_terima_tukar_faktur', '!=', False) - ], limit=5) + ]) _logger.info(f"Invoices: {invoices}") invoices = invoices.filtered( @@ -331,7 +331,7 @@ class AccountMove(models.Model): 'reply_to': 'finance@indoteknik.co.id', } - # template.send_mail(invs[0].id, force_send=True, email_values=values) + template.send_mail(invs[0].id, force_send=True, email_values=values) _logger.info(f"Mengirim email ke: {values['email_to']} > email CC: {values['email_cc']}") _logger.info(f"Reminder terkirim ke {partner.name} ({values['email_to']}) → {len(invs)} invoice (dtd = {dtd})") # flag -- cgit v1.2.3 From d412ba89e0afba1965216aff871647115577cf75 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Mon, 25 Aug 2025 17:10:58 +0700 Subject: (andri) add search no dok cust benefits --- indoteknik_custom/views/customer_commision.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indoteknik_custom/views/customer_commision.xml b/indoteknik_custom/views/customer_commision.xml index 514e6284..7c72d86a 100644 --- a/indoteknik_custom/views/customer_commision.xml +++ b/indoteknik_custom/views/customer_commision.xml @@ -164,6 +164,7 @@ + Date: Wed, 27 Aug 2025 10:36:39 +0700 Subject: fix res partner --- indoteknik_custom/models/res_partner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indoteknik_custom/models/res_partner.py b/indoteknik_custom/models/res_partner.py index 1dba200a..7a714ea7 100644 --- a/indoteknik_custom/models/res_partner.py +++ b/indoteknik_custom/models/res_partner.py @@ -279,11 +279,12 @@ class ResPartner(models.Model): if record.name: existing_partner = self.env['res.partner'].search([ ('id', '!=', record.id), + '|', ('name', '=', record.name), ('email', '=', record.email) ], limit=1) - if existing_partner: + if existing_partner and not record.parent_id: raise ValidationError(f"Nama '{record.name}' dengan email '{record.email}' sudah digunakan oleh partner lain!") @api.constrains('npwp') -- cgit v1.2.3 From 2103a438acc24ad44965b869a28a15424838c9b5 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Wed, 27 Aug 2025 13:39:59 +0700 Subject: (andri) 1. add sum open amount & add field amount total SO pada DE, 2. sum total amount pada dunning run --- indoteknik_custom/models/account_move_due_extension.py | 15 +++++++++++++++ indoteknik_custom/views/account_move_views.xml | 3 ++- indoteknik_custom/views/dunning_run.xml | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/indoteknik_custom/models/account_move_due_extension.py b/indoteknik_custom/models/account_move_due_extension.py index d354e3e3..40059bd9 100644 --- a/indoteknik_custom/models/account_move_due_extension.py +++ b/indoteknik_custom/models/account_move_due_extension.py @@ -14,6 +14,16 @@ class DueExtension(models.Model): number = fields.Char(string='Document No', index=True, copy=False, readonly=True, tracking=True) partner_id = fields.Many2one('res.partner', string="Customer", readonly=True) order_id = fields.Many2one('sale.order', string="SO", readonly=True) + amount_total = fields.Monetary( + string="Amount Total SO", + compute="_compute_amount_total", + readonly=True + ) + currency_id = fields.Many2one( + 'res.currency', + related="order_id.currency_id", + readonly=True + ) invoice_id = fields.Many2one('account.move', related='due_line.invoice_id', string='Invoice', readonly=False) due_line = fields.One2many('due.extension.line', 'due_id', string='Due Extension Lines', auto_join=True) old_due = fields.Date(string="Old Due") @@ -34,6 +44,11 @@ class DueExtension(models.Model): approve_by = fields.Many2one('res.users', string="Approve By", readonly=True) date_approve = fields.Datetime(string="Date Approve", readonly=True) + @api.depends('order_id') + def _compute_amount_total(self): + for rec in self: + rec.amount_total = rec.order_id.amount_total if rec.order_id else 0.0 + def _compute_counter(self): for due in self: due.counter = due.partner_id.counter diff --git a/indoteknik_custom/views/account_move_views.xml b/indoteknik_custom/views/account_move_views.xml index 0fd7c9cd..7c1f8913 100644 --- a/indoteknik_custom/views/account_move_views.xml +++ b/indoteknik_custom/views/account_move_views.xml @@ -33,7 +33,7 @@ - + @@ -68,6 +68,7 @@ + diff --git a/indoteknik_custom/views/dunning_run.xml b/indoteknik_custom/views/dunning_run.xml index 2117a7bb..210f7917 100644 --- a/indoteknik_custom/views/dunning_run.xml +++ b/indoteknik_custom/views/dunning_run.xml @@ -29,7 +29,7 @@ - + -- cgit v1.2.3