~camptocamp/sale-financial/7.0-port-sale_markup

« back to all changes in this revision

Viewing changes to sale_markup/sale_view.xml

  • Committer: Yannick Vaucher
  • Date: 2014-04-15 08:53:20 UTC
  • Revision ID: yannick.vaucher@camptocamp.com-20140415085320-qxi557dtj1d45von
improve view inheritance by using more specific paths and add more context to product_id_change

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
      <field name="model">sale.order</field>
56
56
      <field name="inherit_id" ref="sale.view_order_form" />
57
57
      <field name="arch" type="xml">
58
 
        <xpath expr="//field[@name='product_id']"
 
58
        <xpath expr="//field[@name='order_line']/form//field[@name='product_id']"
59
59
               position="attributes">
60
 
          <attribute name="context_markup">{'discount': discount, 'price_unit': price_unit}</attribute>
 
60
          <attribute name="context_markup">{'discount': discount, 'price_unit': price_unit, 'markup_rate': markup_rate, 'commercial_margin': commercial_margin}</attribute>
61
61
        </xpath>
62
 
        <xpath expr="//field[@name='price_unit']"
 
62
        <xpath expr="//field[@name='order_line']/form//field[@name='price_unit']"
63
63
               position="attributes">
64
64
          <attribute name="context_markup">{'price_unit': price_unit, 'product_id': product_id, 'discount': discount, 'product_uom': product_uom, 'pricelist': parent.pricelist_id, 'markup_rate': markup_rate, 'commercial_margin': commercial_margin}</attribute>
65
65
        </xpath>
66
 
        <xpath expr="//field[@name='discount']"
 
66
        <xpath expr="//field[@name='order_line']/form//field[@name='discount']"
67
67
               position="attributes">
68
68
          <attribute name="context_markup">{'product_id': product_id, 'price_unit': price_unit, 'discount': discount, 'product_uom': product_uom, 'pricelist': parent.pricelist_id, 'markup_rate': markup_rate, 'commercial_margin': commercial_margin, 'break_onchange': break_onchange_discount}</attribute>
69
69
        </xpath>
85
85
             <field name="break_onchange_discount" invisible="1"/>
86
86
          </group>
87
87
        </xpath>
88
 
        <xpath expr="//field[@name='product_uom_qty']" position="attributes">
 
88
        <xpath expr="//field[@name='order_line']/form//field[@name='product_uom_qty']" position="attributes">
89
89
          <attribute name="context_markup">{'discount': discount, 'price_unit': price_unit, 'markup_rate': markup_rate, 'commercial_margin': commercial_margin}</attribute>
90
90
        </xpath>
91
91
      </field>