Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

POST records from portal into one2many fields

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
valuesportalwebsiteOdoo13.0kwargs
4282 Vues
Avatar
Abdullah

Hey i am trying to make a custom solution. At ERP end i have a module with both form and line view. For the portal my view is ready and all i have to do is to POST data into one2many fields i know how to do it for simple form but i am confused for my line view. here is my controller

@http.route('/create/evaluation-request', type='http', auth='public', website=True)
    def create_evaluation_request(self, **kw):
        evaluation = request.env['performance.evaluation']
        for key,value in kw.items(): #I used this loop to check values only
            print(key,value)#I dont know why this returns only first value of my line

 
         values = {
                        'emp_self': kw.get('emp_self'),
                        'remarks': kw.get('remarks'),
                     }

        evaluation.performance_lines.sudo().create(values)
        return request.render("gxs_performance_evaluation.evaluation_web_form_message", {})


Here is my Form view Template

<template id="performance_evaluation_record" name="Employee Performance">
            <t t-call="portal.portal_layout">
                <!--            <t t-set="o_portal_fullwidth_alert" groups="project.group_project_user">-->
                <!--                <t t-call="portal.portal_back_in_edit_mode">-->
                <!--                    <t t-set="backend_url" t-value="'/web#model=project.project&amp;id=%s&amp;view_type=form' % (project.id)"/>-->
                <!--                </t>-->
                <!--            </t>-->

                <t t-call="portal.portal_record_layout">
                    <t t-set="card_header">
                        <h5 class="mb-0">
                            <span class="float-right">
                                <a class="btn btn-success btn-sm" href="/performance-evaluations">
                                    <i class="fa fa-arrow-left"/>
                                    Back
                                </a>
                            </span>
                        </h5>
                    </t>
                    <t t-set="card_body">
                        <div class="container">
                            <form role="form" action="/create/evaluation-request/" method="POST">
                                <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
                                <div style="text-align: center; background-color:#002e5b;">
                                    <h2 style="color:#fde428;">
                                        <b>Performance Evaluation</b>
                                    </h2>
                                </div>
                                <br/>
                                <div class="row" style="text-align: center; width: 100%;">
                                    <strong style="margin-left: 20px">Name:</strong>
                                    <span t-field="performance.employee" style="padding-right: 120px;"/>

                                    <strong>Start Date:</strong>
                                    <span t-field="performance.start_date" style="padding-right: 120px;"/>

                                    <strong>End Date:</strong>
                                    <span t-field="performance.end_date" style="padding-right: 120px;"/>

                                    <strong>Deadline:</strong>
                                    <span style="color:Red;" t-field="performance.deadline"/>
                                </div>
                                <br/>
                                <div style="text-align: center; background-color:#002e5b;">
                                    <h2 style="color:#fde428;">
                                        <b>Key Performance Areas</b>
                                    </h2>
                                </div>
                                <table style="width: 100%;">
                                    <thead>
                                        <tr class="active">
                                            <th>Name</th>
                                            <th>Description</th>
                                            <th>Weightage</th>
                                            <th>Employee Rate</th>
                                            <th>Employee Remarks</th>
                                            <!--                                    <th>Final Rating</th>-->
                                            <!--                            <th>Responsible Approver</th>-->
                                        </tr>
                                    </thead>
                                    <t t-foreach="performance.performance_lines" t-as="perform">
                                        <tr>

                                            <td t-if="perform.display_type=='line_section'" colspan="5"
                                                style="background-color:#668cff; text-align: center; color:#fde428;">
                                                <span t-field="perform.name"/>
                                            </td>
                                            <td t-else="perform.display_type!='line_section'">
                                                <span t-field="perform.name"/>
                                            </td>


                                            <td>
                                                <span t-if="perform.display_type!='line_section'"
                                                      t-field="perform.kpa_text"/>
                                            </td>
                                            <td>
                                                <span t-if="perform.display_type!='line_section'"
                                                      t-field="perform.weightage"/>
                                            </td>
                                            <td>
                                                <input t-if="perform.display_type!='line_section'" type="number"
                                                       class="form-control emp_self" name="emp_self"
                                                       min="1" max="10"
                                                       placeholder="Employee Rating"/>
                                            </td>

                                            <td>
                                                <input t-if="perform.display_type!='line_section'" type="text"
                                                       class="form-control remarks" name="remarks"
                                                       placeholder="Employee Remarks" widget="text"/>
                                            </td>
                                        </tr>
                                    </t>
                                </table>
                                <div class="clearfix oe_login_buttons">
                                    <button type="submit" class="btn btn-success" style="float: right;">Submit</button>
                                </div>
                            </form>
                        </div>
                    </t>
                </t>
            </t>
        </template>



0
Avatar
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
How to overwrite My Account Portal position?
account portal website Odoo13.0 rma
Avatar
Avatar
1
juin 24
2118
How to access a custom module from the website (for portal users) [odoo13]
python portal website Odoo13.0 Odoo13
Avatar
Avatar
1
juin 22
4311
ODOO 13 : How to put in place default values in each fields of my website form ? Résolu
default form values website Odoo13.0
Avatar
Avatar
2
avr. 22
4940
Error after changing some fields in 'my details' page.
portal website
Avatar
Avatar
1
janv. 23
2875
website.menu access rights for dedicated groups
portal website odoo17
Avatar
0
févr. 25
2234
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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