summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-08-07 13:27:28 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-08-07 13:27:28 +0700
commit757ad58d71344a48a6196296551dbfba68fa26d2 (patch)
treef4de2c4b39f4ff48c5ae6965efb66e8fbf565f47
parentb223b752b43eb0aa8fd685d895d5649996473baf (diff)
parentd1a6e4a2d63cf3dd82ede0f8906957675ca38934 (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into odoo-backup
-rw-r--r--indoteknik_custom/models/account_move.py8
-rw-r--r--indoteknik_custom/views/account_move.xml3
2 files changed, 10 insertions, 1 deletions
diff --git a/indoteknik_custom/models/account_move.py b/indoteknik_custom/models/account_move.py
index 595c5655..c5e01f0c 100644
--- a/indoteknik_custom/models/account_move.py
+++ b/indoteknik_custom/models/account_move.py
@@ -95,6 +95,14 @@ class AccountMove(models.Model):
)
payment_date = fields.Date(string="Payment Date", compute='_compute_payment_date')
+ partial_payment = fields.Float(string="Partial Payment", compute='compute_partial_payment')
+
+ def compute_partial_payment(self):
+ for move in self:
+ if move.amount_total_signed > 0 and move.amount_residual_signed > 0 and move.payment_state == 'partial':
+ move.partial_payment = move.amount_total_signed - move.amount_residual_signed
+ else:
+ move.partial_payment = 0
def _compute_payment_date(self):
for move in self:
diff --git a/indoteknik_custom/views/account_move.xml b/indoteknik_custom/views/account_move.xml
index 23f2d931..e5d1cf8a 100644
--- a/indoteknik_custom/views/account_move.xml
+++ b/indoteknik_custom/views/account_move.xml
@@ -29,7 +29,8 @@
</field>
<field name="payment_reference" position="after">
<field name="date_completed" readonly="1" attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}"/>
- <field name="payment_date" readonly="1" attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}"/>
+ <field name="payment_date" readonly="1" attrs="{'invisible': [('move_type', '!=', 'out_invoice'), ('payment_date', '=', False)]}"/>
+ <field name="partial_payment" readonly="1" attrs="{'invisible': [('move_type', '!=', 'out_invoice'), ('payment_state', '!=', 'partial')]}"/>
<field name="reklas_id" attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}"/>
</field>
<field name="invoice_date" position="after">