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

Easy way to transfer Settings from one database to another. Can I export them? Can I programmatically "configure" a database?

購読

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

この質問にフラグが付けられました
configurationdatabasetransferportabilityautomate
2 返信
8879 ビュー
アバター
Community Question

Prior to configuring a production database, I am performing several manual configuration steps in development and staging branches.

It seems like I have to repeat all of these manual steps .

It is possible to export settings between databases?

Is it possible to programmatically configure a database?


1
アバター
破棄
アバター
Ray Carnes (ray)
最善の回答

Yes, you can script the configuration of a database and reuse the script.


Note: You need to (a) understand this is an advanced technique and (b) be familiar / fluent in using Python to set values for different types of data structures. Configuration options can be represented in different ways - check boxes, radio buttons, fields to enter text, fields to enter numbers, fields to select dates, fields to select related records, etc. - which translate to model fields of different types: boolean, selection, char, integer, date, many2one, etc. - and each needs a different method to set and/or change the value.


We do this in our test scripts, so you can also do it in your own scripts.  (Please test and verify what you think is happening is actually happening!).


In the code at https://github.com/odoo/odoo/blob/17.0/addons/base_setup/tests/test_res_config.py#L40 you can see these lines configure a database to support multiple currencies (res.config.settings is a transient model):

# get access to the configuration model
ResConfig = self.env['res.config.settings']

# get a copy of the default values
default_values = ResConfig.default_get(list(ResConfig.fields_get()))

# update the default values
default_values.update({'group_multi_currency': True})

# persist the updated defaults
ResConfig.create(default_values).execute()


Example:

Let's say we want to change the default currency of a database to $USD and also configure the database to support multi-currency, and the current configuration looks like this:



First, hover over each of the fields to see their technical name, since these are the fields you will need to update:

                   


Next, you can script.  This example uses a Scheduled Action configured as inactive so the only time it runs is when the RUN MANUALLY button is clicked.  You may prefer to write an XML-RPC based script. 




default_values = model.default_get(list(model.fields_get()))

default_values.update({
'currency_id': env.ref('base.USD').id,
'group_multi_currency': True
})

model.create(default_values).execute()


After the script is run:



You can also install modules:

for app in ['stock','account_consolidation','contacts','helpdesk','sale_purchase','sale_management','crm','web_studio']:
    env['ir.module.module'].search([('name','=',app)],limit=1).button_immediate_install()


Populate company data:

coname = 'ACME'
 
# ↓↓↓ add details to the main Company, "ACME USA Inc."
us_company = env.ref('base.main_company')
us_company.update({'name': coname + ' USA Inc.', 'street': '100 Main Street', 'city': 'Springfield', 'state_id': env.ref('base.state_us_5').id, 'zip': '90123'})


Activate currencies:

# ↓↓↓ Activate Currencies and rename prefixes
env.ref('base.AUD').update({'active': True,'symbol': '$AUD'})
env.ref('base.EUR')['active'] = True
env.ref('base.GBP')['active'] = True
env.ref('base.JPY')['active'] = True


Create fake historic data:

# ↓↓↓ Create CRM Teams
env.ref('sales_team.team_sales_department').update({'name': 'Farmers', 'company_id': 1})
farmers = env.ref('sales_team.team_sales_department').id
hunters = env['crm.team'].create({'name': 'Hunters'}).id

# ↓↓↓ Sort Sales Teams alphabetically
sorted_teams = env['crm.team'].search([]).sorted(key=lambda r: r.name)
for i in range(len(sorted_teams)):
  sorted_teams[i].update({'sequence': i})

# ↓↓↓  mediums for historic data
web = env.ref('utm.utm_medium_website').id
phone = env.ref('utm.utm_medium_phone').id

# ↓↓↓  historic data
for i in range(1,142):
  env.cr.execute("insert into crm_lead (create_date,active,name,medium_id,team_id,type) values ('%s','f','l',%d,%d,'lead')" % \
(datetime.datetime.today() - datetime.timedelta(weeks=52),phone,farmers))


If you are writing a module for this, you can also use the function tag to call model methods in your XML files.  See https://www.odoo.com/documentation/master/developer/reference/backend/data.html#function

9
アバター
破棄
Ray Carnes (ray)

install module xml install app xml configure app xml configure module xml

アバター
Agung Sepruloh
最善の回答

You can use this module https://apps.odoo.com/apps/modules/16.0/export_import_settings

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

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

登録
関連投稿 返信 ビュー 活動
How to transfer database from one account to another Odoo account?
database transfer
アバター
アバター
1
3月 24
3527
transfer a database
database transfer
アバター
0
11月 23
2306
Set up a database from a configuration file
configuration database
アバター
0
10月 25
4022
How to select one database by default ? 解決済
configuration database v7
アバター
アバター
アバター
アバター
アバター
6
7月 24
85152
Internal Transfer error - Missing required account on accountable invoice line 解決済
configuration transfer internal
アバター
アバター
アバター
アバター
3
8月 24
7189
コミュニティ
  • チュートリアル
  • ドキュメンテーション
  • フォーラム
オープンソース
  • ダウンロード
  • 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