summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/res_partner.py
diff options
context:
space:
mode:
authorAndriFP <113114423+andrifp@users.noreply.github.com>2025-09-12 17:34:56 +0700
committerAndriFP <113114423+andrifp@users.noreply.github.com>2025-09-12 17:34:56 +0700
commite79284c1d0e8b364438163847491d51e450fcaa2 (patch)
tree9a9775a387685a7ee560e2e7b614fb25071ec4df /indoteknik_custom/models/res_partner.py
parentf2b1b0ec605b552c2bf225de46094cd4707197ee (diff)
parent7973c3153f852f154c04e1107206ebe90498e771 (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into form-sp
Diffstat (limited to 'indoteknik_custom/models/res_partner.py')
-rw-r--r--indoteknik_custom/models/res_partner.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/indoteknik_custom/models/res_partner.py b/indoteknik_custom/models/res_partner.py
index 148a3fd0..36570e8f 100644
--- a/indoteknik_custom/models/res_partner.py
+++ b/indoteknik_custom/models/res_partner.py
@@ -1,6 +1,6 @@
from odoo import models, fields, api
from odoo.exceptions import UserError, ValidationError
-from datetime import datetime
+from datetime import datetime, timedelta
from odoo.http import request
import re
import requests
@@ -181,10 +181,8 @@ class ResPartner(models.Model):
payment_difficulty = fields.Selection([('bermasalah', 'Bermasalah'),('sulit', 'Sulit'),('agak_sulit', 'Agak Sulit'),('normal', 'Normal')], string='Payment Difficulty', tracking=3)
payment_history_url = fields.Text(string='Payment History URL')
- # no compute
- # payment_diff = fields.Selection([('bermasalah', 'Bermasalah'),('sulit', 'Sulit'),('agak_sulit', 'Agak Sulit'),('normal', 'Normal')], string='Payment Difficulty', tracking=3)
-
- # tidak terpakai
+ is_cbd_locked = fields.Boolean("Locked to CBD?", default=False, tracking=True, help="Jika dicentang, maka partner ini terkunci pada payment term CBD karena memiliki invoice yang sudah jatuh tempo lebih dari 30 hari.")
+
@api.model
def _default_payment_term(self):
@@ -193,9 +191,10 @@ class ResPartner(models.Model):
property_payment_term_id = fields.Many2one(
'account.payment.term',
string='Payment Terms',
- default=_default_payment_term
+ default=_default_payment_term, tracking=3
)
+
@api.depends("street", "street2", "city", "state_id", "country_id", "blok", "nomor", "rt", "rw", "kelurahan_id",
"kecamatan_id")
def _alamat_lengkap_text(self):