diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-04-03 09:52:05 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-04-03 09:52:05 +0700 |
| commit | e3875c149ba913582a3fe28a31003e8332a7893e (patch) | |
| tree | 7538b3ac1d462e347cda3d136e889a0ac686c910 /indoteknik_custom/models/automatic_purchase.py | |
| parent | b559bcdf167ba24cbbcf978461fb774e8eda2f07 (diff) | |
add filter user_id and fix responsible on automatic purchase
Diffstat (limited to 'indoteknik_custom/models/automatic_purchase.py')
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index 2e080bcf..9b5cd01d 100644 --- a/indoteknik_custom/models/automatic_purchase.py +++ b/indoteknik_custom/models/automatic_purchase.py @@ -30,6 +30,13 @@ class AutomaticPurchase(models.Model): total_qty_line = fields.Float(string='Total Qty Line', compute='_compute_total_qty') total_qty_so = fields.Float(string='Total Qty SO', compute='_compute_total_qty') + @api.onchange('apo_type') + def onchange_apo_type(self): + if self.apo_type == 'reordering': + self.responsible_id = 19 + else: + self.responsible_id = self.env.user.id + def _compute_total_qty(self): for data in self: qty_line = qty_so = 0 |
