コンテンツへスキップ
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
このフォーラムについて
ヘルプ

Odoo Client Error

購読

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

この質問にフラグが付けられました
v14
3864 ビュー
アバター
DIPOK RAY

Hello all !!

i have created a custom  module when I am trying to  save or edit any record this problem is occurred .

Please someone tell me how can i solve this problem ?


An error occurred

Please use the copy button to report the error to your support service.

See details
Traceback:
TypeError: Cannot read properties of undefined (reading 'classList')
    at Class.setLocalState (http://yuko3-pc:8069/web/content/1163-41039ea/web.assets_backend.js:2248:50)
    at http://yuko3-pc:8069/web/content/1163-41039ea/web.assets_backend.js:1346:190
    at async Promise.all (index 0)
    at async Class.update (http://yuko3-pc:8069/web/content/1163-41039ea/web.assets_backend.js:1346:269)
    at async Class.update (http://yuko3-pc:8069/web/content/1163-41039ea/web.assets_backend.js:2302:58)

0
アバター
破棄
Sudhir Arya (ERP Harbor Consulting Services)

Error is not helping to find the root cause. Please share the code of your custom module.

DIPOK RAY
著作者

hey ! here is my code please tell me how can i solve the problem

model file :

from datetime import datetime
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError

class EbmManagement(models.Model):
_name = "ebm.management"
_inherit = ['mail.thread', 'mail.activity.mixin']
_description = "EBM Management"

@api.depends('pre_costing_line_ids', 'pre_costing_line_ids.amount')
def compute_total_pre_costing_amount(self):
for rec in self:
total = 0
for line in rec.pre_costing_line_ids:
total += line.amount
rec['total_pre_costing_amount'] = total

@api.depends('entertainment_expense_line_ids', 'entertainment_expense_line_ids.entertainment_bill_amount')
def compute_entertainment_total(self):
for rec in self:
total = 0
for line in rec.entertainment_expense_line_ids:
total += line.entertainment_bill_amount
rec['entertainment_total'] = total

@api.depends('conveyance_expense_line_ids', 'conveyance_expense_line_ids.conveyance_bill_amount')
def compute_conveyance_total(self):
for rec in self:
total = 0
for line in rec.conveyance_expense_line_ids:
total += line.conveyance_bill_amount
rec['conveyance_total'] = total

@api.depends('miscellaneous_expense_line_ids', 'miscellaneous_expense_line_ids.miscellaneous_bill_amount')
def compute_miscellaneous_total(self):
for rec in self:
total = 0
for line in rec.miscellaneous_expense_line_ids:
total += line.miscellaneous_bill_amount
rec['miscellaneous_total'] = total

@api.depends('entertainment_total', 'conveyance_total', 'miscellaneous_total')
def compute_total_bill_amount(self):
for rec in self:
rec.total_billing_amount = rec.entertainment_total + rec.conveyance_total + rec.miscellaneous_total

ebm_no = fields.Char(string='EBM No :', required=True, copy=False, readonly=True, default=lambda
self: _('New')) # sequence_id
name = fields.Many2one('hr.employee', string='Created By :', default=lambda self: self.env.user.employee_id,
readonly=True)
dept = fields.Many2one('hr.department', string='Department :', default=lambda self: self.env.user.department_id,
readonly=True)
expense_dept_for = fields.Selection([
('own', 'Own'),
('other', 'Other'),
], string='Expense For :', required=True, default='own', tracking=True)
employee_id = fields.Many2one('hr.employee', string='Employee :', tracking=True)
expense_dept = fields.Char(string='Exp Department :')
ebm_date = fields.Datetime(string='EBM Create Date :', default=datetime.today(), readonly=True)
required_date = fields.Date(string='Required Date :', required=True, tracking=True)

reference = fields.Char(string='Reference :', required=True, tracking=True)
purpose = fields.Text(string='Purpose :', required=True, tracking=True)
state = fields.Selection([('draft', 'Draft'), ('department manager', 'Department Manager'), ('audit', 'Audit'),
('account', 'Account'), ('management', 'Management')], default='draft', string="Status",
tracking=True)

# Notebook Line Added field for pre-costing
pre_costing_line_ids = fields.One2many('pre_costing.lines', 'pre_costing_id', string='Pre-costing Line')
# Notebook Line Added field for entertainment
entertainment_expense_line_ids = fields.One2many('entertainment.expense.lines', 'EEL_id',
string='Entertainment Line')
# Notebook Line Added field for conveyance
conveyance_expense_line_ids = fields.One2many('conveyance.expense.lines', 'CEL_id', string='Conveyance Line')
# Notebook Line Added field for miscellaneous
miscellaneous_expense_line_ids = fields.One2many('miscellaneous.expense.lines', 'MEL_id', string='Miscellaneous '
'Line')
#################### Computed Field ##################
total_pre_costing_amount = fields.Float(compute='compute_total_pre_costing_amount', store=True,
string='Total Pre-Costing '
'Amount ')

entertainment_total = fields.Float(string='Entertainment Total',
compute='compute_entertainment_total', store=True)
conveyance_total = fields.Float(string='Conveyance Total',
compute='compute_conveyance_total', store=True)
miscellaneous_total = fields.Float(string='Miscellaneous Total', store=True,
compute='compute_miscellaneous_total')
total_billing_amount = fields.Float(string='Total Bill Amount', store=True,
compute='compute_total_bill_amount')

def action_department(self):
for rec in self:
rec.state = 'department manager'

def action_audit(self):
for rec in self:
rec.state = 'audit'

def action_account(self):
for rec in self:
rec.state = 'account'

def action_draft(self):
for rec in self:
rec.state = 'draft'

def action_management(self):
for rec in self:
rec.state = 'management'

# sequence value
@api.model
def create(self, vals):
if vals.get('ebm_no', _('New')) == _('New'):
vals['ebm_no'] = self.env['ir.sequence'].next_by_code('ebm.management') or _(
'New') # sequence value
res = super(EbmManagement, self).create(vals)
return res

# field validation
@api.constrains('requested_amount')
def check_requested_amount(self):
for rec in self:
if rec.requested_amount == 0:
raise ValidationError(
_("Please Enter Correct Amount. Amount can not be Zero !!\n ---- দয়া করে সঠিক পরিমাণ লিখুন "
"----!"))

# Date field validation
@api.constrains('required_date')
def _check_required_date(self):
for rec in self:
if rec.required_date < fields.Date.today():
raise ValidationError("The Required date cannot be set in the past !!\n --- প্রয়োজনীয় তারিখ অতীতে "
"সেট "
"করা যাবে না ---|")

# Get automatic department after selecting employee
@api.onchange('employee_id')
def onchange_employee_id(self):
if self.employee_id:
if self.employee_id.department_id.name:
self.expense_dept = self.employee_id.department_id.name
else:
self.expense_dept = ''

# Notebook model for pre-costing
class PreCostingLines(models.Model):
_name = "pre_costing.lines"
_description = "Pre-Costing Lines"

pre_costing_id = fields.Many2one('ebm.management', string='pre_costing')
name = fields.Char(string='Description', required=True)
display_type = fields.Selection([
('line_section', "Section"),
('line_note', "Note")], default=False, help="Technical field for UX purpose.")
amount = fields.Integer(string='Amount')

# Notebook model for Entertainment
class EntertainmentExpenseLines(models.Model):
_name = "entertainment.expense.lines"
_description = "Entertainment Expense Lines"

# Computed function
@api.depends('req_qty', 'unit_cost')
def _get_entertainment_bill_amount(self):
for rec in self:
rec.entertainment_bill_amount = rec.req_qty * rec.unit_cost

EEL_id = fields.Many2one('ebm.management', string='EEL')
product_id = fields.Many2one('ebm.product', string='Product', domain=[('is_entertainment', '=', True)],
change_default=True, required=True) # Category based product
req_qty = fields.Integer(string="Quantity ", required=True)
unit_cost = fields.Float(string="Unit Price")
entertainment_bill_amount = fields.Float(string='Bill Amount', compute='_get_entertainment_bill_amount', store=True)

# Get unit cost of any product after selecting the product
@api.onchange('product_id')
def onchange_product_id(self):
if self.product_id:
if self.product_id.unit_cost:
self.unit_cost = self.product_id.unit_cost
else:
self.unit_cost = ''

# Notebook model for Conveyance
class ConveyanceExpenseLines(models.Model):
_name = "conveyance.expense.lines"
_description = "Conveyance Expense Lines"

CEL_id = fields.Many2one('ebm.management', string='CEL')
product_id = fields.Many2one('ebm.product', string='Product', domain=[('is_conveyance', '=', True)],
change_default=True, required=True)
con_from = fields.Char(string="From", required=True)
con_to = fields.Char(string="Destination", required=True)
conveyance_bill_amount = fields.Float(string='Bill Amount')

# Notebook model for Miscellaneous
class MiscellaneousExpenseLines(models.Model):
_name = "miscellaneous.expense.lines"
_description = "Miscellaneous Expense Lines"

MEL_id = fields.Many2one('ebm.management', string='CEL')
product_id = fields.Many2one('ebm.product', string='Product', domain=[('is_miscellaneous', '=',
True)],
change_default=True, required=True)
name = fields.Char(string='Name')
designation = fields.Char(string='Designation', required=True)
dept = fields.Char(string='Department')
dist = fields.Char(string='Home District')
phone = fields.Char(string='Phone No')
payment_date = fields.Date(string='Payment Date', required=True)
work_place = fields.Char(string='Place of Work')
miscellaneous_bill_amount = fields.Float(string='Bill Amount')
purpose = fields.Text(string='Purpose')
remark = fields.Char(string='Remarks')

@api.constrains('payment_date')
def _check_payment_date(self):
for rec in self:
if rec.payment_date < fields.Date.today():
raise ValidationError("The Payment date cannot be set in the past !!\n --- প্রয়োজনীয় তারিখ অতীতে "
"সেট "
"করা যাবে না ---|")

view file :
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Action view -->

<record id="action_ebm_management" model="ir.actions.act_window">
<field name="name">EBM</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ebm.management</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create Your New EBM Record !!!
</p>
</field>
</record>

<!-- from view -->

<record id="view_ebm_form" model="ir.ui.view">
<field name="name">ebm.management.form</field>
<field name="model">ebm.management</field>
<field name="arch" type="xml">
<form>
<header>
<button id="button_department" name="action_department" string="Department Manager Approve"
class="btn-primary"
states="draft" type="object"/>
<button id="button_audit" name="action_audit" string="Audit Approve" class="btn-primary"
states="department manager" type="object"/>
<button id="button_account" name="action_account" string="Account Approve" class="btn-primary"
states="audit" type="object"/>
<button id="button_draft" name="action_draft" string="Set To Draft" class="btn-primary"
states="management" type="object"/>
<button id="button_management" name="action_management" string="Management Approve"
class="btn-primary"
states="account" type="object"/>
<field name="state" widget="statusbar"
statusbar_visible="draft,department manager,audit,account,management"/>
</header>
<sheet>
<!-- For Sequence Id-->
<div class="oe_title">
<h3>
<field name="ebm_no" readonly="1"/>
</h3>
</div>
<!-- End -->
<group>
<group>
<field name="name" readonly="1"/>
<field name="dept" readonly="1"/>
<field name="expense_dept_for"/>
<field name="employee_id" attrs="{'invisible':[('expense_dept_for','=','own')]}"/>
<field name="expense_dept" attrs="{'invisible':[('expense_dept_for','=','own')]}"/>
</group>
<group>
<field name="ebm_date"/>
<field name="required_date"/>
<field name="reference"/>
<field name="purpose"/>
</group>
</group>

<!-- Bottom part in Notebook -->
<h3>Pre-costing</h3>
<notebook>
<page string="Pre-costing" name="pre_costing_line">
<field name="pre_costing_line_ids" widget="section_and_note_one2many">
<tree editable="bottom">
<control>
<create name="add_line_control" string="Add a Product"/>
<create name="add_section_control" string="Add a section"
context="{'default_display_type': 'line_section'}"/>
</control>
<field name="name" widget="section_and_note_text"/>
<field name="display_type" invisible="1"/>
<field name="amount"/>
</tree>
<form>
<group>
<group>
<field name="name"/>
</group>
<group>
<field name="amount"/>
</group>
</group>
</form>
</field>
<group class="oe_subtotal_footer">
<field name="total_pre_costing_amount" class="oe_subtotal_footer_separator"/>
</group>
</page>
</notebook>
<h3>Billing</h3>
<notebook>
<page string="Entertainment" name="entertainment_expense">
<field name="entertainment_expense_line_ids">
<tree editable="bottom">
<field name="product_id"/>
<field name="req_qty" optional="show"/>
<field name="unit_cost" optional="show"/>
<field name="entertainment_bill_amount" optional="show"/>
</tree>
<form>
<group>
<group>
<group>
<field name="product_id"/>
</group>
<group>
<field name="req_qty"/>
</group>
<group>
<field name="unit_cost"/>
</group>
<group>
<field name="entertainment_bill_amount"/>
</group>
</group>
</group>
</form>
</field>
</page>

<page string="Conveyance" name="conveyance_expense">
<field name="conveyance_expense_line_ids">
<tree editable="bottom">
<field name="product_id"/>
<field name="con_from" optional="show"/>
<field name="con_to" optional="show"/>
<field name="conveyance_bill_amount" optional="show"/>
</tree>
<form>
<group>
<group>
<field name="product_id"/>
</group>
<group>
<field name="con_from"/>
</group>
<group>
<field name="con_to"/>
</group>
<group>
<field name="conveyance_bill_amount"/>
</group>
</group>
</form>
</field>
</page>
<page string="Miscellaneous" name="miscellaneous_expenses">
<field name="miscellaneous_expense_line_ids">
<tree editable="bottom">
<field name="product_id"/>
<field name="name" optional="show"/>
<field name="dept" optional="show"/>
<field name="designation" optional="show"/>
<field name="dist" optional="show"/>
<field name="phone" optional="show"/>
<field name="payment_date" optional="show"/>
<field name="work_place" optional="show"/>
<field name="miscellaneous_bill_amount" optional="show"/>
<field name="purpose" optional="show"/>
<field name="remark" optional="show"/>
</tree>
<form>
<group>
<group>
<field name="product_id"/>
</group>
<group>
<field name="name"/>
</group>
<group>
<field name="dept"/>
</group>
<group>
<field name="designation"/>
</group>
<group>
<field name="dist"/>
</group>
<group>
<field name="phone"/>
</group>
<group>
<field name="payment_date"/>
</group>
<group>
<field name="work_place"/>
</group>
<group>
<field name="miscellaneous_bill_amount"/>
</group>
<group>
<field name="purpose"/>
</group>
<group>
<field name="remark"/>
</group>
</group>
</form>
</field>
</page>

</notebook>
<!--Notebook End-->
<group class="oe_subtotal_footer">
<field name="entertainment_total"/>
<field name="conveyance_total"/>
<field name="miscellaneous_total"/>
<field name="total_billing_amount" class="oe_subtotal_footer_separator"/>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>

<!-- Tree view-->

<record id="view_ebm_tree" model="ir.ui.view">
<field name="name">ebm.management.tree</field>
<field name="model">ebm.management</field>
<field name="arch" type="xml">
<tree sample="1" multi_edit="1">
<field name="ebm_no"/>
<field name="name" optional="show"/>
<field name="dept" optional="show"/>
<field name="employee_id" optional="show"/>
<field name="expense_dept" optional="show"/>
<field name="ebm_date" optional="show"/>
<field name="required_date" optional="show"/>
<field name="expense_dept_for" optional="show"/>
<field name="reference" optional="show"/>
<field name="purpose" optional="show"/>
</tree>
</field>
</record>
</odoo>

ディスカッションを楽しんでいますか?読むだけでなく、参加しましょう!

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

登録
関連投稿 返信 ビュー 活動
Attached PDF file is not formatted properly
v14
アバター
アバター
1
12月 25
386
Odoo14 alternative for Automated Translations through Gengo API module
v14
アバター
アバター
アバター
アバター
3
9月 25
3808
Odoo Community v14 Slow on High-End Servers, Fast on i5/i7 PCs
v14
アバター
0
8月 25
1216
How to Managing Birthdate and Age in Odoo
v14
アバター
アバター
1
8月 25
3617
Update Initial Stock of Product using XMLRPC API [Odoo14] 解決済
v14
アバター
アバター
アバター
2
7月 25
9237
コミュニティ
  • チュートリアル
  • ドキュメンテーション
  • フォーラム
オープンソース
  • ダウンロード
  • 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