Odoo Help


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.


Display a field for a selected customer

on 7/6/15, 12:35 PM 282 views

I added a new field in the customer record like this:




'max-mont':fields.float('Credit Maximum',required=True,digits_compute=dp.get_precision('deci3')),


I want to display this field for a selected customer

How ca I do this any suggestion please?????

Are you asking how you add this field to the User Interface? That would be via a VIEW - create your own view via XML either directly in the UI or via a module XML file.

Bista Solutions US, Ray Carnes
on 7/6/15, 1:03 PM

Also, there is already a credit limit module - perhaps you can modify it to meet your needs? https://apps.openerp.com/apps/modules/8.0/partner_credit_limit/

Bista Solutions US, Ray Carnes
on 7/6/15, 1:04 PM

My question is how can I display this new field for the selected customer in the regulation part after creating his bill

on 7/6/15, 1:26 PM
Farid Ghanchi
On 7/7/15, 2:02 AM

You can create a new wizard, And in this wizard you can choose a customer name (Specific customer name ) and on this customer give a access to this new field is visible.


Axel Mendoza

--Axel Mendoza--
| 6 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 7/10/15, 3:32 AM

Just define the field in the view with an attrs="{'invisible': domain}"

where domain is a valid Odoo domain using fields of the view that when get value True the field will be invisible else the field is displayed in the form, your domain could be something like [('customer_id','=', False)]

this means that the new field is invisible when there is no customer selected in the corresponding customer box


Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--
| 5 3 6
Gandhinagar, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
On 7/7/15, 3:30 AM

Dear Jihen BEN ALI,

try this code may be used for you.

<field name="your field name" groups="group id"/>


You should create security file and assign that group in fielda.

If you dont know how to create security file then follow below step and hope you will get answer

You have to create ir.model.access.csv in your module, I suggest you to create a security folder and put security related file there

Like security/ir.model.access.csv and security/given_any_name_security.xml

Change in openerp.py file like 'security/given_any_name_security.xml, 'security/ir.model.access.csv'

Inside xml file you sholud create group like

<?xml version="1.0" ?>


<data noupdate="1">

<record model="ir.module.category" id="module_school_category">

<field name="name">School</field>

<field name="description">School</field>

<field name="sequence">16</field>


<record id="group_school_user" model="res.groups">

<field name="name">User</field>

<field name="category_id" ref="module_school_category" />


<record id="group_school_manager" model="res.groups">

<field name="name">Manager</field>

<field name="implied_ids" eval="[(4, ref('group_school_user'))]" />

<field name="category_id" ref="module_school_category" />

<field name="users" eval="[(4, ref('base.user_root'))]" />




Inside csv file you should give the permission like






Now in your view file to add group in field like

<field name="many2one_field" groups="module_name.group_id"/>

here groups define the value of module_name.group_id that means

group_id: group id which is define in security xml file


<field name="hobby_id" groups="school_management.group_school_manager"/>

Finally update the module

Hope this code is usefully for you.

Thanks & Regards

Ankit H Gandhi

On 7/7/15, 3:06 AM

Hi Farid,

could you explain to me more I never work with the wizard???

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

2 follower(s)


Asked: 7/6/15, 12:35 PM
Seen: 282 times
Last updated: 7/10/15, 3:32 AM