Customizing views

Asked by Aldin Draghoender

Hi!
I'm using the web client and would like to know how one add/remove views in a model and also add/remove fields. If anyone can poiunt me in the right direction, I would be grateful.

Thanks in advance,
Aldin

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Web Client Edit question
Assignee:
No assignee Edit question
Solved by:
John Chen
Solved:
Last query:
Last reply:
Revision history for this message
Best John Chen (john-chen2011) said :
#1

Hi Aldin Draghoender

For adding and remove fields in the view.

For example go to:
Administration -> Customization -> User Interface -> Views
- Try input purchase.order in Object: Textbox and search
- Choose purchase.order.form with a XML ID purchase.purchase_order_form
- Open it
- Inside there is a XML code, every fields that we see in the form are showing through XML
  so try to edit the <field name="date_order" invisible="1"/>

By adding invisible="1" the selected field will be invisible and you can also do other thing using other code, or even just delete it.

Hope this information is helpful

From

John

Revision history for this message
Aldin Draghoender (aldin-draghoender) said :
#2

Thanks for the swift reply, however I wondered if it is possible to be guided through the process of removing removing a tab or does the same principle from your reply apply. For example if I open Purchase Management > Purchase Orders and choose an order, one will find tabs named Purchase order, Delivery & Invoicing and notes. My mission is to remove a tab anprobably rename the other. How is this done?

Thanks in advance
"Newbie"
Aldin Draghoender

________________________________

Från: <email address hidden> genom John Chen
Skickat: ti 2011-09-06 08:45
Till: Draghoender, Aldin
Ämne: Re: [Question #170200]: Customizing views

Your question #170200 on OpenERP Web Client changed:
https://answers.launchpad.net/openobject-client-web/+question/170200

    Status: Open => Answered

John Chen proposed the following answer:
Hi Aldin Draghoender

For adding and remove fields in the view.

For example go to:
Administration -> Customization -> User Interface -> Views
- Try input purchase.order in Object: Textbox and search
- Choose purchase.order.form with a XML ID purchase.purchase_order_form
- Open it
- Inside there is a XML code, every fields that we see in the form are showing through XML
  so try to edit the <field name="date_order" invisible="1"/>

By adding invisible="1" the selected field will be invisible and you can
also do other thing using other code, or even just delete it.

Hope this information is helpful

From

John

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/openobject-client-web/+question/170200/+confirm?answer_id=0

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/openobject-client-web/+question/170200

You received this question notification because you asked the question.

Revision history for this message
Aldin Draghoender (aldin-draghoender) said :
#3

To make myself clear, I meant how can I customize the Purchase Management > Purchase Orders menu (in the menu in the left window) which lists the all purchases in a tree view. I guess my question is which file it is and how do i reach it.

BTW thank you John, it I got to add/ remove views easily.

Best Regards
Aldin

Revision history for this message
Aldin Draghoender (aldin-draghoender) said :
#4

Thanks John Chen, that solved my question.

Revision history for this message
John Chen (john-chen2011) said :
#5

Hi Aldin Draghoender

I never tried using configuration to customize the menu at the left side.
But i usually use importing .zip module method to change the menu at the left side.

Do you have the source code of the openerp? if u have u, try using eclipse or other supported program to open the purchase_view.xml.

In the purchase_view.xml it shows:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
       <menuitem icon="terp-purchase" id="base.menu_purchase_root" name="Purchases" sequence="3"
           groups="group_purchase_manager,group_purchase_user"
           web_icon="images/purchases.png"
           web_icon_hover="images/purchases-hover.png"/>
       <menuitem id="menu_procurement_management" name="Purchase Management"
            parent="base.menu_purchase_root" sequence="1" />
--------------
Explanation:
-U can see the menuitem icon = "terp-purchase" (this is the row bar menu likes sales purchases warehouse etc) with an id of base.menu_purchase_root and name = "Purchases". Iam not sure about the groups but i guess is to lead this new menu under that group so it can show at the menu page.

- so in order to add new left menu at the left side. u can see the second menutiem, name = "Purchase Management" and it direct it parent to = "base.menu_purchase_root" which is the id of the menu "Purchases" so it will show under it.
--------------
        <menuitem id="menu_purchase_config_purchase" name="Configuration"
            groups="group_purchase_manager"
            parent="base.menu_purchase_root" sequence="100"/>

        <menuitem
            id="menu_purchase_config_pricelist" name="Pricelists"
            parent="menu_purchase_config_purchase" sequence="50"/>

        <menuitem
            action="product.product_pricelist_action" id="menu_product_pricelist_action_purhase"
            parent="menu_purchase_config_pricelist" sequence="20"/>

        <menuitem
            action="product.product_pricelist_action2" id="menu_product_pricelist_action2_purchase"
            parent="menu_purchase_config_pricelist" sequence="10"/>

        <menuitem
            action="product.product_pricelist_type_action" id="menu_purchase_product_pricelist_type"
            parent="menu_purchase_config_pricelist" sequence="2"
            groups="base.group_extended"/>
---------------------------
Explanation:
- in here there are action="product.product_pricelist_type_action"
- the action is for calling form. in here it call the menu from other menu / section like product.
- so in order to call a menu u have to included an action=""
---------------------------
        <menuitem
            id="menu_product_in_config_purchase" name="Product"
            parent="menu_purchase_config_purchase" sequence="30"/>

        <menuitem
            action="product.product_category_action_form" id="menu_product_category_config_purchase"
            parent="purchase.menu_product_in_config_purchase" sequence="10"/>

        <menuitem
            id="menu_purchase_unit_measure_purchase" name="Units of Measure"
            parent="purchase.menu_product_in_config_purchase" sequence="20"/>

        <menuitem
             action="product.product_uom_categ_form_action" id="menu_purchase_uom_categ_form_action"
             parent="menu_purchase_unit_measure_purchase" sequence="30"/>

        <menuitem
              action="product.product_uom_form_action" id="menu_purchase_uom_form_action"
              parent="menu_purchase_unit_measure_purchase" sequence="30"/>