summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2025-06-18 09:03:58 +0000
committerIT Fixcomart <it@fixcomart.co.id>2025-06-18 09:03:58 +0000
commit393228f1b25d3fa460d8300c45642e66edbca88a (patch)
treeefbdf4f4e5057deadb2e2c78e08435884f2027db /indoteknik_custom/models/purchase_order.py
parent4c3550dd2641b3f64d889d939e1eee400088188e (diff)
parent386d64204b1e75d7aaa28cf1c7413b69938ee397 (diff)
Merged in date_bill_account (pull request #337)
Date bill account
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-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):