Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Access Rights for base field Fiscal Position Field on Partner Record

Naroči se

Get notified when there's activity on this post

This question has been flagged
access_rulesbasefieldaccess rights
3 Odgovori
951 Prikazi
Avatar
Philipp

Hello,

On the Partner record under the Sales & Purchase tab, the field property_account_position_id (Fiscal Position) is currently visible to all users in the Sales and Accounting groups — except those in the Accounting Read-Only group.

I would like to adjust the access as follows:

  • Accounting users (e.g. Accountant, Accounting Manager) → Editable
  • Sales users → Invisible or Read-only

What is the recommended way to configure this behavior (via XML, Studio, or access rules)?

Thank you in advance.

0
Avatar
Opusti
Avatar
Philipp
Avtor Best Answer

Thank you for the answers. Using Odoo Online I believe I cannot edit Python Code but xml? Could you please describe me how to access the code?

0
Avatar
Opusti
Avatar
D Enterprise
Best Answer

Hi,

Odoo's best practice for controlling field visibility/editability per group is via XML view customization — using the groups attribute (to restrict visibility to groups), and attrs for making the field read-only dynamically.

Hide/Make Read-Only for Sales users:

<field name="property_account_position_id"

       groups="account.group_account_user,account.group_account_manager"

       attrs="{'readonly': [('groups_id', 'not in', [ref('account.group_account_manager'), ref('account.group_account_user')])]}" />


The field is only shown to users in the Accounting groups via groups attribute.

It is read-only for users who are not in those groups.

Sales users won't see it (if they're not part of accounting groups).

This method keeps the logic clean and group-based, and doesn't require creating custom boolean fields or computed conditions.


i hope it is usefull

0
Avatar
Opusti
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,

Please refer to the code below:

Python

from odoo import models, fields, api

class ResPartner(models.Model):
_inherit = 'res.partner'

is_account_user = fields.Boolean(
string="Is Accounting User",
compute='_compute_is_account_user',
store=False
)

@api.depends_context('uid')
def _compute_is_account_user(self):
for record in self:
user = self.env.user
record.is_account_user = user.has_group('account.group_account_user') or user.has_group('account.group_account_manager')

XML:

<record id="view_partner_form" model="ir.ui.view">
<field name="name">res.partner.view.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='property_account_position_id']"
position="before">
<field name="is_account_user" invisible="1"/>
</xpath>
<xpath expr="//field[@name='property_account_position_id']"
position="attributes">
<attribute name="readonly">not is_account_user</attribute>
</xpath>
</field>
</record>

Hope it helps.

0
Avatar
Opusti
Enjoying the discussion? Don't just read, join in!

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

Prijavi
Related Posts Odgovori Prikazi Aktivnost
CRM access rights error
access_rules access rights access-right
Avatar
0
jun. 21
3466
[V12] create Group to remove right to modify followers Solved
security permissions access_rules access rights 12.
Avatar
Avatar
1
dec. 22
5164
Users cannot login after access rights modification Solved
access_rules
Avatar
Avatar
2
jan. 22
4410
How to achieve record-based access control in Odoo 14?
record_rules authorisation access_rules access rights v14
Avatar
Avatar
1
feb. 21
3799
User Access Permissions Solved
record_rules user_management access_rules userpermissions access rights
Avatar
Avatar
Avatar
Avatar
Avatar
6
nov. 19
63599
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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