Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to hide view.xml fields group in Account module with attr

By
priyankahdp
on 4/2/13, 2:24 PM 3,818 views

I am using openerp version 7 and need to hide below section from existing module. I tried with many ways but still unable to do that.please advice me to sort out this (line 933 in account module) is there any restrictions in core modules or something missing to me ?

<group string="Refunds" attrs="{'invisible':[('active','=',True)]}">
<field name="account_paid_id" domain="[('type','&lt;&gt;','view'),('type','&lt;&gt;','consolidation')]"/>
<field name="account_analytic_paid_id" domain="[('type','&lt;&gt;','view'), ('company_id', '=', company_id), ('parent_id', '&lt;&gt;', False)]" groups="analytic.group_analytic_accounting"/>

<field name="ref_base_code_id"/>
<field name="ref_base_sign"/>
<field name="ref_tax_code_id"/>
<field name="ref_tax_sign"/>
</group>
8

Sandeep

--Sandeep--
6083
| 6 5 8
Delhi, India
--Sandeep--
Python OpenERP Developer http://in.linkedin.com/pub/sandeep-rana/3b/a16/786/
Sandeep
On 6/4/13, 3:22 AM

attrs does'nt work on group , it work for invisible only ..... not for readonly and other

You are right but question is about how to hide group not about readonly.

Sudhir Arya (SA)
on 6/4/13, 4:11 AM

Agree with Sudhir. Sandeep your answer should be relevant to the question.

AB Consultant
on 6/4/13, 4:14 AM
7

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 4/3/13, 1:54 AM

Your attrs syntax is right except value given in domain. You are giving 'true' which will be treated as a string not boolean.

Try this:

<group string="Refunds" attrs="{'invisible':[('active','!=',True)]}">

thanks arya.but its not worked for me i seperately add invisible ="1" for some fields.those are also not worked.after changes done, need to restart server & upgrade modules is enough ?

priyankahdp
on 4/3/13, 3:40 AM

Yes you have to update the module. It's working for me.

Sudhir Arya (SA)
on 4/3/13, 3:45 AM

only upgrade account & finance module .?

priyankahdp
on 4/3/13, 3:46 AM

If you are directly changing code in account module then you have to update account module only.

Sudhir Arya (SA)
on 4/3/13, 3:47 AM

i changed acount_view.xml line 1042 only.after upgrade also no result & its same (& see the result from Accounting->Configuration->Taxes->Taxes)

hope my editing lines & result page is equal

priyankahdp
on 4/3/13, 3:50 AM

It will work when value of active field will change.

Sudhir Arya (SA)
on 4/3/13, 3:56 AM

Make sure that changes you have made is really a view of tax or not? Because on account_view.xml: 1042 belongs to account.move.line form view. In your question you mentioned that you want to change line: 933.

Sudhir Arya (SA)
on 4/3/13, 3:59 AM

Sudhir is right. I just tried that code directly from Setting --> User Interface --< Views and edit the account.tax.form view with the new attrs, given by him and its working fine.

Priyesh Solanki (pso)
on 4/3/13, 4:19 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 4/2/13, 2:24 PM
Seen: 3818 times
Last updated: 3/16/15, 8:10 AM