コンテンツへスキップ
Odoo メニュー
  • サインイン
  • 無料で15日試す
  • アプリ
    財務
    • 会計
    • 請求
    • 経費
    • スプレッドシート(BI)
    • ドキュメント管理
    • 署名
    販売
    • CRM
    • 販売
    • POS店舗
    • POSレストラン
    • サブスクリプション
    • レンタル
    ウェブサイト
    • ウェブサイトビルダー
    • eコマース
    • ブログ
    • フォーラム
    • ライブチャット
    • eラーニング
    サプライチェーン
    • 在庫
    • 製造
    • 製品ライフサイクル管理 (PLM)
    • 購買
    • 整備
    • 品質
    人事業務
    • 従業員管理
    • 採用
    • 休暇管理
    • 人事評価
    • リファラル
    • フリート
    マーケティング
    • ソーシャルマーケティング
    • メールマーケティング
    • SMSマーケティング
    • イベント
    • マーケティングオートメーション
    • アンケート調査
    サービス
    • プロジェクト管理
    • タイムシート
    • フィールドサービス
    • ヘルプデスク
    • 計画
    • アポイントメント
    生産性向上ツール
    • ディスカッション
    • 承認
    • IoT
    • VoIP
    • ナレッジ
    • WhatsApp
    サードパーティアプリ Odooスタジオ Odooクラウドプラットホーム
  • インダストリー(業種別ソリューション)
    小売
    • 書店
    • アパレルショップ
    • 家具専門店
    • 食料品店
    • 金物店
    • 玩具店
    飲食・ホスピタリティ業界
    • バー・パブ
    • レストラン
    • ファストフード
    • ゲストハウス
    • 飲料販売代理店
    • ホテル
    不動産
    • 不動産会社
    • 建築事務所
    • 建設
    • 不動産管理
    • 造園
    • 住宅所有者組合
    コンサルティング
    • 会計事務所
    • Odooパートナー
    • マーケティングエージェンシー
    • 法律事務所
    • 人材派遣
    • 監査・認証
    製造
    • テキスタイル
    • 金属
    • 家具
    • 飲食
    • 醸造所
    • コーポレートギフト
    ヘルス & フィットネス
    • スポーツクラブ
    • 眼鏡店
    • フィットネスセンター
    • ウェルネス専門家
    • 薬局
    • ヘアサロン
    業種
    • 便利屋
    • IT ハードウェア・サポート
    • 太陽エネルギーシステム
    • 靴メーカー
    • クリーニングサービス
    • 空調設備サービス
    その他
    • 非営利団体
    • 環境機関
    • ビルボードレンタル
    • 写真
    • 自転車リース
    • ソフトウェアリセラー
    すべての業種を見る
  • コミュニティ
    学ぶ
    • チュートリアル
    • ドキュメンテーション
    • 認定
    • トレーニング
    • ブログ
    • ポッドキャスト
    教育サポート
    • 教育プログラム
    • Scale Up! ビジネスゲーム
    • Odooオフィス訪問
    ソフトを入手
    • ダウンロード
    • エディションを比較
    • リリース
    コラボレーション
    • Github
    • フォーラム
    • イベント
    • 翻訳
    • パートナーになる
    • パートナー様向けサービス
    • 会計事務所を登録
    サービス利用
    • パートナー一覧
    • 会計事務所一覧
    • 今すぐ相談する
    • 導入支援サービス
    • お客様一覧
    • サポート
    • アップグレード
    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:

  • CRM
  • e-Commerce
  • 会計
  • 在庫
  • PoS
  • プロジェクト
  • MRP
All apps
コミュニティで交流するには登録する必要があります。
全てのポスト 人々 バッジ
タグ (全て表示)
odoo accounting v14 pos v15
このフォーラムについて
コミュニティで交流するには登録する必要があります。
全てのポスト 人々 バッジ
タグ (全て表示)
odoo accounting v14 pos v15
このフォーラムについて
ヘルプ

Javascript error when Expend all in pivot table

購読

この投稿に活動があった際に通知を受け取ります

この質問にフラグが付けられました
javascriptpivotv9.0
1 返信
5283 ビュー
アバター
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
アバター
破棄
アバター
Mathieu Laflamme
著作者 最善の回答

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
アバター
破棄
ディスカッションを楽しんでいますか?読むだけでなく、参加しましょう!

今すぐアカウントを作成して、限定機能を利用したり、素晴らしいコミュニティと交流しましょう!

登録
関連投稿 返信 ビュー 活動
Pivot table with multiple fields per group
request groupby pivot v9.0
アバター
0
8月 16
7215
Cannot import @website_sale/js/utils
javascript
アバター
アバター
2
11月 25
588
Cómo cerrar una transferencia interna al recibirla desde la vista de código de barras stock.picking
javascript
アバター
0
7月 25
1133
Why use the Lazy Translation function _lt()
javascript
アバター
アバター
1
7月 25
6441
How to use ReactJS and Next.js to build a fully customizable, open-source headless frontend for Odoo
javascript
アバター
0
7月 25
2225
コミュニティ
  • チュートリアル
  • ドキュメンテーション
  • フォーラム
オープンソース
  • ダウンロード
  • Github
  • Runbot
  • 翻訳
サービス
  • Odoo.shホスティング
  • サポート
  • アップグレード
  • カスタム開発
  • 教育プログラム
  • 会計事務所一覧
  • パートナー一覧
  • パートナーになる
企業情報
  • 会社概要
  • ブランドアセット
  • お問い合わせ
  • 採用情報
  • イベント
  • ポッドキャスト
  • ブログ
  • お客様一覧
  • リーガル情報 • プライバシーポリシー
  • セキュリティ
الْعَرَبيّة 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(オドゥー)は、CRM、eコマース、会計、在庫管理、POS、プロジェクト管理など、企業のさまざまな業務を一つのシステムで管理できる、ベルギー発のオープンソースのERPソフトウェアです。

高機能で使いやすく、完全に統合されたERPとして、ユニークな価値を提供しています。

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