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
- 会計
- 在庫
- PoS
- Project
- MRP
この質問にフラグが付けられました
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.
関連投稿 | 返信 | ビュー | 活動 | |
---|---|---|---|---|
|
3
2月 25
|
1938 | ||
|
1
12月 24
|
2084 | ||
|
2
3月 24
|
2428 | ||
|
2
3月 24
|
2958 | ||
|
0
9月 23
|
1514 |