Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

how to inherit a js function, DocumentSignable in Odoo 16

Odoberať

Get notified when there's activity on this post

This question has been flagged
functioninheritsignature
1 Odpoveď
4461 Zobrazenia
Avatar
Jorge Armas

Hi can anyone tell me how i can inherit the js document signable is there in
enterprise/sign/static/src/js/common/document_signable
becasuse I want to modify the function 
registerCreatedSignItemEvents
with this
registerCreatedSignItemEvents = function ($signatureItem, type, isSignItemEditable) { if (type.name === _t("Date")) { $signatureItem.on("focus", (e) => this.fillTextSignItem( $(e.currentTarget), moment().format(time.getLangDateFormat()) ) ); } if (type.item_type === "signature" || type.item_type === "initial") { $signatureItem.on( "click", (e) => { // when signing for the first time in edit mode, clicking in .o_sign_item_display should cause the sign. // (because both edit and sign are possible) However if you want to change the signature after another // one is set, .o_sign_item_display is not there anymore. if ( this.isDialogOpen || isSignItemEditable && $(e.currentTarget).find('.o_sign_item_display').length && !$(e.target).hasClass('o_sign_item_display') ) { return; } this.handleSignatureDialogClick($(e.currentTarget), type) } ); } if (type.item_type === "sequential") { $signatureItem.on("focus", (e) => { $signatureItem.val('dsadasd') // getSequentialNumberForElementType(type.name) // .then(data => { // const numberFormatted = String(data.sequentialNumber).padStart(data.padding, '0'); // var sequentialNumberComplete // if (typeof data.prefix === 'string' && typeof data.suffix === 'string') { // sequentialNumberComplete = `${data.prefix}${numberFormatted}${data.suffix}`; // } // if (typeof data.prefix === 'string') { // sequentialNumberComplete = `${data.prefix}${numberFormatted}`; // } else if(typeof data.suffix === 'string') { // sequentialNumberComplete = `${numberFormatted}${data.suffix}`; // } // $signatureItem.val(sequentialNumberComplete); // }); }); }
if (type.auto_value && ['text', 'textarea'].includes(type.item_type)) { $signatureItem.on("focus", (e) => this.fillTextSignItem($signatureItem, type.auto_value) ); } if ( config.device.isMobile && ["text", "textarea"].includes(type.item_type) ) { const inputBottomSheet = new InputBottomSheet(this, { type: type.item_type, value: $signatureItem.val(), label: `${type.tip}: ${type.placeholder}`, placeholder: $signatureItem.attr("placeholder"), onTextChange: (value) => { $signatureItem.val(value); }, onValidate: (value) => { $signatureItem.val(value); $signatureItem.trigger("input"); inputBottomSheet.hide(); this.signatureItemNav.goToNextSignItem(); }, }); inputBottomSheet.appendTo(document.body); $signatureItem.on("focus", () => { inputBottomSheet.updateInputText($signatureItem.val()); inputBottomSheet.show(); }); } $signatureItem.on("input", (e) => { this.checkSignItemsCompletion(this.role); this.signatureItemNav.setTip(_t("next")); }); };

but i dont undestand how to inherit and access to that function

0
Avatar
Zrušiť
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,
You can refer to the below steps.To inherit and override this function in Odoo 16 OWL, you can use the following steps:
Create a new module, for example, my_module.
In your new module, create a file static/src/js/my_module.js and put the following code in it:
import {formatFloat as originalFormatFloat} from 'web/static/src/views/fields/formatters.js';

export function formatFloat(value, options = {}) { //Your custom code is here // You can call the original function using originalFormatFloat() }

In your new module, create a file called views/assets.xml and put the following code in it:

Install your new module in Odoo.
This will override the formatFloat function in your Odoo instance and use your custom implementation instead. You can modify the code in the my_module.js file to customize the behavior of the function as needed


Hope it helps

0
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
Is it possible to choose the priority of an overload of a function ? Solved
function create inherit
Avatar
Avatar
2
júl 25
5220
How to inherit web controllers Solved
function inherit controllers
Avatar
Avatar
1
máj 24
5351
how to inherit or override a funtion in odoo javascript
function inherit js odoo17
Avatar
0
okt 24
2227
How to connect button with function? Solved
function form inherit button
Avatar
Avatar
Avatar
3
dec 23
20994
module without fields?
function inherit column button
Avatar
Avatar
Avatar
2
mar 15
5389
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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