diff options
| author | unknown <it@fixcomart.co.id> | 2025-09-16 15:01:02 +0700 |
|---|---|---|
| committer | unknown <it@fixcomart.co.id> | 2025-09-16 15:01:02 +0700 |
| commit | 540136f8096f090b481d139c58c3f36c28aa69bb (patch) | |
| tree | 564e27b879251c961afe6550058e9f47a1744bd0 /indoteknik_custom/models/letter_receivable.py | |
| parent | 462fb823c79d8652a6a08e267b00b13c7bbe5df0 (diff) | |
(andri) add payment diff + fix onchange ketika pilih partner
Diffstat (limited to 'indoteknik_custom/models/letter_receivable.py')
| -rw-r--r-- | indoteknik_custom/models/letter_receivable.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/indoteknik_custom/models/letter_receivable.py b/indoteknik_custom/models/letter_receivable.py index 79a4a3e0..63d7e726 100644 --- a/indoteknik_custom/models/letter_receivable.py +++ b/indoteknik_custom/models/letter_receivable.py @@ -31,7 +31,8 @@ class SuratPiutang(models.Model): line_ids = fields.One2many("surat.piutang.line", "surat_id", string="Invoice Lines") state = fields.Selection([ ("draft", "Draft"), - ("waiting_approval", "Menunggu Approval"), + ("waiting_approval_sales", "Menunggu Approval Sales Manager"), + ("waiting_approval_pimpinan", "Menunggu Approval Pimpinan"), ("sent", "Approved & Sent") ], default="draft", tracking=True) send_date = fields.Datetime(string="Tanggal Kirim", tracking=True) @@ -55,8 +56,9 @@ class SuratPiutang(models.Model): compute="_compute_grand_total_text", ) - perihal_label = fields.Char( - compute="_compute_perihal_label", string="Perihal Label") + perihal_label = fields.Char(compute="_compute_perihal_label", string="Perihal Label") + + payment_difficulty = fields.Selection(string="Payment Difficulty", related='partner_id.payment_difficulty', readonly=True) def _compute_perihal_label(self): for rec in self: @@ -248,8 +250,8 @@ class SuratPiutang(models.Model): order='new_invoice_day_to_due asc' ) selected_invoice_id = self.env.context.get('default_selected_invoice_id') - lines = [(0, 0, { - # 'invoice_view_id': inv.id, + lines = [(5, 0, 0)] # hapus semua line lama + lines += [(0, 0, { 'invoice_id': inv.invoice_id.id, 'invoice_number': inv.invoice_number, 'invoice_date': inv.invoice_date, |
