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.

2

changing fields position

By
Frankie Chan
on 7/9/14, 12:17 AM 2,370 views

Please refer to the figure here.

I would llike to swap the position of the fields "street", which labeled as "Address" and that of the field "name", which is labeled as "Contact Person name".

However, I cannot remove the string "Address" on the left hand side

The origianl res_partner_view.xml writes:

------------------------------------------------------------------------------------------------------------------------------------------------------

 <record id="view_partner_form" model="ir.ui.view">
            <field name="name">res.partner.form</field>
            <field name="model">res.partner</field>
            <field eval="1" name="priority"/>
            <field name="arch" type="xml">
                <form string="Partners" version="7.0">
                <sheet>

                         ....................

                  <group>
                        <group>

                                 ....................

                               <label for="street" string="Address"/>
                                <div>

                                    ....................

                                        <field name="street" placeholder="Street..."  attrs="{'readonly': [('use_parent_address','=',True)]}"/>

------------------------------------------------------------------------------------------------------------------------------------------------------

As you can see, there is a label, <label for="street" string="Address"/>, which makes me unable to remove it in openerp.

What code shoud I write?

Thanks

0

Vasiliy Birukov

--Vasiliy Birukov--
3446
| 6 6 8
Russian Federation
--Vasiliy Birukov--

Help develop and implement any project on base Odoo.

Vasiliy Birukov
On 7/9/14, 3:25 AM

Under label Address placed several fields. If you need move only field street, just redefine label for other filed. For example:

<label for="street2" string="Address"/>

0

Jagdish Panchal

--Jagdish Panchal--
2674
| 5 3 6
Gandhinagar, India
--Jagdish Panchal--

OpenERP Developer

Jagdish Panchal
On 7/9/14, 5:01 AM

Hi

Refer below code

test_module(add following file)
- __init__.py
- __openeerp__.py
- test_customer_view.xml

__openerp__.py

{
    'name': 'Test module,
    'version': '0.1',
    'category': 'Others',
    'complexity': "normal",
    'description': """ description related your module """
    'author': ['author of moudule'],
    'website': 'website name',
    'depends': [
        "base" #This module depend on the res_partner thats why I add base
    ],
    'init_xml': [
        #Demo data file if you want create any.
    ],
    'update_xml': [
        "test_customer_view.xml",
    ],
    'demo_xml': [],
    'test': [],
    'installable': True,
    'auto_install': False,
    'application': False,
    'images': [],
    'js': [],
}

test_customer_view.xml:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
  <data>
    <record model="ir.ui.view" id="view_customer_test_form">
        <field name="name">res.partner.form</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form" />
        <field name="arch" type="xml">

              <field name="street" placeholder="Street..." position="replace">
                  <field name="street" placeholder="Street..."  string ="xxy"/>
              </field>

        </field>
    </record>

  </data>
</openerp>

0
Frankie Chan
On 7/9/14, 4:51 AM

I have tried the following but it does not work. Can you please give the details?

<?xml version="1.0" encoding="utf-8"?>
<openerp>
  <data>
    <record model="ir.ui.view" id="view_customer_test_form">
        <field name="name">res.partner.form</field>
        <field name="model">res.partner</field>
        <field name="inherit_id" ref="base.view_partner_form" />
        <field name="arch" type="xml">


              <label for="street" string="xxy"/>

        </field>
    </record>

  </data>
</openerp>

@ Frankie Chan: Create new module add xml file and install your new module. so you did not need to change existing moduel

Jagdish Panchal
on 7/9/14, 6:45 AM
Hi Jagdish,

Thanks for your reply.

Yes, you are right. I can create new module.

However, I am new to openerp. In the new xml file, I need to create view_form, view_tree, action form, menuitem and so on, which is very difficult to me.

Besides, there are many folders I need to take care of, for example, static, i18n, images, security, css, src, js, etc. They are also very new to me.

I can directly change the existing file but it will be better if I can copy it to a new file and change what I need.

Can you suggest?

Thanks.

Regards,

Frankie


On Wed, Jul 9, 2014 at 6:45 PM, Jagdish Panchal <jnp1682@openerp.my.openerp.com> wrote:

@ Frankie Chan: Create new module add xml file and install your new module. so you did not need to change existing moduel

--
Jagdish Panchal Sent by OpenERP Inc. using OpenERP. Access your messages and documents in Odoo

Frankie Chan
on 7/9/14, 8:34 AM

Hi just add test_customer_view.xml file in your module and add this code in your file.

Jagdish Panchal
on 7/9/14, 8:51 AM
In test_customer_view.xml, which code should I add ?


On Wed, Jul 9, 2014 at 8:51 PM, Jagdish Panchal <jnp1682@openerp.my.openerp.com> wrote:

Hi just add test_customer_view.xml file in your module and add this code in your file.

--
Jagdish Panchal Sent by OpenERP Inc. using OpenERP. Access your messages and documents in Odoo

Frankie Chan
on 7/9/14, 10:37 AM

@ Frankie Chan: Add code in my answer in test_customer_view.xml thanks

Jagdish Panchal
on 7/9/14, 11:40 PM

Hi Frankie Chan: I have update answer check it.

Jagdish Panchal
on 7/10/14, 12:40 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: 7/9/14, 12:17 AM
Seen: 2370 times
Last updated: 9/24/15, 12:40 PM