summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIndoteknik . <it@fixcomart.co.id>2025-06-18 16:01:47 +0700
committerIndoteknik . <it@fixcomart.co.id>2025-06-18 16:01:47 +0700
commit386d64204b1e75d7aaa28cf1c7413b69938ee397 (patch)
tree0aa452ca4e8d80bced6a2926a9827fa2b64f1c8b
parent4fc9dd9424b4b5665872a0386389278efada75f9 (diff)
(andri) date bill & accounting menyesuaikan effective date BU PUT terkait
-rwxr-xr-xindoteknik_custom/models/purchase_order.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 004a1fa4..505df735 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -452,6 +452,18 @@ class PurchaseOrder(models.Model):
'company_id': self.company_id.id,
'payment_schedule': payment_schedule
}
+
+ receipt = self.env['stock.picking'].search([
+ ('purchase_id', '=', self.id),
+ ('state', '=', 'done'),
+ ('picking_type_code', '=', 'incoming'),
+ ('date_done', '!=', False)
+ ], order='date_done desc', limit=1)
+
+ if receipt:
+ invoice_vals['invoice_date'] = receipt.date_done
+ invoice_vals['date'] = receipt.date_done
+
return invoice_vals
def _compute_matches_so(self):