Hello Odoo community.
I have been asked to create a field that displays the date of the last purchase that the customer has made. There are pre-existing related fields that allow me to do that but the invoice model is for both invoices and sales so the date displayed even includes quotations.
I don't have much knowledge in Python but somehow I manage to intuit the scope of its logic. I know that it is possible to create a field that displays the date of the invoices according to their status: paid, partially paid, etc.
How could I create this field, what dependency would it have?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Where are you trying to show the field?
You want to show the date of the latest purchase. This could mean one of several things:
- The date that the most recent sales order was confirmed
- The date of the last invoice
- The date of the last payment
I'll assume that you mean the date of the last invoice.
Therefore, the field you are looking for is: self.invoice_ids.date
If you have Odoo Studio you can add this by adding a 'Related Field' to the list view with the path Self > Invoices > Date
It can't be the last invoice cause it will include quotations too. I need to visualize the date when the invoice is shown as paid, not the date of the last payment, but the date when it goes to fully paid status.
I can assure you that :
self.invoice_ids.date or Self > Invoices > Date
does not include quotations or uninvoiced sales orders. It only includes invoices that have been created from a sales order.
Someone else may be able to help more with getting the last paid invoice date from the above path.
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
Oct 24
|
183 | ||
|
2
Mar 24
|
689 | ||
|
2
Mar 24
|
1322 | ||
|
0
Sep 23
|
354 | ||
|
1
Sep 23
|
458 |