TIP: You can type at any time to perform a new search.
Partner Last Invoice Date
partner_last_invoice_date · OCA/account-invoicing
Security findings
Migration considerations
- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `WITH RECURSIVE partner_tree AS ( SELECT id, id AS root_id FROM res_partner UNION ALL SELECT child.id, partner_tree.root_id FROM res_partner AS child JOIN partner_tree ON child.parent_id = partner_tree.id ) UPDATE res_partner p SET last_invoice_date = sub.max_inv_date, last_bill_date = sub.max_bill_date FROM ( SELECT pt.root_id AS partner_id, MAX( CASE WHEN am.move_type IN ('out_invoice', 'out_refund') THEN am.invoice_date ELSE NULL END ) AS max_inv_date, MAX( CASE WHEN am.move_type IN ('in_invoice', 'in_refund') THEN am.invoice_date ELSE NULL END ) AS max_bill_date FROM partner_tree pt JOIN account_move am ON am.partner_id = pt.id WHERE am.state = 'posted' AND am.invoice_date IS NOT NULL GROUP BY pt.root_id ) sub WHERE p.id = sub.partner_id` - re-check the table/column names still match after upgrading. migration-raw-sql-write · source
Migration review checklist, not a compatibility verdict. No target version is selected: apply version-specific advice only when migrating to that version or later.
- Repository
- OCA/account-invoicing · module folder · Try on Runboat
- Module version
- 1.0.1
- Category
- Accounting & Finance
- Folder size
- 0.04 MB
- License
- AGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/account-invoicing
- Last tracking update
- 2026-08-07 08:09:10
- Authors
- Odoo Community Association (OCA), ForgeFlow
- Maintainers
- Odoo Community Association (OCA), ForgeFlow
- Committers
- LauraCForgeFlow, Weblate, OCA-git-bot, oca-ci, atg
Code Analysis
Views touched (1)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
view_partner_property_form |
view_partner_property_form_partner_last_invoice_date | res.partner | form | Inherits account.view_partner_property_form |
HTTP endpoints (0)
No HTTP endpoints found for this module.
Models touched (1)
New fields (2)
-
last_bill_dateDatecompute='_compute_last_invoice_bill_date'recursive=Truestore=True -
last_invoice_dateDatecompute='_compute_last_invoice_bill_date'recursive=Truestore=True
No public methods.