summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-07-24 15:58:16 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-07-24 15:58:16 +0700
commit5c87386fadb7f24ecbd33490cb838a879a48bd33 (patch)
tree661d8524f4b6f2c3f2ab0b6f98a89897d99566a3 /indoteknik_custom/models
parentbf294f65fa5ff2f1974e0b2766a4a4469193fe3a (diff)
fix bug mail template
Diffstat (limited to 'indoteknik_custom/models')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py10
-rwxr-xr-xindoteknik_custom/models/sale_order.py1
2 files changed, 10 insertions, 1 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index e5d44178..85d68874 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -65,7 +65,15 @@ class PurchaseOrder(models.Model):
('not_printed', 'Belum Print'),
('printed', 'Printed')
], string='Printed?', copy=False, tracking=True)
+ date_done_picking = fields.Datetime(string='Date Done Picking', compute='get_date_done')
+ def get_date_done(self):
+ picking = self.env['stock.picking'].search([
+ ('purchase_id', '=', self.id),
+ ('state', '=', 'done')
+ ], limit=1, order='create_date desc')
+
+ self.date_done_picking = picking.date_done
def _prepare_invoice(self):
"""Prepare the dict of values to create the new invoice for a purchase order.
"""
@@ -141,7 +149,7 @@ class PurchaseOrder(models.Model):
'location_dest_id': self._get_destination_location(),
'location_id': self.partner_id.property_stock_supplier.id,
'company_id': self.company_id.id,
- 'sale_order': sale_order,
+ 'sale_order': sale_order
}
@api.model
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 7e39f550..816ec3b1 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -568,6 +568,7 @@ class SaleOrder(models.Model):
def action_confirm(self):
for order in self:
+ order.sale_order_approve()
order._validate_order()
order.order_line.validate_line()