Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

How can I make the 'initially planned hours' field in task view for a project READ ONLY? I can't find the field in the view XML.

Subscriure's

Get notified when there's activity on this post

This question has been flagged
projecttaskproperty
5 Respostes
7601 Vistes
Avatar
MONEO Tomasz Serwanski

Hello,


I am bit confused - tried to make field 'initially planned view' readonly, but..


1) field I am talking about is visible below:

2) problem is.. whee it is :) in the code; I was quite sure it should be where arrow in the picture below points:

unfortunaltely.. it is not. could anyone advice from where this field goes? and where to look for its properties o make it, for example, read-only?


regards

Tomasz

0
Avatar
Descartar
MONEO Tomasz Serwanski
Autor

seems it is not in 'edit formview' as shown above, but when I chose 'fields view get' it is there:

<field name="planned_hours" widget="float_time" on_change="1" modifiers="{}"/>

It seems to be little bit too much for me - maybe somebody can explain why it looks/works like this? and how to edit (form? other thing?) to have this field (initially planned hours, 'planned_hoours') possible to be set as read only (one scenario) and being readonly for user while readwrite for manager?

regards

Tomasz

Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

You can find it in addons/project/project_view.xml, then please look on
record_id="view_task_form2",

<field name="planned_hours" widget="float_time"   groups="project.group_time_work_estimation_tasks"      on_change="onchange_planned(planned_hours)"/>

and to make this field readonly give readonly="1"


You told that the field is not visible in the edit form view, and it is visible in form as well as in form view get. So you please refresh the page and check whether it is still showing in form view get and in the form

3
Avatar
Descartar
MONEO Tomasz Serwanski
Autor

hello,

thank you for your post - as it shed some light, let me highlight details. there is no such .xml in path you've mentioned (maybe you refer to other odoo than 10)?, but I've found:

- file ./addons/project/views/project_views.xml

- file as above has line:

<group>

<field name="project_id" domain="[('active', '=', True)]" context="{'default_use_tasks':1}"/>

<field name="user_id"

class="o_task_user_field"

options='{"no_open": True}'/>

<field name="legend_blocked" invisible="1"/>

<field name="legend_normal" invisible="1"/>

<field name="legend_done" invisible="1"/>

</group>

- unfortunately still no line seen in 'fields view get' (line: <field name="planned_hours" widget="float_time" on_change="1" modifiers="{}"/>)

- finally I've run search over filesystem for files with text "field name="planned_hours" widget="float_time" on_change="1"" inside - and.. it gave no result :(

so still, could anyone advice where from comes line " <field name="planned_hours" widget="float_time" on_change="1" modifiers="{}"/> " visible in 'fields view get'?

regards

Tomasz

Avatar
Megha Patel
Best Answer

Tomasz Serwanzki,

by applying below code,the planned hours field will become readonly

<record id="project_task_form2_inherited" model="ir.ui.view">
<field name="name">project.task.form2.inherited</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="hr_timesheet.view_task_form2_inherited" />
<field eval="2" name="priority"/>
<field name="arch" type="xml">
<field name="planned_hours" position="attributes">
<attribute name="readonly">1</attribute>
</field>
</field>
</record>
0
Avatar
Descartar
Avatar
MONEO Tomasz Serwanski
Autor Best Answer

..and.. finally got it :) there is a need to take a look at 'inherited views' - seems this field is edited there. I was able to make it read only and it works :)


now it is second step - I woul dlike to have this field to be:

- read only for users, but

- readwrite for project manager


could anyone advice how to manage access rights to particular field?


regards

Tomasz

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

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

Registrar-se
Related Posts Respostes Vistes Activitat
v16 Tasks visibility
project task
Avatar
Avatar
1
de juny 23
4150
Create a user who can only see project and task menu Solved
project task
Avatar
Avatar
1
de nov. 22
4567
Cannot create task Solved
project task
Avatar
Avatar
2
de juny 20
4738
How can I make the Project task completed?
project task
Avatar
Avatar
Avatar
2
de jul. 18
8280
Task assignment for multiple users
project task
Avatar
Avatar
Avatar
Avatar
4
de jul. 18
9263
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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