From 8bb599fc4b3e3de94fada7c277518446a88630fa Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Mon, 1 Sep 2025 15:50:14 +0700 Subject: (andri) add view unpaid invoices --- indoteknik_custom/models/unpaid_invoice_view.py | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 indoteknik_custom/models/unpaid_invoice_view.py (limited to 'indoteknik_custom/models/unpaid_invoice_view.py') diff --git a/indoteknik_custom/models/unpaid_invoice_view.py b/indoteknik_custom/models/unpaid_invoice_view.py new file mode 100644 index 00000000..77007102 --- /dev/null +++ b/indoteknik_custom/models/unpaid_invoice_view.py @@ -0,0 +1,28 @@ +from odoo import models, fields + +class UnpaidInvoiceView(models.Model): + _name = 'unpaid.invoice.view' + _description = 'Unpaid Invoices Monitoring' + _auto = False + _rec_name = 'partner_name' + + partner_id = fields.Many2one('res.partner', string='Partner') + partner_name = fields.Char(string='Partner Name') + email = fields.Char() + phone = fields.Char() + invoice_id = fields.Many2one('account.move', string='Invoice') + invoice_number = fields.Char(string='Invoice Number') + invoice_date = fields.Date() + invoice_date_due = fields.Date() + currency_id = fields.Many2one('res.currency', string='Currency') + amount_total = fields.Monetary(string='Total', currency_field='currency_id') + amount_residual = fields.Monetary(string='Residual', currency_field='currency_id') + payment_state = fields.Selection([ + ('not_paid','Not Paid'), + ('in_payment','In Payment'), + ('paid','Paid'), + ('reversed','Reversed') + ], string='Payment State') + payment_term = fields.Char() + invoice_day_to_due = fields.Integer(string="Day to Due") + new_invoice_day_to_due = fields.Integer(string="New Day Due") -- cgit v1.2.3 From 1330742f90b32c6dd214925ad893696cfae5ef38 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Mon, 1 Sep 2025 16:05:52 +0700 Subject: (andri) add string due date --- indoteknik_custom/models/unpaid_invoice_view.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indoteknik_custom/models/unpaid_invoice_view.py') diff --git a/indoteknik_custom/models/unpaid_invoice_view.py b/indoteknik_custom/models/unpaid_invoice_view.py index 77007102..517d078b 100644 --- a/indoteknik_custom/models/unpaid_invoice_view.py +++ b/indoteknik_custom/models/unpaid_invoice_view.py @@ -5,6 +5,7 @@ class UnpaidInvoiceView(models.Model): _description = 'Unpaid Invoices Monitoring' _auto = False _rec_name = 'partner_name' + _order = 'partner_name, new_invoice_day_to_due DESC' partner_id = fields.Many2one('res.partner', string='Partner') partner_name = fields.Char(string='Partner Name') @@ -13,7 +14,7 @@ class UnpaidInvoiceView(models.Model): invoice_id = fields.Many2one('account.move', string='Invoice') invoice_number = fields.Char(string='Invoice Number') invoice_date = fields.Date() - invoice_date_due = fields.Date() + invoice_date_due = fields.Date(string='Due Date') currency_id = fields.Many2one('res.currency', string='Currency') amount_total = fields.Monetary(string='Total', currency_field='currency_id') amount_residual = fields.Monetary(string='Residual', currency_field='currency_id') -- cgit v1.2.3 From 0d0e2b9a448f6f96a7ab06ecb970dbbd2018f5fe Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Tue, 2 Sep 2025 14:19:33 +0700 Subject: (andri) fix layout dan revisi field yang dibutuhkan --- indoteknik_custom/models/unpaid_invoice_view.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'indoteknik_custom/models/unpaid_invoice_view.py') diff --git a/indoteknik_custom/models/unpaid_invoice_view.py b/indoteknik_custom/models/unpaid_invoice_view.py index 517d078b..f6ce79b8 100644 --- a/indoteknik_custom/models/unpaid_invoice_view.py +++ b/indoteknik_custom/models/unpaid_invoice_view.py @@ -9,21 +9,22 @@ class UnpaidInvoiceView(models.Model): partner_id = fields.Many2one('res.partner', string='Partner') partner_name = fields.Char(string='Partner Name') - email = fields.Char() - phone = fields.Char() + # email = fields.Char() + # phone = fields.Char() invoice_id = fields.Many2one('account.move', string='Invoice') invoice_number = fields.Char(string='Invoice Number') invoice_date = fields.Date() invoice_date_due = fields.Date(string='Due Date') + date_terima_tukar_faktur = fields.Date(string='Terima Faktur') currency_id = fields.Many2one('res.currency', string='Currency') - amount_total = fields.Monetary(string='Total', currency_field='currency_id') - amount_residual = fields.Monetary(string='Residual', currency_field='currency_id') + amount_total = fields.Monetary(string='Total Amount', currency_field='currency_id') + amount_residual = fields.Monetary(string='Sisa Amount', currency_field='currency_id') payment_state = fields.Selection([ ('not_paid','Not Paid'), ('in_payment','In Payment'), ('paid','Paid'), ('reversed','Reversed') ], string='Payment State') - payment_term = fields.Char() + payment_term_id = fields.Many2one('account.payment.term', string='Payment Term') invoice_day_to_due = fields.Integer(string="Day to Due") new_invoice_day_to_due = fields.Integer(string="New Day Due") -- cgit v1.2.3 From a35dcc5907500e5189516459160c972bb72e1686 Mon Sep 17 00:00:00 2001 From: "Indoteknik ." Date: Tue, 2 Sep 2025 15:04:33 +0700 Subject: (andri) menambahkan field yang dibutuhkan --- indoteknik_custom/models/unpaid_invoice_view.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'indoteknik_custom/models/unpaid_invoice_view.py') diff --git a/indoteknik_custom/models/unpaid_invoice_view.py b/indoteknik_custom/models/unpaid_invoice_view.py index f6ce79b8..f35261eb 100644 --- a/indoteknik_custom/models/unpaid_invoice_view.py +++ b/indoteknik_custom/models/unpaid_invoice_view.py @@ -20,11 +20,16 @@ class UnpaidInvoiceView(models.Model): amount_total = fields.Monetary(string='Total Amount', currency_field='currency_id') amount_residual = fields.Monetary(string='Sisa Amount', currency_field='currency_id') payment_state = fields.Selection([ - ('not_paid','Not Paid'), - ('in_payment','In Payment'), - ('paid','Paid'), - ('reversed','Reversed') - ], string='Payment State') + ('not_paid', 'Not Paid'), + ('in_payment', 'In Payment'), + ('paid', 'Paid'), + ('partial', 'Partially Paid'), + ('reversed', 'Reversed')], string='Payment State') payment_term_id = fields.Many2one('account.payment.term', string='Payment Term') invoice_day_to_due = fields.Integer(string="Day to Due") new_invoice_day_to_due = fields.Integer(string="New Day Due") + + ref = fields.Char(string='Reference') + invoice_user_id = fields.Many2one('res.users', string='Salesperson') + date_kirim_tukar_faktur = fields.Date(string='Kirim Faktur') + sale_id = fields.Many2one('sale.order', string='Sale Order') -- cgit v1.2.3 From e12d3f75b57abc6231566c486a114cd0bfc01b8e Mon Sep 17 00:00:00 2001 From: AndriFP <113114423+andrifp@users.noreply.github.com> Date: Sun, 14 Sep 2025 20:24:18 +0700 Subject: (andri) add button create surat piutang di view form unpaid inv monitoring --- indoteknik_custom/models/unpaid_invoice_view.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indoteknik_custom/models/unpaid_invoice_view.py') diff --git a/indoteknik_custom/models/unpaid_invoice_view.py b/indoteknik_custom/models/unpaid_invoice_view.py index f35261eb..25e04968 100644 --- a/indoteknik_custom/models/unpaid_invoice_view.py +++ b/indoteknik_custom/models/unpaid_invoice_view.py @@ -33,3 +33,16 @@ class UnpaidInvoiceView(models.Model): invoice_user_id = fields.Many2one('res.users', string='Salesperson') date_kirim_tukar_faktur = fields.Date(string='Kirim Faktur') sale_id = fields.Many2one('sale.order', string='Sale Order') + + def action_create_surat_piutang(self): + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'res_model': 'surat.piutang', + 'view_mode': 'form', + 'target': 'current', + 'context': { + 'default_partner_id': self.partner_id.id, + 'default_selected_invoice_id': self.invoice_id.id, + } + } -- cgit v1.2.3 From 540136f8096f090b481d139c58c3f36c28aa69bb Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Sep 2025 15:01:02 +0700 Subject: (andri) add payment diff + fix onchange ketika pilih partner --- indoteknik_custom/models/unpaid_invoice_view.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indoteknik_custom/models/unpaid_invoice_view.py') diff --git a/indoteknik_custom/models/unpaid_invoice_view.py b/indoteknik_custom/models/unpaid_invoice_view.py index 25e04968..3eb6efc7 100644 --- a/indoteknik_custom/models/unpaid_invoice_view.py +++ b/indoteknik_custom/models/unpaid_invoice_view.py @@ -34,6 +34,13 @@ class UnpaidInvoiceView(models.Model): date_kirim_tukar_faktur = fields.Date(string='Kirim Faktur') sale_id = fields.Many2one('sale.order', string='Sale Order') + payment_difficulty = fields.Selection([ + ('bermasalah', 'Bermasalah'), + ('sulit', 'Sulit'), + ('agak_sulit', 'Agak Sulit'), + ('normal', 'Normal'), + ], string="Payment Difficulty") + def action_create_surat_piutang(self): self.ensure_one() return { -- cgit v1.2.3