Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

adding filter for officer name with current logged in user

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
3 Răspunsuri
7830 Vizualizări
Imagine profil
Shiva

In one of my custom module i have following model

    _name = "receipt.details"
    _description = "receipt_details"
    _columns = 
      {
        'date': fields.date('Date', required=True),
        'manual_receipt_no': fields.char('Manual Receipt No'),
        'billnumber': fields.char('Receipt Number', readonly=True),
        'companyid': fields.integer('Comp_ID', readonly=True),
        'chq_dd_no': fields.char('Chq/DD No'),
        'cheque_date': fields.datetime('Cheque Date'),
        'bank_name': fields.char("Bank Name"),
        'child_receipt': fields.one2many('child.receipt', 'rel_id', 'Child Details', ondelete='cascade'),
        'officer_name': fields.many2one('hr.employee', "Officer Name", required=True, ondelete='restrict'),
        'total': fields.function(fnct_total_fee, method=True, string='Total', type='float', store=True),
        'note': fields.text('Note'),
        'is_deleted': fields.boolean('Is Deleted'),
        'ip_address': fields.char('ip Address'),
        'type': fields.char('Type'),
        # 'account_name': fields.selection(_get_BankName_completelst, "Firm Name", required=True),
        'account_name': fields.many2one('account.account', "Firm Name"),
        'journal': fields.many2one('account.journal', 'Journal', required=True),
        'tally_import': fields.binary('Import File(.xml)'),
        'is_bill_cancellation': fields.boolean('Is Bill Cancellation'),
        'interest': fields.float('Market Fee Interest'),
        'manual_license_number': fields.char('Manual License Number'),
      }

with this model i want to display records which are created by current logged in user only how to use domain filter for this scenario

Here is my XML

Form view

  <record model="ir.ui.view" id="bank_recieptsinsertion_form">
            <field name="name">Receipt Form</field>
            <field name="model">receipt.details</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="receipt Form" version="7.0">
                    <sheet>
                        <head>
                           <field name="tally_import" on_change= "onchange_tallyimport(tally_import)" invisible="1"/>
                        </head>
                        <group col="4">
                            <field name="date" on_change= "onchange_date(date)"/>
                            <field name="account_name" on_change="onchange_account_name(account_name)"  required="1"
                                     />
                            <field name="manual_license_number" readonly="1"/>
                            <field name="manual_receipt_no" />
                            <field name="billnumber"/>
                            <field name="chq_dd_no" />
                            <field name="cheque_date" />
                            <field name="bank_name" />
                            <field name="officer_name"  widget="selection" />
                            <field name="total" />
                            <field name="interest" attrs="{'readonly': [('interest', '=', '0')]}"/>
                            <field name="note" />
                            <field name="is_deleted" invisible="1"  />
                            <field name="type" invisible="1"  />
                            <field name="ip_address"  class="ipcaptuaring"  invisible="1"/>
                            <field name="journal"  widget="selection"/>
                        </group>
                        <group>
                            <field name="child_receipt" on_change="onchange_total(child_receipt)"  nolabel="1"/>
                        </group>
                    </sheet>
                </form>
            </field>
    </record>

In form view while editing and creating new receipt i want show only currently logged in user(res.user table) name

Tree view

        <record model="ir.ui.view" id="bank_recieptsinsertion_tree">
            <field name="name">Receipt Tree</field>
            <field name="model">receipt.details</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="receipt Data" version="7.0">
                            <field name="date" type="date"/>
                            <field name="account_name" />
                            <field name="manual_receipt_no" />
                            <field name="billnumber"/>
                            <field name="chq_dd_no" />
                            <field name="cheque_date" />
                            <field name="bank_name" />
                            <field name="officer_name"/>
                            <field name="total" />
                            <field name="note" />
                            <field name="is_bill_cancellation"/>
                </tree>
            </field>
        </record>

this tree view is the list of records i want show records which are created by current logged in user

Record tag

        <record model="ir.actions.act_window"   id="action_receipt_insertion">
           <field name="name">Receipt</field>
           <field name="type">ir.actions.act_window</field>
           <field name="res_model">receipt.details</field>
           <field name="context">[('is_deleted','!=',1)]</field>
           <field name="view_type">form</field>
           <field name="view_mode">tree,form</field>
       </record>

actually I am very new to Open-ERP and Python.I am working on this issue since last one week,your help is highly appreciated Thank you

0
Imagine profil
Abandonează
Shiva
Autor

Thankyou, now i am getting only current logged in user records only . And i have one more issue that is

" In one of custom module i created some new Reports and screens but those reports and screens are showing only in Super Administrator login,Now i want to display those reports to every user, to achive this what i need to do"

Please help me

Imagine profil
Niyas Raphy (Walnut Software Solutions)
Cel mai bun răspuns

Hi,

If you want to show only the records created by the current logged in user, try like this

 <record model="ir.actions.act_window"   id="action_receipt_insertion">
           <field name="name">Receipt</field>
           <field name="type">ir.actions.act_window</field>
           <field name="res_model">receipt.details</field>
           <field name="domain">[('create_uid','=',uid)]</field> <field name="context">[('is_deleted','!=',1)]</field> <field name="view_type">form</field> <field name="view_mode">tree,form</field> </record>

Then the records created by the logged in user will be shown.

Thanks

1
Imagine profil
Abandonează
ersya

Thanks very much Niyas Raphy for information records created by the current logged in user

Imagine profil
Sehrish
Cel mai bun răspuns

Problem Statement

Let say we have a company and in that company we have different active user related to different department. And we want to display some data or records in a tree view or list view according to active user department, when some one clicks on related menu. To achieve this goal we need to create dynamic domain on action window.

Solution

To put domain on action window we need a computed filed in Odoo 8 or function field in older version of Odoo, in that computed field we need to create two method first one for computed field and second one for search.

In py

 department_clo_acl_ids=fields.Char(compute="_compute_department_clo_acl_ids",search='department_clo_acl_ids_search') @api.one
 @api.depends('department_id')
 def _compute_department_clo_acl_ids(self):
    print('View My Department CLO ACL')
 def department_clo_acl_ids_search(self, operator, operand):
     clo_acl_obj = self.env['obe.clo.acl'].search([('department_id','=',self.env.user.faculty_id.department_id.id)]).ids     return [('id','in',clo_acl_obj)]

In xml

<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('department_clo_acl_ids','=',1)]</field>

Read more :http://learnopenerp.blogspot.com/2017/11/show-records-on-treeview-that-are.html


0
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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