diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-09-26 14:54:35 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-09-26 14:54:35 +0700 |
| commit | 3de421c1b8b21c56399c46f85c9d395023c68617 (patch) | |
| tree | 8d94b75707d6f8e316aed91785f394a9cd080f99 | |
| parent | 51f50fd417b6745872724bcc98737ea1df2c413f (diff) | |
<Miqdad> add payment term in Due extension
| -rw-r--r-- | indoteknik_custom/models/account_move_due_extension.py | 8 | ||||
| -rw-r--r-- | indoteknik_custom/views/account_move_views.xml | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/indoteknik_custom/models/account_move_due_extension.py b/indoteknik_custom/models/account_move_due_extension.py index 40059bd9..55fc6c65 100644 --- a/indoteknik_custom/models/account_move_due_extension.py +++ b/indoteknik_custom/models/account_move_due_extension.py @@ -13,6 +13,7 @@ class DueExtension(models.Model): number = fields.Char(string='Document No', index=True, copy=False, readonly=True, tracking=True) partner_id = fields.Many2one('res.partner', string="Customer", readonly=True) + payment_term = fields.Char(string="Payment Term", readonly=True, compute='_compute_payment_term') order_id = fields.Many2one('sale.order', string="SO", readonly=True) amount_total = fields.Monetary( string="Amount Total SO", @@ -43,7 +44,12 @@ class DueExtension(models.Model): counter = fields.Integer(string="Counter", compute='_compute_counter') approve_by = fields.Many2one('res.users', string="Approve By", readonly=True) date_approve = fields.Datetime(string="Date Approve", readonly=True) - + + @api.depends('partner_id') + def _compute_payment_term(self): + for rec in self: + rec.payment_term = rec.partner_id.property_payment_term_id.name + @api.depends('order_id') def _compute_amount_total(self): for rec in self: diff --git a/indoteknik_custom/views/account_move_views.xml b/indoteknik_custom/views/account_move_views.xml index 7c1f8913..08b93f1f 100644 --- a/indoteknik_custom/views/account_move_views.xml +++ b/indoteknik_custom/views/account_move_views.xml @@ -66,7 +66,8 @@ <group> <group> <field name="partner_id" readonly="1"/> - <field name="day_extension" attrs="{'readonly': [('is_approve', '=', True)]}"/> + <field name="payment_term"/> + <field name="day_extension" attrs="{'readonly': [('is_approve', '=', True)]}"/> <field name="order_id" readonly="1"/> <field name="amount_total" readonly="1"/> </group> |
