[Odoo 13] How to copy value from many2many child field to ...
文章推薦指數: 80 %
So, I think only way to do that is to use Javascript/jQuery. odoo.define('budget.button.copy_name' ... what JS/jQuery code to put here? something like this? 幫助 Dismiss Odooistheworld'seasiestall-in-onemanagementsoftware.Itincludeshundredsofbusinessapps: 客戶關係管理 e-Commerce 會計 庫存管理 PoS Projectmanagement MRP Takethetour 所有論壇 主題 人 標籤 徽章 關於 來去: 疑問 所有主題 人 標籤 徽章 關於 0 編輯 關閉 刪除 標記 編輯 關閉 刪除 標記 DanielRybak 184月2020 退訂 訂閱 Thanksforyoursubscription! javascriptjquerymany2manyOdoo13owl Hi,Ihaveformviewwithmany2manyfield account_ids withitsrecordspresentedintreeview.Insidetreeview,thereisfieldandbutton.Iwanttoclickonbuttonandcopyvalueof child_name to parent_name.Itshouldworkslikecopyandpasteorlikedefaultparameterinmodules.Nosaving.
Theproblemisthat clickingonabutton alwayscausestheclienttoissueawriteorcreatecallbeforerunningthemethod.So,IthinkonlywaytodothatistouseJavascript/jQuery.odoo.define('budget.button.copy_name', function (require) { "use strict"; var FieldRegistry = require('web.field_registry'); // extend web.relational_fields??? var FieldMany2Many = require('web.relational_fields').FieldMany2Many; // extend web.FormController??? var FormController = require('web.FormController'); // extend web.ListController var FormController = require('web.ListController'); // what JS/jQuery code to put here? something like this? var CopyFieldMany2Many = FieldMany2Many.extend({ _onButtonClicked: function (ev) { // what to put here? } }); FieldRegistry.add('copy_name', CopyFieldMany2Many);});Howshouldviewlooklike?Is... ...good?Oritshouldbelikethis?延伸文章資訊
- 1Web Applications with Javascript or Java: Volume 2: ...
JavaScript front-end apps, using one of the two local storage technologies offered by web browser...
- 2[Odoo 13] How to copy value from many2many child field to ...
So, I think only way to do that is to use Javascript/jQuery. odoo.define('budget.button.copy_name...
- 3JavaScript Comparison and Logical Operators - W3Schools
JavaScript also contains a conditional operator that assigns a value to a variable based on some ...
- 4JavaScript 使用if 語句中的的OR 條件
JavaScript 包含條件語句,如if else 語句、switch case 等。這些語句是有條件的,用於檢查給定條件是否為True OR Not,為此我們使用OR ||和&& 運算 ...
- 5JavaScript 基礎知識-邏輯運算子&&,|| - iT 邦幫忙
JavaScript 基礎知識-邏輯運算子&&,|| ... 生活上也會有類似的邏輯判斷,例如:媽媽拜託小明去市場買菜,要買到牛肉,青菜和洋蔥,成功買到這三樣,媽媽才 ...