summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py4
-rwxr-xr-xindoteknik_custom/models/purchase_order_line.py1
2 files changed, 5 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 6a641aff..6d156cb6 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -52,6 +52,10 @@ class PurchaseOrder(models.Model):
responsible_ids = fields.Many2many('res.users', string='Responsibles', compute='_compute_responsibles')
status_paid_cbd = fields.Boolean(string='Paid Status', tracking=3, help='Field ini diisi secara manual oleh Finance AP dan hanya untuk status PO CBD')
+ def delete_line(self):
+ lines_to_delete = self.order_line.filtered(lambda line: line.delete)
+ lines_to_delete.unlink()
+
def open_form_multi_confirm_po(self):
action = self.env['ir.actions.act_window']._for_xml_id('indoteknik_custom.action_purchase_order_multi_confirm')
action['context'] = {
diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py
index 9406f85f..9240c504 100755
--- a/indoteknik_custom/models/purchase_order_line.py
+++ b/indoteknik_custom/models/purchase_order_line.py
@@ -34,6 +34,7 @@ class PurchaseOrderLine(models.Model):
is_ltc = fields.Boolean(string='Sudah di LTC', default=False, help='centang ini jika barang sudah di LTC')
note = fields.Char(string='Note')
qty_reserved = fields.Float(string='Qty Reserved', compute='_compute_qty_reserved')
+ delete = fields.Boolean(string='Delete', default=False, help='centang ini jika anda ingin menghapus line ini')
def _compute_qty_reserved(self):
for line in self: