diff options
| author | trisusilo48 <tri.susilo@altama.co.id> | 2024-10-02 09:44:39 +0700 |
|---|---|---|
| committer | trisusilo48 <tri.susilo@altama.co.id> | 2024-10-02 09:44:39 +0700 |
| commit | 2739d3040a69228192096ee16373610149a2fb47 (patch) | |
| tree | 545aa797d7407e8f22250dff15648495b891928f /indoteknik_custom/models/dunning_run.py | |
| parent | 4d3d219b5f1002822a16067a28261fd59b170ff8 (diff) | |
| parent | 7d3780ede67579b5891218efc370dc82eef510a1 (diff) | |
Merge branch 'production' of https://bitbucket.org/altafixco/indoteknik-addons into production
Diffstat (limited to 'indoteknik_custom/models/dunning_run.py')
| -rw-r--r-- | indoteknik_custom/models/dunning_run.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/indoteknik_custom/models/dunning_run.py b/indoteknik_custom/models/dunning_run.py index 90159cd0..c167aab7 100644 --- a/indoteknik_custom/models/dunning_run.py +++ b/indoteknik_custom/models/dunning_run.py @@ -30,7 +30,14 @@ class DunningRun(models.Model): is_paid = fields.Boolean(string='Paid') description = fields.Char(string='Description') comment = fields.Char(string='Comment') - + grand_total = fields.Float(string='Grand Total', compute="_compute_grand_total") + + def _compute_grand_total(self): + for record in self: + grand_total = 0 + for line in record.dunning_line: + grand_total += line.total_amt + record.grand_total = grand_total def copy_date_faktur(self): if not self.is_validated: |
