Skip to Content
Odoo मेन्यू
  • Sign in
  • मुफ़्त में आज़माएं
  • ऐप्लिकेशन
    फ़ाइनेंस
    • अकाउंटिंग
    • इनवॉइसिंग
    • एक्सपेंस
    • स्प्रेडशीट (बीआई)
    • डॉक्यूमेंट्स
    • साइन
    सेल्स
    • सीआरएम
    • सेल्स
    • पीओएस शॉप
    • पीओएस रेस्टोरेंट
    • सब्सक्रिप्शन
    • रेंटल
    वेबसाइट
    • वेबसाइट बिल्डर
    • ई-कॉमर्स
    • ब्लॉग
    • फ़ोरम
    • लाइव चैट
    • ई-लर्निंग
    सप्लाई चेन
    • इन्वेंट्री
    • मैन्युफ़ैक्चरिंग
    • पीएलएम
    • परचेज़
    • मेंटेनेंस
    • क्वालिटी
    मानव संसाधन
    • कर्मचारी
    • रिक्रूटमेंट
    • टाइम ऑफ़
    • अप्रेज़ल
    • रेफ़रल
    • फ़्लीट
    मार्केटिंग
    • सोशल मार्केटिंग
    • ईमेल मार्केटिंग
    • एसएमएस मार्केटिंग
    • इवेंट
    • मार्केटिंग ऑटोमेशन
    • सर्वे
    सेवाएं
    • प्रोजेक्ट
    • टाइमशीट
    • फ़ील्ड सर्विस
    • हेल्पडेस्क
    • प्लानिंग
    • अपॉइंटमेंट
    प्रॉडक्टिविटी
    • डिस्कस
    • अप्रूवल
    • आईओटी
    • वीओआईपी
    • नॉलेज
    • WhatsApp
    तीसरे पक्ष के ऐप्लिकेशन Odoo स्टूडियो Odoo क्लाउड प्लेटफ़ॉर्म
  • इंडस्ट्री
    रीटेल
    • बुक स्टोर
    • क्लोदिंग स्टोर
    • फ़र्नीचर स्टोर
    • ग्रॉसरी स्टोर
    • हार्डवेयर स्टोर
    • टॉय स्टोर
    Food & Hospitality
    • बार और पब
    • रेस्टोरेंट
    • फ़ास्ट फ़ूड
    • Guest House
    • बेवरिज डिस्ट्रीब्यूटर
    • होटल
    रियल एस्टेट
    • Real Estate Agency
    • आर्किटेक्चर फ़र्म
    • कंसट्रक्शन
    • एस्टेट मैनेजमेंट
    • गार्ड्निंग
    • प्रॉपर्टी ओनर असोसिएशन
    कंसल्टिंग
    • अकाउंटिंग फ़र्म
    • Odoo पार्टनर
    • मार्केटिंग एजेंसी
    • लॉ फ़र्म
    • टैलेंट ऐक्विज़िशन
    • ऑडिट & सर्टिफ़िकेशन
    मैन्युफ़ैक्चरिंग
    • टेक्सटाइल
    • Metal
    • फ़र्नीचर
    • फ़ूड
    • Brewery
    • कॉर्पोरेट गिफ़्ट
    हेल्थ & फिटनेस
    • स्पोर्ट्स क्लब
    • आईवियर स्टोर
    • फिटनेस सेंटर
    • वेलनेस प्रैक्टिशनर
    • फॉर्मेसी
    • हेयर सैलून
    Trades
    • Handyman
    • आईटी हॉर्डवेयर और सपोर्ट
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    अन्य
    • Nonprofit Organization
    • एन्वायरमेंटल एजेंसी
    • बिलबोर्ड रेंटल
    • फ़ोटोग्राफी
    • बाइक लीजिंग
    • सॉफ़्टवेयर रीसेलर
    Browse all Industries
  • कम्यूनिटी
    सीखें
    • ट्यूटोरियल्स
    • दस्तावेज़
    • सर्टिफ़िकेशन
    • ट्रेनिंग
    • ब्लॉग
    • पॉडकास्ट
    शिक्षा को बढ़ावा दें
    • एजुकेशन प्रोग्राम
    • स्केल अप! बिजनेस गेम
    • Odoo के ऑफ़िस में आएं
    सॉफ़्टवेयर पाएं
    • डाउनलोड
    • वर्शन की तुलना करें
    • रिलीज़
    साथ मिलकर काम करें
    • Github
    • फ़ोरम
    • इवेंट
    • अनुवाद
    • पार्टनर बनें
    • Services for Partners
    • अपना अकाउंटिंग फ़र्म रजिस्टर करें
    सेवाएं पाएं
    • पार्टनर ढूंढें
    • अकाउंटेंट खोजें
    • सलाहकार की मदद लें
    • इम्प्लिमेंटेशन सेवाएं
    • कस्टमर रेफ़रेंस
    • सहायता
    • अपग्रेड
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    डेमो देखें
  • कीमत
  • सहायता

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • सीआरएम
  • e-Commerce
  • लेखांकन
  • इन्वेंटरी
  • PoS
  • प्रोजेक्ट
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
Help

