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
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • 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
    Others
    • 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
  • Help

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

"'30' is not an integer or a virtual id" when updating a custom module setting

Odoberať

Get notified when there's activity on this post

This question has been flagged
settingsmoduleres.config
4 Replies
7781 Zobrazenia
Avatar
Levi Bensley

I'm getting this error after I have set the setting for the first time. It happens whenever accessing the settings menu.

Full Error Log:
https://lbwebsites.me/web/static/src/js/fields/basic_fields.js:814
Traceback:
Error: "30" is not an integer or a virtual id
    at Class._formatValue (https://lbwebsites.me/web/static/src/js/fields/basic_fields.js:814:23)
    at Class.prototype.<computed> [as _formatValue] (https://lbwebsites.me/web/static/src/js/core/class.js:90:38)
    at Class._prepareInput (https://lbwebsites.me/web/static/src/js/fields/basic_fields.js:247:30)
    at Class._renderEdit (https://lbwebsites.me/web/static/src/js/fields/basic_fields.js:259:14)
    at Class._render (https://lbwebsites.me/web/static/src/js/fields/abstract_field.js:353:25)
    at https://lbwebsites.me/web/static/src/js/fields/abstract_field.js:187:25
    at https://lbwebsites.me/web/static/lib/jquery/jquery.js:3276:89
    at fire (https://lbwebsites.me/web/static/lib/jquery/jquery.js:3119:58)
    at Object.add [as done] (https://lbwebsites.me/web/static/lib/jquery/jquery.js:3165:49)
    at Array.<anonymous> (https://lbwebsites.me/web/static/lib/jquery/jquery.js:3275:77)
Model
default_quote_valid_to = fields.Integer(string="Default Quote Valid to Days")
get_values method (appears to be the issue)
@api.model
def get_values(self):
    res = super(ResConfigSettings, self).get_values()
    ICPSudo = self.env['ir.config_parameter'].sudo()
    res.update(
        default_quote_valid_to = ICPSudo.get_param('quote.default_quote_valid_to', default=30),
    )
    return res

Edit: also the view where the field is displayed:
<div class="row mt16 o_settings_container">
    <div class="col-12 col-lg-6 o_setting_box" id="quotes">
        <div class="o_setting_left_pane">
            <field name="default_quote_valid_to" widget="integer"/>
        </div>
        <div class="o_setting_right_pane">
            <label for="default_quote_valid_to"/>
            <div class="text-muted">
                Set the default value of the days a quote is available to.
            </div>
        </div>
    </div>
</div>


Edit 2: this is a bespoke quote module not the built in one

0
Avatar
Zrušiť
Avatar
Mital Vaghani
Best Answer

Please write as following because your field is integer so value must be integer. 

@api.model
def get_values(self):
    res = super(ResConfigSettings, self).get_values()
    ICPSudo = self.env['ir.config_parameter'].sudo()
    res.update(
        default_quote_valid_to = int(ICPSudo.get_param('quote.default_quote_valid_to', default=30)),
    )
    return res


1
Avatar
Zrušiť
Avatar
Maxim Burinov
Best Answer

Have the same issue. As a temporal solution I made all my settings fields Char.

0
Avatar
Zrušiť
Avatar
Paresh Wagh
Best Answer

Hi Levi: If you are interested in setting the number of days for which a Quotation is valid, you can set it in Settings > General Settings. The setting is also available in Quotation Templates if you need different validity periods.

0
Avatar
Zrušiť
Avatar
Levi Bensley
Autor Best Answer

Thank you Paresh W however i forgot to mention that it is actually a bespoke quote module so using that will not work for me

Edit:

My only temporary fix was to change the JavaScript that handles the fields, as it was using regex to check if it was and Integer so i changed it to convert the string to int and check if it was NaN

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
[12.0] enable features in the res.config.settings Solved
settings xml res.config
Avatar
Avatar
Avatar
Avatar
6
mar 24
24746
How to change settings on module installation? Solved
settings module xml
Avatar
Avatar
Avatar
2
okt 17
12504
How to show module path in settings? (V8)
v8 settings module
Avatar
Avatar
1
máj 16
6242
INSTALL A MODULE BASED ON CHECKBOX VALUE Solved
settings module res_config v15
Avatar
Avatar
1
feb 24
2958
How to remove default "Featured" filter for Apps/Modules list
settings module v7 app
Avatar
Avatar
1
mar 15
9315
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