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

ver.14CE: inheritance of /addons/auth_signup/controllers/main.py

Odoberať

Get notified when there's activity on this post

This question has been flagged
inheritancesignupcontrollerv14
1 Odpoveď
3612 Zobrazenia
Avatar
SmithJohn45

hi all,

i have inheritted model 'res.users', added 3 fields. for zone_id (Many2one) i wants to inherit /addons/auth_signup/controllers/main.py and implement my code, i want guidance as it is difficult for me as beginner and as per its odoo's very important controller. my model file and code for the controller file are below, please have your expert opinion and guidance where it needed. the Manu2one zone_id is empty when run Signup:  form http://localhost:8069/web/signup

model:

class ResUsersExt(models.Model):
    _inherit = 'res.users'
    contact_no = fields.Char(string='Contact No.')
    address = fields.Text(string='Your Address', required=True, default='00')
    zone_id = fields.Many2one('tests.zones', string="Your Zone", required=True, default="1")

controller:

from odoo.addons.auth_signup.controllers.main import AuthSignupHome
class AuthSignupHome(AuthSignupHome):
    @http.route('/web/signup', type='http', auth='public', website=True, sitemap=False)
    def zone_fill (self, **kw):
       zone_rec = request.env['tests.zones'].sudo().search([])
       return http.request.render('auth_signup.signup', {'zone_rec':zone_rec})

my xml template code for zone_id:

                <div class="form-group">
                    <label for="zone_id" class="control-label">Zone</label>
                    <select name="zone_id" class="form-control link-style">
                        <t t-foreach="zone_rec" t-as="zone">
                            <option t-esc="zone.name" t-att-value="zone.id"/>
                        </t>
                    </select>
                </div>

regards

0
Avatar
Zrušiť
Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

Hi,

You can inheriting the controllers in Odoo, have a look at this existing thread: https://www.odoo.com/forum/help-1/how-to-inherit-controller-in-odoo-12-148217

Sample Code From Above Link:

from odoo import http
from odoo.addons.sale.controllers.onboarding import OnboardingController # Import the class


class CustomOnboardingController(OnboardingController): # Inherit in your custom class

@http.route('/sales/sale_quotation_onboarding_panel', auth='user', type='json')
def sale_quotation_onboarding(self):
res = super(CustomOnboardingController, self).sale_quotation_onboarding()
# Your code goes here
return res


As you are looking to add new fields to the signup form you can refer the free apps in the odoo apps store, which brings/add the new field to signup form, you can have a look at the coding done for those modules.

Modules:

  1. Additional Fields Signup Form

  2. Sign-up Form with Extra Fields


To Inherit any controller in Odoo, see:

  1. How To Inherit Existing Controller in Odoo

  2. Q Context In Odoo


Thanks

0
Avatar
Zrušiť
SmithJohn45
Autor

@Niyas Raphy, i tried to follow the video you have posted in my previous question but still failed to have it. in the links of Extra/Additional fields in Signup Form there is no sampel/example of Many2one field as my ZONE_ID field which should populate with data to SELECT by user on SIGNUP.

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
add field inside inherited notebook odoo14
inheritance notebook v14
Avatar
Avatar
1
apr 23
2607
Inheritance web/login but make 400 bad request
inheritance controller loginpage
Avatar
0
sep 22
4044
One2many relationship in _inherit mode
inheritance one2many v14
Avatar
0
apr 22
3303
v14: how i can Activate odoo's default signup/signin for my website created in odoo Solved
signup signin v14
Avatar
Avatar
2
okt 24
16790
Odoo 14: mobile app development to communicate my web app
mobile controller v14
Avatar
Avatar
1
feb 21
3773
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