diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-07-24 13:46:59 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-07-24 13:46:59 +0700 |
| commit | 2ad6b4ecf783b5dfe0d4aa11f238cbf6aefd9747 (patch) | |
| tree | c07caf6a1df48719b828fbe270bb62ccc3e0c947 | |
| parent | 5b9e37d9a5f95e202be9fd0624e122c7aaacee4d (diff) | |
| parent | 92c97849b0755ab3396508fc6e6d5a12380bc549 (diff) | |
Merge branch 'production' of https://bitbucket.org/altafixco/indoteknik-addons into production
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index deea64a1..552f1b0a 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -243,6 +243,16 @@ class SaleOrder(models.Model): self.npwp = parent_id.npwp self.sppkp = parent_id.sppkp self.customer_type = parent_id.customer_type + + @api.onchange('partner_id') + def onchange_partner_id(self): + # INHERIT + result = super(SaleOrder, self).onchange_partner_id() + parent_id = self.partner_id.parent_id + parent_id = parent_id if parent_id else self.partner_id + + self.partner_invoice_id = parent_id + return result def _get_purchases(self): po_state = ['done', 'draft', 'purchase'] |
