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

Payroll and leaves problem - "AttributeError: 'bool' object has no attribute 'upper'" when an employee register vacation

購読

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

この質問にフラグが付けられました
errorpayrollleavesodoo11
1 返信
9846 ビュー
アバター
Carlos Wong

I have create contracts and everything is setup for payroll. It works fine, but when an employee register vacation it failed with this error:


Error:

Odoo Server Error

Traceback (most recent call last):

  File "/odoo/odoo-server/odoo/http.py", line 646, in _handle_exception

    return super(JsonRequest, self)._handle_exception(exception)

  File "/odoo/odoo-server/odoo/http.py", line 307, in _handle_exception

    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])

  File "/odoo/odoo-server/odoo/tools/pycompat.py", line 87, in reraise

    raise value

  File "/odoo/odoo-server/odoo/http.py", line 683, in dispatch

    result = self._call_function(**self.params)

  File "/odoo/odoo-server/odoo/http.py", line 339, in _call_function

    return checked_call(self.db, *args, **kwargs)

  File "/odoo/odoo-server/odoo/service/model.py", line 97, in wrapper

    return f(dbname, *args, **kwargs)

  File "/odoo/odoo-server/odoo/http.py", line 332, in checked_call

    result = self.endpoint(*a, **kw)

  File "/odoo/odoo-server/odoo/http.py", line 927, in __call__

    return self.method(*args, **kw)

  File "/odoo/odoo-server/odoo/http.py", line 512, in response_wrap

    response = f(*args, **kw)

  File "/odoo/odoo-server/addons/web/controllers/main.py", line 924, in call_kw

    return self._call_kw(model, method, args, kwargs)

  File "/odoo/odoo-server/addons/web/controllers/main.py", line 916, in _call_kw

    return call_kw(request.env[model], method, args, kwargs)

  File "/odoo/odoo-server/odoo/api.py", line 689, in call_kw

    return call_kw_multi(method, model, args, kwargs)

  File "/odoo/odoo-server/odoo/api.py", line 680, in call_kw_multi

    result = method(recs, *args, **kwargs)

  File "/odoo/odoo-server/odoo/models.py", line 4996, in onchange

    record._onchange_eval(name, field_onchange[name], result)

  File "/odoo/odoo-server/odoo/models.py", line 4892, in _onchange_eval

    method_res = method(self)

  File "/odoo/odoo-server/addons/hr_payroll/models/hr_payslip.py", line 461, in onchange_employee

    worked_days_line_ids = self.get_worked_day_lines(contracts, date_from, date_to)

  File "/odoo/odoo-server/addons/hr_payroll/models/hr_payslip.py", line 178, in get_worked_day_lines

    for day_intervals in day_leave_intervals:

  File "/odoo/odoo-server/addons/resource/models/resource.py", line 463, in _iter_leave_intervals

    resource_id)

  File "/odoo/odoo-server/addons/resource/models/resource.py", line 393, in _get_day_leave_intervals

    end_datetime=datetime.datetime.combine(day_date, end_time))

  File "/odoo/odoo-server/addons/resource/models/resource.py", line 304, in _get_leave_intervals

    leave_date_to = to_tz(fields.Datetime.from_string(leave.date_to), leave.tz)

  File "/odoo/odoo-server/addons/resource/models/resource.py", line 37, in to_tz

    tz = pytz.timezone(tz_name)

  File "/usr/local/lib/python3.5/dist-packages/pytz/__init__.py", line 173, in timezone

    if zone.upper() == 'UTC':

AttributeError: 'bool' object has no attribute 'upper'


Can you help me?   

0
アバター
破棄
Carlos Wong
著作者

any body???

アバター
Carlos Wong
著作者 最善の回答

First update...

I found out that it is related with Holidays module. If the employee does not have any "absent request", payroll works just fine. As soon as the employee register an "absent request" the problem shows up.


Also, I found out that in the work schedule module you have set the schedule in UTC (calculating UTC times) so the leaves module calculate in the right way the days quantity.


Any clue, about the payroll issue????


I really appreciate your help.


Second update

I found out something today debuging this problem... Actually, two issues:

First: The problem is generated because there is a table where leaves are duplicated from hr_holiday, it's called resource_calendar_leaves, but it has a tz column that is not being filled when copying the value, as hr_holiday uses UTC and does not fill a tz, it leave it null. I set it Default as 'Utc'.

After fixing that, I updated all rows with that value and another problem showed up, "zero division". This was the second issue.

Second Issue: The work schedule cannot be split, it generates a zero division. We have a working schedule from 8am to 12pm and from 1pm to 5pm (8 hours total). So I created a schedule with 2 entries for each day, morning and afternoon. I changed it to one entry per day from 8 to 5 and the problem disappear. But working days are not being calculated right in the payroll. Still checking this "last" issue.

Hope this help somebody else and maybe somebody can help me with the "last" issue.

0
アバター
破棄
inian

I am also getting same error, did you find solution .. Please share

Carlos Wong
著作者

Sorry, I’m still looking how to solve it.

Carlos Wong
著作者

Update...

I found out something today debuging this problem... Actually, two issues:

