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

odoo 11 Hide / Show a record set

S'inscrire

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

Cette question a été signalée
recordsetOdoo11
3730 Vues
Avatar
most27

Hi

I start with python programming and odoo 11 Here I have two model "res.config.settings" and "account.tax" I would like that when I check "Ecotax" which is a Boolean field which is in the model "res.config.settings" a list of tax appears on the model "account.tax". Do you have an idea of the method to follow? How can I control the display of record set from another model? is it possible ? Here is my python code:

from odoo import models, fields, api
import logging
class EcotaxeConfig(models.TransientModel):
_inherit = "res.config.settings"

is_ecotaxe = fields.Boolean('Ecotaxe', help="Warning : To include Ecotaxe ",default=False)


@api.model
def get_values(self):
    res = super(EcotaxeConfig, self).get_values()
    get_param = self.env['ir.config_parameter'].sudo().get_param
    res.update(
        is_ecotaxe=get_param('l10n_fr_ecotaxe.is_ecotaxe'),                                                                         
    )
    return res

def set_values(self):
    super(EcotaxeConfig, self).set_values()
    set_param = self.env['ir.config_parameter'].sudo().set_param
    set_param('l10n_fr_ecotaxe.is_ecotaxe', self.is_ecotaxe)

@api.onchange('is_ecotaxe')
def _onchange_is_ecotaxe(self):
    tax = self.env['account.tax'].search([
        ('company_id', '=', self.env.user.company_id.id)  ] )
    if self.is_ecotaxe == True:
       for eco in tax :
            eco.visible_eco=True
       else :
        for eco in tax :
        eco.visible_eco=False

Here is my xml code:

<?xml version="1.0" encoding="UTF-8"?> <odoo> <record model="ir.ui.view" id="account_tax_eco_form"> <field name="name">account_taxe_eco_form</field> <field name="model">res.config.settings</field> <field name="inherit_id" ref="account.res_config_settings_view_form"/> <field name="arch" type="xml"> <div id="eu_service" position="after"> <div class="col-xs-12 col-md-6 o_setting_box" > <div class="o_setting_left_pane"> <field name="is_ecotaxe"/> </div> <div class="o_setting_right_pane"> <label for="is_ecotaxe"/> <div class="text-muted"> if you want to add ecotaxes with other taxes </div> </div> </div> </div> </field>

Here is my record set code:

<?xml version="1.0" encoding="utf-8"?> <odoo> <record model="account.tax" id="taxe0" > <field name="name">Eco/Cat02/42070</field> <field name="type_tax_use" >sale</field> <field name="amount_type">fixed</field> <field name="amount">10</field> <field name="price_include">True</field> <field name="include_base_amount">True</field> <field name="visible">False</field> </record> <record model="account.tax" id="taxe1" > <field name="name" >Eco/Cat02/42070</field> <field name="type_tax_use" >purchase</field> <field name="amount_type">fixed</field> <field name="amount">10</field> <field name="price_include">True</field> <field name="include_base_amount">True</field> <field name="visible">False</field> </record> <record model="account.tax" id="taxe2" > <field name="name">Eco/Cat02/42080</field> <field name="type_tax_use" >sale</field> <field name="amount_type">fixed</field> <field name="amount">6.67</field> <field name="price_include">True</field> <field name="include_base_amount">True</field> <field name="visible">False</field> </record>

Thanks for your help
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é
Uncaught TypeError: this.$buttons.off(...).destroy is not a function
Odoo11
Avatar
Avatar
Avatar
2
janv. 25
10082
Customizing the Search View in Purchase-Vendors Window.
Odoo11
Avatar
Avatar
2
déc. 20
3432
What kind of operations can be done on Recordset Résolu
recordset
Avatar
Avatar
1
oct. 20
3429
How can i add datetime selection widget on website?
Odoo11
Avatar
0
févr. 20
1316
[FIXED] Can not print any report anymore: Odoo Client Error SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 5 of the JSON data Résolu
Odoo11
Avatar
Avatar
2
oct. 19
8200
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