diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2025-07-10 07:16:30 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2025-07-10 07:16:30 +0000 |
| commit | 65b5393d5fc5bf0bd0dd88b9ad8a04645bf6d272 (patch) | |
| tree | d90a927ebc9444844013e76aa94475214a045cf5 | |
| parent | 00b357fa35ff809c153a5aeaf67f97a00715e463 (diff) | |
| parent | d42597543c17a72173d50aa66939c0f3ab776363 (diff) | |
Merged in sort_dunning_run (pull request #350)
<miqdad> sort dunning run based on invoice num
| -rw-r--r-- | indoteknik_custom/models/dunning_run.py | 4 | ||||
| -rw-r--r-- | indoteknik_custom/models/sale_order_line.py | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/indoteknik_custom/models/dunning_run.py b/indoteknik_custom/models/dunning_run.py index bb53fc0c..fdc730de 100644 --- a/indoteknik_custom/models/dunning_run.py +++ b/indoteknik_custom/models/dunning_run.py @@ -1,3 +1,4 @@ +from Tools.scripts.dutree import store from odoo import models, api, fields from odoo.exceptions import AccessError, UserError, ValidationError from datetime import timedelta @@ -123,8 +124,9 @@ class DunningRunLine(models.Model): _name = 'dunning.run.line' _description = 'Dunning Run Line' # _order = 'dunning_id, id' - _order = 'invoice_id desc, id' + _order = 'invoice_number asc, id' + invoice_number = fields.Char('Invoice Number', related='invoice_id.name') dunning_id = fields.Many2one('dunning.run', string='Dunning Ref', required=True, ondelete='cascade', index=True, copy=False) partner_id = fields.Many2one('res.partner', string='Customer') invoice_id = fields.Many2one('account.move', string='Invoice') diff --git a/indoteknik_custom/models/sale_order_line.py b/indoteknik_custom/models/sale_order_line.py index 291940ed..2a0160e8 100644 --- a/indoteknik_custom/models/sale_order_line.py +++ b/indoteknik_custom/models/sale_order_line.py @@ -5,6 +5,7 @@ from datetime import datetime, timedelta class SaleOrderLine(models.Model): _inherit = 'sale.order.line' + item_margin = fields.Float('Margin', compute='compute_item_margin', help="Total Margin in Sales Order Header") item_before_margin = fields.Float('Before Margin', compute='compute_item_before_margin', help="Total Margin in Sales Order Header") |
