Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Vertrieb
    • CRM
    • Vertrieb
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Genehmigungen
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preiskalkulation
  • Hilfe

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

  • CRM
  • e-Commerce
  • Buchhaltung
  • Lager
  • PoS
  • Projekte
  • MRP
All apps
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

Javascript error when Expend all in pivot table

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
javascriptpivotv9.0
1 Antworten
5282 Ansichten
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
Verwerfen
Avatar
Mathieu Laflamme
Autor Beste Antwort

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
Verwerfen
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
Pivot table with multiple fields per group
request groupby pivot v9.0
Avatar
0
Aug. 16
7208
Cannot import @website_sale/js/utils
javascript
Avatar
Avatar
2
Nov. 25
587
Cómo cerrar una transferencia interna al recibirla desde la vista de código de barras stock.picking
javascript
Avatar
0
Juli 25
1133
Why use the Lazy Translation function _lt()
javascript
Avatar
Avatar
1
Juli 25
6440
How to use ReactJS and Next.js to build a fully customizable, open-source headless frontend for Odoo
javascript
Avatar
0
Juli 25
2224
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Bildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة 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 ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

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