Report this

What is the reason for this report?

odoo 9 sale analysis adding new measures.

Posted on February 19, 2018

I tried to do sale report as nice format for printing. Just post my question on https://www.odoo.com/forum/help-1/question/odoo-9-sale-analysis-adding-new-measures-129929

But nobody answer. So I post here, hope someone helps. Thanks.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

There has been a similar question asked on the Odoo forum for a newer version:

https://www.odoo.com/forum/help-1/how-to-add-measure-in-purchase-analysis-report-odoo-12-152349

If you are trying to modify the Odoo Sales Analysis report to include new measures such as UoM (Unit of Measure), you’ll have to update the code that is generating the report. Odoo uses a specific model and view for this report, and you’ll need to add the appropriate fields and calculations.

Odoo’s reporting is done through models and views. The model sale.report is used for the sales report, and the associated view is used to generate the interface.

You could try using the code from the accepted answer from the above discussion:

def _select(self):
    return super(PurchaseReport, self)._select() + ", sum(l.qty_received),sum(l.product_qty - l.qty_received**) as qty_balanced"**

Remember, you should create a new custom module for these changes. Don’t modify the original Odoo code directly, as it makes upgrading Odoo difficult in the future.

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.