By jiashunchen
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!
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.