diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-08-14 09:44:51 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-08-14 09:44:51 +0700 |
| commit | 0d55911725d5c6da84acadd654ce5d050603f6ed (patch) | |
| tree | 317f99df688fb7104f4f1b242f1028436e172e7e | |
| parent | bbc1f241fb12e8a1115fdbc90ab5846bcfd47ee3 (diff) | |
| parent | 497cb94e2c75f6f3b0066700ed1f4b1be9ed1a59 (diff) | |
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into odoo-backup
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 33 | ||||
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 4 |
2 files changed, 7 insertions, 30 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index 273bcdf9..b0ffd8b9 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -121,20 +121,6 @@ class AccountMove(models.Model): else: move.payment_date = False - # def name_get(self): - # result = [] - # for move in self: - # if move.move_type == 'entry': - # # Jika masih draft, tampilkan 'Draft CAB' - # if move.state == 'draft': - # label = 'Draft CAB' - # else: - # label = move.name - # result.append((move.id, label)) - # else: - # # Untuk invoice dan lainnya, pakai default - # result.append((move.id, move.display_name)) - # return result def send_due_invoice_reminder(self): today = fields.Date.today() @@ -146,31 +132,22 @@ class AccountMove(models.Model): today + timedelta(days=7), ] - # --- TESTING --- - # partner = self.env['res.partner'].search([('name', 'ilike', 'DIRGANTARA YUDHA ARTHA')], limit=1) - # if not partner: - # _logger.info("Partner tidak ditemukan.") - # return - # invoices = self.env['account.move'].search([ - # ('move_type', '=', 'out_invoice'), - # ('state', '=', 'posted'), - # ('payment_state', 'not in', ['paid', 'in_payment', 'reversed']), - # ('invoice_date_due', 'in', target_dates), - # ('partner_id', '=', partner.id), - # ]) + for days_after_due in range(14, 181, 7): + target_dates.append(today - timedelta(days=days_after_due)) invoices = self.env['account.move'].search([ ('move_type', '=', 'out_invoice'), ('state', '=', 'posted'), ('payment_state', 'not in', ['paid', 'in_payment', 'reversed']), ('invoice_date_due', 'in', target_dates), + ('date_terima_tukar_faktur', '!=', False) ]) - _logger.info(f"Invoices tahap 1: {invoices}") + _logger.info(f"Invoices: {invoices}") invoices = invoices.filtered( lambda inv: inv.invoice_payment_term_id and 'tempo' in (inv.invoice_payment_term_id.name or '').lower() ) - _logger.info(f"Invoices tahap 2: {invoices}") + # _logger.info(f"Invoices tahap 2: {invoices}") if not invoices: _logger.info("Tidak ada invoice yang due") diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index a7dc59ba..0acfa0b0 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -2188,7 +2188,7 @@ class SaleOrder(models.Model): self.check_product_bom() self.check_credit_limit() self.check_limit_so_to_invoice() - # order.approval_status = 'approved' + order.approval_status = 'pengajuan1' return self._create_approval_notification('Team Sales') raise UserError("Bisa langsung Confirm") @@ -2418,7 +2418,7 @@ class SaleOrder(models.Model): order.approval_status = 'pengajuan1' return self._create_approval_notification('Sales Manager') elif order._requires_approval_team_sales(): - # order.approval_status = 'approved' + order.approval_status = 'pengajuan1' return self._create_approval_notification('Team Sales') order.approval_status = 'approved' |
