Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
12532 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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"/>

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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>

Ảnh đại diện
Huỷ bỏ

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

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

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

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: Add code in my answer in test_customer_view.xml thanks

Hi Frankie Chan: I have update answer check it.

Câu trả lời hay nhất

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>

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 6 22
1745
0
thg 1 21
2864
0
thg 11 19
4908
2
thg 8 17
4266
2
thg 7 17
6443