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

How to merge several fields into a new one -using the V8 Saas environment and related tools?

購読

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

この質問にフラグが付けられました
v8saasmergefields.function
8 返信
8313 ビュー
アバター
michel Guénard

I need to create a name for my products; this name will concatenate the values found into 2 or 3 others that already exist: product.name (standard Odoo) + personalized fields.

A solution was given for a different environment: see 


Merging fields into one

Specifically the Saas environment does't allow to create a new field with the function option.

Any direction will be appreciated

UPDATE :

(I tested the following configuration having created 2 fields x_nomcomplet and x_auteur type char on modèle product template modèle d'article)


remove previous server action and create 2 new records with values for fields of server action :


first (for field Action name you can choose what you want):

Action name : Nom complet article

Base Model : Modèle d'article

Action To Do : Execute python code

condition : True

Sequence : 5

notebook python code, add following code:


context = context or {}

for record in self.browse(cr, uid, context.get('active_ids', []), context=context):

    value = ""

    for val in [record.name, record.x_auteur]:

        if val:

            value += "%s " % val

    pool.get('product.template').write(cr, uid, record.id, {'x_nomcomplet': value[:-1]}, context=context)


at the top right of the form push button "Add in the More menu" (will add buttons to tree and form of the menu product)


second (for field Action name you can choose what you want):

Action name : Nom complet variante

Base Model : Article

Action To Do : Execute python code

condition : True

Sequence : 5

notebook python code, add following code:


context = context or {}

for record in self.browse(cr, uid, context.get('active_ids', []), context=context):

    value = ""

    for val in [record.product_tmpl_id.name, record.product_tmpl_id.x_auteur]:

        if val:

            value += "%s " % val

pool.get('product.template').write(cr, uid, record.product_tmpl_id.id, {'x_nomcomplet': value[:-1]}, context=context)


at the top right of the form push button "Add in the More menu" (will add buttons to tree and form of the menu product variant)


test in menus product and variant

1
アバター
破棄
michel Guénard
著作者

@Cyril: yes I have access to this menu and lso to technical features.

michel Guénard
著作者

I am interested by an automatic behaviour which allows to store the result of the concatenation of 2 or 3 existing fields into a new one. This new field will replace the name of the variants in every views and forms where the variant name is used.

John

if you check def name_get() in product.py you will see name is concatenated with default_code, you can add any other field with '+' symbol. or are you looking for a new field storing this concatenated value in database?

Cyril Gaspard (GEM)

@John, in mode Odoo online SAAS, no possibility to modify python code or add a new module, to create a field function or related, hard ^^

michel Guénard
著作者

@ John. From your comment, one can deduct that the concatenation is hard coded. This may appear as an conception error regarding the required flexibility. Many questions on this forum are showing the need to customise!

アバター
Cyril Gaspard (GEM)
最善の回答

only solution I know for SAAS odoo version to execute new python code is to use a server action, which will add button "Update name"  (see after) to the form in mode edit at the top menu button "More" AND list view at the top menu button "More" (to perform execution to all selected lines) of the object define in your server action, buttons which will execute your python code.


my example :

I will set to the field name of product template object (menu product),  computation of fields type and default code (verify you have values for that fields else "/" will be set, because this field is required, even if there is always a value for field type, but perhaps this will be not the case for your need)


go to menu configuration/Technical/Actions/Server Actions

create a new record with values for fields of server action :

Action name : Update name

Base Model : Product template

Action To Do : Execute python code

condition : True

Sequence : 5

notebook python code, add following code:


context = context or {}

for record in self.browse(cr, uid, context.get('active_ids', []), context=context):

    name = ""

    for val in [record.type, record.default_code]:

        if val:

            name += "%s " % val

    if name:

        name = name[:-1]

    elif not record.name:

        name = "/"

    pool.get('product.template').write(cr, uid, record.id, {'name': name}, context=context)



at the top right of the server action form push button "Add in the More menu" (will add buttons to tree and form of the object)

save server action


go to menu sales/products/product variants, choose a product, open form in edit mode, at the top menu button More push "Update name", name of your product has changed as "value_field_type value_default_code" (update browser page if it was already opened)

enjoy !


bye

 


2
アバター
破棄
Cyril Gaspard (GEM)

Hi, I tested and updated code in your first post, follow instructions step by step, tested then should work for you too, bye

michel Guénard
著作者

@Cyril: many thanks; it works as expected; however -when the concatenation leads to a long string, then an error message warns that the length is too long for the field; and the field size cannot be changed because it is a base field.

Cyril Gaspard (GEM)

Hi, change lenght of youy file x_nomcomplet in menu configuration/technical/structure de la base de données/champs, search/open form of field x_nomcomplet, in field "Taille" in the form, remove the value if there is one to have a varchar (dynamic lenght), bye

Cyril Gaspard (GEM)

no news ?

michel Guénard
著作者

Sorry Cyril; I had a highly busy period since you last advice and no time left to fine tune the issue as per your directions. I will do it in a few days. I have another issue to solve and I was thinking you - Cyril - could help me: I need to create a server action on the product. template object and adding it to the "more options" menu; this action will generate the Ean13 cusotmized value for a whole series of products; it needs to use the values of another field already present in the database and convert them into the EAN13. I know how to create the button itself but I am unable to code the python code to be added to the notebook. I have asked the question on this forum but no answer; therefore my call to you If you will. Regards

アバター
yellow
最善の回答

Thank you for this process I didn't know !

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

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

登録
関連投稿 返信 ビュー 活動
Company logo in website builder 解決済
v8 saas website_builder
アバター
アバター
アバター
アバター
4
7月 16
2191
[8.0] How to translate fields.function with store to the new api
v8 api fields.function
アバター
アバター
1
7月 15
8880
How can I show the Currency of a Sales Order on the printed PDF? 解決済
v8 saas sales_order
アバター
1
6月 15
7328
How to apply website translation imported through PO file?
v8 saas translation
アバター
0
3月 15
4888
[FORUM] Customize (or hide) the "About This Forum" panel 解決済
v8 saas forum
アバター
アバター
1
3月 15
4005
コミュニティ
  • チュートリアル
  • ドキュメンテーション
  • フォーラム
オープンソース
  • ダウンロード
  • 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