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

Error when make security for a field..

By
aci aisha
on 2/3/15, 1:15 AM 642 views

Friends,

I add 2 fields in task using a custom module & it works fine..

But when i trying to add security for one of the module as follows,an error occured!!!

    <record model="ir.ui.view" id="create_file">
        <field name="name">project.task</field>
        <field name="model">project.task</field>
        <field name="inherit_id" ref="project.view_task_form2" />
        <field name="arch" type="xml">
            <xpath expr="/form/sheet/group/group[2]/field[@name='categ_ids']" position="after">
                 <field name="file_no" groups="group_trademark_user"/>
                 <field name="file_no_cr"/>
            </xpath>
        </field>
    </record>

ERROR IS,

ParseError: "ValidateError
Field(s) `arch` failed against a constraint: Invalid view definition

Error details:
External ID must be fully qualified" while parsing /home/amz02/Projects/odoo/odoo-8.0-647afdf/openerp/addons/file_details/file_details_veiw.xml:409, near

 

Any1 help me??!

0

Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
3918
| 5 3 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 2/3/15, 1:42 AM

Try this

<field name="file_no" groups="YOUR_MODULE.group_trademark_user"/>
where YOUR_MODULE is the module in which "group_trademark_user" group is added.

Also, in __openerp__.py,

'data': ['security/security.xml',
             'security/ir.model.access.csv',
             'YOUR VIEWS',
            ],

This is to load the security file prior to loading your VIEWS.
 

Sorry,,,I try with module_name..But didnt work.. But when try with base as Abin says it works perfectly!!!

aci aisha
on 2/3/15, 1:44 AM

when defining the security file, did you use id="base.group_trademark_user" to create your new group?

Atchuthan - Technical Consultant, Sodexis Inc
on 2/3/15, 1:46 AM

no

aci aisha
on 2/3/15, 1:49 AM

U r right atchuthan,Im sorry.. But how i find the module? I didnt put it in the security file...My security file is as follows, Trademark User Company Registeration User

aci aisha
on 2/3/15, 1:51 AM
Trademark User Company Registeration User
aci aisha
on 2/3/15, 1:51 AM

Cant put here...i pt it as an aswer,..

aci aisha
on 2/3/15, 1:52 AM

update your security file in question itself

Atchuthan - Technical Consultant, Sodexis Inc
on 2/3/15, 1:52 AM

Yes,I GOT IT.. I upvote u & mark it as True!!!

aci aisha
on 2/3/15, 1:55 AM
0
abin c ibrahim
On 2/3/15, 1:41 AM

Try this,,,

                 <field name="file_no" groups="base.group_trademark_user"/>

                                                    instead of

                 <field name="file_no" groups="group_trademark_user"/>
 

 

Thanks Abin...Its Solved!!!

aci aisha
on 2/3/15, 1:42 AM

@abin, it is not always base. you need to find where this group is defined and use that modules name. groups="YOUR_MODULE.group_trademark_user"

Atchuthan - Technical Consultant, Sodexis Inc
on 2/3/15, 1:44 AM

Sorry Abin, Actually Its not working,,, See Atchuthans Answer!!!

aci aisha
on 2/3/15, 1:56 AM
-1
aci aisha
On 2/3/15, 1:52 AM

<record id="group_trademark_user" model="res.groups">
        <field name="name">Trademark User</field>
    </record>
    
        <record id="group_company_registeration_user" model="res.groups">
        <field name="name">Company Registeration User</field>
    </record>

group definition is correct

Atchuthan - Technical Consultant, Sodexis Inc
on 2/3/15, 1:55 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

1 follower(s)

Stats

Asked: 2/3/15, 1:15 AM
Seen: 642 times
Last updated: 3/16/15, 8:10 AM