product_view.xml 3.79 KB
Newer Older
François C. committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
<?xml version="1.0" encoding="utf-8"?>
<openerp>
  <data>
    <record id="agreement in product view" model="ir.ui.view">
      <field name="name">agreement in product view</field>
      <field name="model">product.product</field>
      <field name="inherit_id" ref="product.product_normal_form_view"/>
      <field name="arch" type="xml">
        <field name="seller_ids" position="after">
          <group string="Framework agreements (LTA)" colspan="4">
            <field name="framework_agreement_ids" nolabel="1">
              <form version="7.0" string="Framework Agreement">
                <header>
                  <button name="open_agreement"
                          context="{}"
                          string="Open Agreement"
                          type="object"
                          attrs="{'invisible': ['|', ('draft', '=', False), '|', ('start_date', '=', False), '|', ('end_date', '=', False), ('framework_agreement_pricelist_ids', '=', [])]}"/>
                  <field name="state"
                         widget="statusbar"
                         nolabel="1"
                         statusbar_visible="draft,future,running,consumed,closed"
                         statusbar_colors='{"draft":"blue","future": "blue", "closed": "blue", "running": "green", "consumed": "red"}'/>
                </header>
                <sheet>
                  <group>
                    <field name="name"/>
                    <field name="draft" invisible="1"/>
                    <field name="origin"/>
                  </group>
                  <group>
                    <group>
                      <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                      <field name="supplier_id" context="{'default_supplier': True, 'default_customer': False}"/>
                    </group>
                    <group>
                      <field name="delay"/>
                      <field name="quantity"/>
                      <field name="available_quantity"/>
                    </group>
                  </group>

                  <group string="Dates">
                    <field name="start_date"
                           required="1"/>
                    <field name="end_date"
                           required="1"/>
                  </group>
                  <notebook>
                    <page string="Negociated price lists" colspan="4">
                      <field name="framework_agreement_pricelist_ids"
                             attrs="{'required': [('draft', '=', False)]}">
                        <tree type="7.0" string="Price list">
                          <field name="currency_id"/>
                        </tree>
                        <form type="7.0" string="Price list">
                          <group>
                            <field name="currency_id"/>
                          </group>
                          <newline/>
                          <notebook>
                            <page string="Price lines" colspan="4">
                              <field name="framework_agreement_line_ids"
                                     nolabel="1">
                                <tree type="7.0"
                                      string="Price line"
                                      editable="top">
                                  <field name="quantity"/>
                                  <field name="price"/>
                                </tree>
                              </field>
                            </page>
                          </notebook>
                        </form>
                      </field>
                    </page>
                  </notebook>
                </sheet>
              </form>
            </field>
          </group>
        </field>
      </field>
    </record>
  </data>
</openerp>