First: The problem is generated because there is a table where leaves are duplicated from hr_holiday, it's called resource_calendar_leaves, but it has a tz column that is not being filled when copying the value, as hr_holiday uses UTC and does not fill a tz, it leave it null. I set it Default as 'Utc'.

After fixing that, I updated all rows with that value and another problem p\showed up, "zero division". This was the second issue.

Second Issue: The work schedule cannot be split, it generates a zero division. We have a working schedule from 8am to 12pm and from 1pm to 5pm (8 hours total). So I created a schedule with 2 entries for each day, morning and afternoon. I changed it to one da from 8 to 5 and the problem disappear. But working days are not being calculated right. Still checking the last issue.

Hope this help somebody else and maybe somebody can help me with the last issue.

inian

My issue got fixed . As you say holiday module stores in UTC format. When I changed date_from and date_to to Date instead of DateTime field, my error stopped appearing but leave hours comes up wrong.

Later I found that, If odoo doesn't find timezone set for user. It assigns UTC time to leave. So I changed all user timezone in user-> preference. Now everything works fine.

inian

Remove all leaves,set timezone for user from preference. Now apply again.

Carlos Wong
著作者

Nice catch!

I'll try that.

B.Khalil

hello,

i am facing the same problem, i changed employee timezone but steel have the same error message :

Traceback (most recent call last):

File "/usr/lib/python3/dist-packages/odoo/http.py", line 646, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "/usr/lib/python3/dist-packages/odoo/http.py", line 307, in _handle_exception

raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])

File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 87, in reraise

raise value

File "/usr/lib/python3/dist-packages/odoo/http.py", line 683, in dispatch

result = self._call_function(**self.params)

File "/usr/lib/python3/dist-packages/odoo/http.py", line 339, in _call_function

return checked_call(self.db, *args, **kwargs)

File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 97, in wrapper

return f(dbname, *args, **kwargs)

File "/usr/lib/python3/dist-packages/odoo/http.py", line 332, in checked_call

result = self.endpoint(*a, **kw)

File "/usr/lib/python3/dist-packages/odoo/http.py", line 927, in __call__

return self.method(*args, **kw)

File "/usr/lib/python3/dist-packages/odoo/http.py", line 512, in response_wrap

response = f(*args, **kw)

File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 924, in call_kw

return self._call_kw(model, method, args, kwargs)

File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 916, in _call_kw

return call_kw(request.env[model], method, args, kwargs)

File "/usr/lib/python3/dist-packages/odoo/api.py", line 689, in call_kw

return call_kw_multi(method, model, args, kwargs)

File "/usr/lib/python3/dist-packages/odoo/api.py", line 680, in call_kw_multi

result = method(recs, *args, **kwargs)

File "/usr/lib/python3/dist-packages/odoo/models.py", line 4993, in onchange

record._onchange_eval(name, field_onchange[name], result)

File "/usr/lib/python3/dist-packages/odoo/models.py", line 4889, in _onchange_eval

method_res = method(self)

File "/usr/lib/python3/dist-packages/odoo/addons/hr_payroll/models/hr_payslip.py", line 464, in onchange_employee

worked_days_line_ids = self.get_worked_day_lines(contracts, date_from, date_to)

File "/usr/lib/python3/dist-packages/odoo/addons/hr_payroll/models/hr_payslip.py", line 178, in get_worked_day_lines

for day_intervals in day_leave_intervals:

File "/usr/lib/python3/dist-packages/odoo/addons/resource/models/resource.py", line 463, in _iter_leave_intervals

resource_id)

File "/usr/lib/python3/dist-packages/odoo/addons/resource/models/resource.py", line 393, in _get_day_leave_intervals

end_datetime=datetime.datetime.combine(day_date, end_time))

File "/usr/lib/python3/dist-packages/odoo/addons/resource/models/resource.py", line 304, in _get_leave_intervals

leave_date_to = to_tz(fields.Datetime.from_string(leave.date_to), leave.tz)

File "/usr/lib/python3/dist-packages/odoo/addons/resource/models/resource.py", line 37, in to_tz

tz = pytz.timezone(tz_name)

File "/usr/local/lib/python3.5/dist-packages/pytz/__init__.py", line 173, in timezone

if zone.upper() == 'UTC':

AttributeError: 'bool' object has no attribute 'upper'

Please how to set default time zone to all employees ?? or give other solution !!

B.Khalil

Hi, i found the solution, you have just to give timezone to the user that is managing payroll, if it is undefined in preferences, that's my case

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

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

登録
関連投稿 返信 ビュー 活動
"The character encoding of the HTML document was not declared" when connecting to odoo11 server
error odoo11
アバター
0
11月 21
4072
Error: The field `effective_date` does not exist - odoo 11
error odoo11
アバター
アバター
1
11月 19
5825
Set leave balance as zero - Odoo 11
leaves odoo11
アバター
アバター
1
5月 19
3271
How to change the existing model hr.holidays in odoo 11
leaves odoo11
アバター
0
5月 19
4298
Odoo Server Error "unable to create thread pipe"
error reporting odoo11
アバター
0
1月 22
4904
コミュニティ
  • チュートリアル
  • ドキュメンテーション
  • フォーラム
オープンソース
  • ダウンロード
  • 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