diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-05-28 13:19:18 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-05-28 13:19:18 +0700 |
| commit | ea1c7c6f8e52f256e585c80d17a1b3af2a5ca863 (patch) | |
| tree | e51b46170fa29212ddfe02475fff9fb95577c1b6 /indoteknik_custom/models/sale_order_line.py | |
| parent | 779d8e483c660c63afed91f849cce251d7acdab5 (diff) | |
add note on matches_so apo
Diffstat (limited to 'indoteknik_custom/models/sale_order_line.py')
| -rw-r--r-- | indoteknik_custom/models/sale_order_line.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/indoteknik_custom/models/sale_order_line.py b/indoteknik_custom/models/sale_order_line.py index 8fb34328..11346fc9 100644 --- a/indoteknik_custom/models/sale_order_line.py +++ b/indoteknik_custom/models/sale_order_line.py @@ -31,6 +31,18 @@ class SaleOrderLine(models.Model): qty_reserved = fields.Float(string='Qty Reserved', compute='_compute_qty_reserved') reserved_from = fields.Char(string='Reserved From', copy=False) + @api.constrains('note_procurement') + def note_procurement_to_apo(self): + for line in self: + matches_so = self.env['automatic.purchase.sales.match'].search([ + ('sale_line_id', '=', line.id), + ]) + + for match_so in matches_so: + match_so.note_procurement = line.note_procurement + + + @api.onchange('product_uom', 'product_uom_qty') def product_uom_change(self): if not self.product_uom or not self.product_id: |
