跳至內容
選單
此問題已被標幟
2 回覆
1370 瀏覽次數

Hello!

We are in Odoo v15 sh.

If I need to get a report by each customer level with the following fields what should I do?

  • Customer Name
  • Invoice Number
  • Invoice Date
  • Due Date
  • Payment Status
  • Payment Date

The purpose of the report is to check the customer's payment performance. Need to check the gap between the due date and the payment made date by the customers.

And also the possibilities for the vendor side as well to check our payment performance with the vendor.

Thank you!

頭像
捨棄
最佳答案

HI,
Seems the most of the needed information already exist in the invoice tree view, only missing thing from the specified list is payment date, which you can bring by adding a computed field in invoice level.



As the invoice view has this information's and if you bring one more field, you can export the needed data as Excel using the excel export options in the list view.

And if you need to get report of particular customer.

* Go to customer master
* search and open customer
* click invoice smart button
* you will reach same view with customer filtered data.

If you don't need this approach, you have to customize and make it possible as report

Thanks

頭像
捨棄
最佳答案

Hi,

Create a QWeb template for your PDF report


<?xml version="1.0"?>

<odoo>

<template id="report_account_move_custom">

        <t t-call="web.html_container">

            <t t-foreach="docs" t-as="o">

                <t t-call="web.external_layout">

                    <div class="page">

                        <h2>Account Move Report</h2>

                        <table class="table table-bordered">

                            <thead>

                                <tr>

                                    <th>Customer Name</th>

                                    <th>Invoice Number</th>

                                    <th>Invoice Date</th>

                                    <th>Due Date</th>

                                    <th>Payment Status</th>

                                    <th>Payment Date</th>

                                </tr>

                            </thead>

                            <tbody>

                                <tr>

<td><t t-esc="http://o.partner_id.name" target="_blank">o.partner_id.name"/></td>

<td><t t-esc="o.invoice_number"/></td>

                                    <td><t t-esc="o.invoice_date"/></td>

                                    <td><t t-esc="o.due_date"/></td>

<td><t t-esc="o.payment_status"/></td>

                                    <td><t t-esc="o.payment_date"/></td>

                                </tr>

                            </tbody>

                        </table>

                    </div>

                </t>

            </t>

        </t>

    </template>

</odoo>


python:

from odoo import models, api

class AccountMoveCustomReport(models.AbstractModel):
_name = 'report.account_move_custom.report_account_move_custom'
    _description = 'Account Move Custom Report'

    @api.model
    def _get_report_values(self, docids, data=None):
docs = self.env['account.move'].browse(docids)
        return {
            'doc_ids': docids,
            'doc_model': 'account.move',
            'docs': docs,
        }

menu:

<record id="action_account_move_custom_report" model="ir.actions.act_window">
    <field name="name">Account Move Custom Report</field>
<field name="type">ir.actions.act_url</field>
<field name="url">/report/pdf/account.move_custom_report</field>
    <field name="target">new</field>
</record>


Hope it helps

頭像
捨棄