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 | etc.
I have a report on the account.invoice model and want to show how many products in the invoice line. Below will show a picture of what I want to do.
The idea is to count how many products there are on the invoice and return the number of the quantity of products.
Maybe it may be simple, but really do not know everything about Odoo.
Thanks for your advice and help.
I try to query into report, it's working...
_name = "customer.report"
_description = "Orders Statistics"
_auto = False
name = fields.Many2one('res.partner', readonly=True)
p_id = fields.Many2one('preorder.config','PreOrder Ref')
tot_product = fields.Integer('# of Unique Product')
tot_piece = fields.Integer('# of Piece')
def init(self, cr):
"""Initialize the sql view for the event registration """
# TOFIX this request won't select events that have no registration
cr.execute(""" CREATE VIEW customer_report AS (
poc.id::varchar || '/' || coalesce(poc.id::varchar,'') AS id,
poui.customer AS p_id,
poui.partner_id AS name,
count(pl.product_id) AS tot_product,
count(poc.id) AS tot_piece
left join preorder_user_input poui on (poui.preorder_id = poc.id)
left join preorder_product_rel ppr on (ppr.preorder_id = poc.id)
left join preorder_user_input_product_line pl on (pl.user_input_id = poui.id)
poc.id, poui.preorder_id, poui.partner_id
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 4/4/16, 2:10 PM|
|Seen: 512 times|
|Last updated: 4/7/16, 1:04 AM|