Javascript error when Expend all in pivot table

Subscribe

Get notified when there's activity on this post

This question has been flagged
javascriptpivotv9.0
1 Reply
5292 Views
Avatar
Mathieu Laflamme

I make a module to add invoice pivot table.


report_stock_owner_invoice.py

import logging

import os

from openerp import models, fields, modules, api

from openerp.tools.sql import drop_view_if_exists

import openerp.addons.decimal_precision as dp

_logger = logging.getLogger(__name__)


class ReportStockOwnerInvoice(models.AbstractModel):

_name = 'report.stock.owner.invoice'

_auto = False

invoice_id = fields.Many2one('account.invoice', string='Invoice Reference', readonly=True)

invoice_state = fields.Selection([

('draft','Draft'),

('proforma', 'Pro-forma'),

('proforma2', 'Pro-forma'),

('open', 'Open'),

('paid', 'Paid'),

('cancel', 'Cancelled'),

], string='Invoice Status', readonly=True)

amount_total = fields.Monetary(string='Invoice Total', readonly=True)

sale_order_name = fields.Char(string='Order Reference', readonly=True)

client_order_ref = fields.Char(string='Customer Reference', readonly=True)

order_state = fields.Selection([

('draft', 'Quotation'),

('sent', 'Quotation Sent'),

('sale', 'Sale Order'),

('done', 'Done'),

('cancel', 'Cancelled'),

], string='Order Status', readonly=True)

product_id = fields.Many2one('product.product', string='Product', readonly=True)

categ_id = fields.Many2one('product.category', string='Internal Category', readonly=True)

quantity = fields.Float(string='Quantity', digits=dp.get_precision('Product Unit of Measure'), readonly=True)

uom_id = fields.Many2one('product.uom', string='Unit of Measure', readonly=True)

price_unit = fields.Float(string='Unit Price', readonly=True)

price_subtotal = fields.Monetary(string='Amount', readonly=True)

partner_invoice_id = fields.Many2one('res.partner', string='Invoiced Partner', readonly=True)

partner_shipping_id = fields.Many2one('res.partner', string='Delivery Partner', readonly=True)

partner_shipping_street = fields.Char('Delivery Street', readonly=True)

partner_shipping_street2 = fields.Char('Delivery Street2', readonly=True)

partner_shipping_state_id = fields.Many2one("res.country.state", 'Delivery State', readonly=True)

partner_shipping_zip = fields.Char('Delivery Zip', readonly=True)

partner_shipping_city = fields.Char('Delivery City', readonly=True)

partner_shipping_country_id = fields.Many2one('res.country', 'Delivery Country', readonly=True)

currency_id = fields.Many2one('res.currency', readonly=True)


def init(self, cr):

path_data = os.path.join(modules.get_module_path('stock_owner_account'), 'sql')

path_view = os.path.join(path_data, 'report_stock_owner_invoice.sql')

drop_view_if_exists(cr, self._table)

with open(path_view) as f:

cr.execute(f.read())


@api.v7

def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False,

lazy=True):

if 'price_unit' in fields:

fields.remove('price_unit')

if 'amount_total' in fields:

fields.remove('amount_total')

return super(ReportStockOwnerInvoice, self).read_group(cr, uid, domain, fields, groupby, offset=0, limit=None,

context=None, orderby=False, lazy=True)


report_stock_owner_invoice.sql

CREATE OR replace VIEW report_stock_owner_invoice

AS

SELECT row_number() OVER () AS id,

account_invoice.id AS invoice_id,

account_invoice.create_date,

account_invoice.state AS invoice_state,

account_invoice.amount_total,

account_invoice.currency_id,

sale_order.name AS sale_order_name,

sale_order.client_order_ref,

