Skip to Content
Menu
This question has been flagged
1 Reply
4740 Views

i'm using odoo 8 and i want to know how to add a page that contains list of product and theire quantity in a view, to mention in a request for intervention which products we are going to modify. In that way we can estimate how costs every intervention

view.xml

  <?xml version="1.0" encoding="utf-8"?>
 <openerp>
<data>
    <record id="view_intervention_form" model="ir.ui.view">
        <field name="name">cmms.intervention.form</field>
        <field name="model">cmms.intervention</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Intervention request" version="7.0">
                <header>
                    <button name="action_broadcast"  type="object" string="Déffuser mail" icon="STOCK_REDO"/>
                    <button name="action_done" states="draft" string="Valider" type="object" icon="gtk-apply"/>
                    <button name="action_cancel" states="done," string="Annuler" type="object"  icon="gtk-cancel"/>
                    <button name="action_draft" states="cancel" string="Remettre en brouillon" type="object" icon="terp-stock_effects-object-colorize"/>
                    <field name="state" widget="statusbar" />
                </header>
                <sheet>
                <group>
                <group>
                <field name="name" select="1" />
                <field name="user_id" select="1" colspan="1" />
                <field name="user2_id"  />
                <field name="priority"  />
                <field name="state_machine" />
                 <field name="product_id"/>
                </group>
                <group>
                <field name="type" select="1" colspan="1" />
                <field name="equipment_id" select="1" colspan="1" />
                <field name="date_inter"  />
                <field name="date_end"  />
                </group>
                </group>
                <newline />
                <notebook colspan="1">
                    <page string="Motif d'intervention">
                        <field name="motif" />
                    </page>
                    <page string="Observation">
                        <field name="observation" />
                    </page>
                     </notebook>

                </sheet>
                <div class="oe_chatter">
                    <field name="message_follower_ids" widget="mail_followers"/>
                    <field name="message_ids" widget="mail_thread"/>
                </div>
            </form>
        </field>
    </record>
     </data>
   </openerp>
Avatar
Discard
Best Answer

Hi,

You can add a column in your python code :

product_list = fields.Many2many('product.product','intervention_products_rel')

and then call it in you xml file to display it in ur view : 

<page string="Modified products">
     <field name="product_list" /> </page>

Hope that answered your questions.

Avatar
Discard
Related Posts Replies Views Activity
5
Sep 20
6857
0
Feb 19
4164
2
Nov 18
5649
0
May 18
1830
1
Apr 24
23776