diff options
| author | FIN-IT_AndriFP <it@fixcomart.co.id> | 2025-11-13 17:06:48 +0700 |
|---|---|---|
| committer | FIN-IT_AndriFP <it@fixcomart.co.id> | 2025-11-13 17:06:48 +0700 |
| commit | ae89c43f6efa66ac7e332e62ce6cc6817f75c16d (patch) | |
| tree | 91f481cfb81c3001ba0b9a1d38aca358041bbc12 | |
| parent | 39c95b7097f188350d71414c72f6abe7a711cf18 (diff) | |
(andri) add invoice payment widget di tree inv, unlock COA reimburse, and add tracking edit pricelist contact
| -rw-r--r-- | indoteknik_custom/models/account_move.py | 27 | ||||
| -rw-r--r-- | indoteknik_custom/models/advance_payment_request.py | 3 | ||||
| -rw-r--r-- | indoteknik_custom/models/res_partner.py | 3 | ||||
| -rw-r--r-- | indoteknik_custom/views/account_move.xml | 2 |
4 files changed, 32 insertions, 3 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py index c460a332..12e8ecba 100644 --- a/indoteknik_custom/models/account_move.py +++ b/indoteknik_custom/models/account_move.py @@ -3,7 +3,7 @@ from odoo.exceptions import AccessError, UserError, ValidationError from markupsafe import escape as html_escape from datetime import timedelta, date, datetime from pytz import timezone, utc -import logging +import logging, json import base64 import PyPDF2 import os @@ -108,6 +108,31 @@ class AccountMove(models.Model): ) internal_notes_contact = fields.Text(related='partner_id.comment', string="Internal Notes", readonly=True, help="Internal Notes dari contact utama customer.") + payment_info = fields.Text( + string="Payment Info", + compute='_compute_payment_info', + store=False, + help="Informasi pembayaran yang diambil dari payment yang sudah direkonsiliasi ke invoice ini." + ) + + def _compute_payment_info(self): + for rec in self: + summary = "" + try: + widget_data = rec.invoice_payments_widget + if widget_data: + data = json.loads(widget_data) + lines = [] + for item in data.get('content', []): + amount = item.get('amount', 0.0) + date = item.get('date') or item.get('payment_date') or '' + formatted_amount = formatLang(self.env, amount, currency_obj=rec.currency_id) + lines.append(f"<i>Paid on {date}</i> - {formatted_amount}") + summary = "\n".join(lines) if lines else (data.get('title', '') or "") + except Exception: + summary = "" + rec.payment_info = summary + # def _check_and_lock_cbd(self): # cbd_term = self.env['account.payment.term'].browse(26) # today = date.today() diff --git a/indoteknik_custom/models/advance_payment_request.py b/indoteknik_custom/models/advance_payment_request.py index 6ea1c160..42097923 100644 --- a/indoteknik_custom/models/advance_payment_request.py +++ b/indoteknik_custom/models/advance_payment_request.py @@ -909,8 +909,7 @@ class ReimburseLine(models.Model): date = fields.Date(string='Tanggal', required=True, default=fields.Date.today) account_id = fields.Many2one( 'account.account', - string='Jenis Biaya', tracking=3, - domain="[('id', 'in', [484, 486, 527, 529, 530, 471, 473, 492, 493, 488, 625, 528, 533, 534])]" + string='Jenis Biaya', tracking=3 ) description = fields.Text(string='Description', required=True, tracking=3) distance_departure = fields.Float(string='Pergi (Km)', tracking=3) diff --git a/indoteknik_custom/models/res_partner.py b/indoteknik_custom/models/res_partner.py index f80bbcb6..7f4feb75 100644 --- a/indoteknik_custom/models/res_partner.py +++ b/indoteknik_custom/models/res_partner.py @@ -200,6 +200,9 @@ class ResPartner(models.Model): string='Previous Payment Term' ) + property_product_pricelist = fields.Many2one( + tracking=True + ) @api.depends("street", "street2", "city", "state_id", "country_id", "blok", "nomor", "rt", "rw", "kelurahan_id", "kecamatan_id") diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml index 9df03674..c5f9580c 100644 --- a/indoteknik_custom/views/account_move.xml +++ b/indoteknik_custom/views/account_move.xml @@ -140,6 +140,8 @@ <field name="shipper_faktur_id" optional="hide"/> <field name="resi_tukar_faktur" optional="hide"/> <field name="date_terima_tukar_faktur" optional="hide"/> + <field name="payment_info" optional="hide" widget="html"/> + <field name="customer_promise_date" optional="hide"/> </field> </field> </record> |