sale_order.state AS order_state,

account_invoice_line.product_id,

product_template.categ_id,

account_invoice_line.quantity,

account_invoice_line.uom_id,

account_invoice_line.price_unit,

account_invoice_line.price_subtotal,

account_invoice.partner_id AS partner_invoice_id,

sale_order.partner_shipping_id,

partner_shipping.street AS partner_shipping_street,

partner_shipping.street2 AS partner_shipping_street2,

partner_shipping.city AS partner_shipping_city,

partner_shipping.state_id AS partner_shipping_state_id,

partner_shipping.zip AS partner_shipping_zip,

partner_shipping.country_id AS partner_shipping_country_id

FROM account_invoice_line

join account_invoice

ON account_invoice_line.invoice_id = account_invoice.id

left join (sale_order_line

join sale_order

ON sale_order_line.order_id = sale_order.id

join res_partner partner_shipping

ON sale_order.partner_shipping_id = partner_shipping.id

join res_country

ON partner_shipping.country_id = res_country.id

join sale_order_line_invoice_rel

ON sale_order_line_invoice_rel.order_line_id =

sale_order_line.id)

ON sale_order_line_invoice_rel.invoice_line_id =

account_invoice_line.id

join product_product

ON account_invoice_line.product_id = product_product.id

join product_template

ON product_product.product_tmpl_id = product_template.id

join product_category

ON product_template.categ_id = product_category.id

join product_uom

ON account_invoice_line.uom_id = product_uom.id;


report_stock_owner_invoice.xml

{

# The human-readable name of your module, displayed in the interface

'name': "",

# A more extensive description

'description': """

""",

'author': "Transcontinental",

# Categories can be used to filter modules in modules listing

# Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml

# for the full list

'category': 'Warehouse',

'version': '0.1',

# Which modules must be installed for this one to work

'depends': [

'account',

],

# data files which are always installed

'data': [

'views/report_stock_owner_invoice.xml',

],

# data files which are only installed in "demonstration mode"

'demo': [],

}


I try to figure what is causing this. Anyone can help?

0
Avatar
Discard
Avatar
Mathieu Laflamme
Author Best Answer

My problem was that line of code:

return super(ReportStockOwnerInvoice, self).read_group(cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False, lazy=True)

It must be:

return super(ReportStockOwnerInvoice, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context, orderby, lazy)



0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Pivot table with multiple fields per group
request groupby pivot v9.0
Avatar
0
अग॰ 16
7220
Cannot import @website_sale/js/utils
javascript
Avatar
Avatar
2
नव॰ 25
600
Cómo cerrar una transferencia interna al recibirla desde la vista de código de barras stock.picking
javascript
Avatar
0
जुल॰ 25
1134
Why use the Lazy Translation function _lt()
javascript
Avatar
Avatar
1
जुल॰ 25
6442
How to use ReactJS and Next.js to build a fully customizable, open-source headless frontend for Odoo
javascript
Avatar
0
जुल॰ 25
2235
कम्यूनिटी
  • ट्यूटोरियल्स
  • दस्तावेज़
  • फ़ोरम
ओपन सोर्स
  • डाउनलोड
  • Github
  • रनबॉट
  • अनुवाद
सेवाएं
  • Odoo.sh Hosting
  • सहायता
  • अपग्रेड
  • कस्टम डेवलपमेंट्स
  • शिक्षा
  • अकाउंटेंट खोजें
  • पार्टनर ढूंढें
  • पार्टनर बनें
हमारे बारे में
  • हमारी कंपनी
  • ब्रांड ऐसेट
  • संपर्क करें
  • नौकरियां
  • इवेंट
  • पॉडकास्ट
  • ब्लॉग
  • ग्राहक
  • लीगल • गोपनीयता
  • सुरक्षा
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo, बिज़नेस से जुड़े ऐप्लिकेशन का एक कलेक्शन है जो ओपन सोर्स पर आधारित है. इसमें आपकी कंपनी की हर ज़रूरत के लिए ऐप्लिकेशन हैं. जैसे, सीआरएम, ई-कॉमर्स, अकाउंटिंग, इन्वेंट्री, पॉइंट ऑफ़ सेल, प्रोजेक्ट मैनेजमेंट वगैरह.

Odoo की सबसे बड़ी खासियत है कि यह इस्तेमाल करने में बहुत आसान है और यह पूरी तरह से इंटिग्रेट किया हुआ है.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now