sale_view.xml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <openerp>
  3. <data>
  4. <record id="discount_view_orer_line_form" model="ir.ui.view">
  5. <field name="name">discount.sale.order.line.form</field>
  6. <field name="model">sale.order.line</field>
  7. <field name="inherit_id" ref="sale.view_order_line_form2"/>
  8. <field name="arch" type="xml">
  9. <xpath expr="//field[@name='discount']" position="attributes">
  10. <attribute name="digits">(16, 2)</attribute>
  11. </xpath>
  12. </field>
  13. </record>
  14. <record id="discount_sale_view_form" model="ir.ui.view">
  15. <field name="name">discount.sale.order.form</field>
  16. <field name="model">sale.order</field>
  17. <field name="inherit_id" ref="sale.view_order_form"/>
  18. <field name="arch" type="xml">
  19. <xpath expr="//tree/field[@name='discount']" position="attributes">
  20. <attribute name="digits">(16, 2)</attribute>
  21. </xpath>
  22. <xpath expr="//tree[@string='Sales Order Lines']//field[@name='discount']" position="after">
  23. <field name="discount_amount" readonly="1"/>
  24. </xpath>
  25. <xpath expr="//group[@name='sale_total']" position="replace">
  26. <group col="4">
  27. <group name="discount" colspan="2">
  28. <field name="discount_type"/>
  29. <field name="discount_rate"/>
  30. </group>
  31. <group class="oe_subtotal_footer oe_right" colspan="2" name="sale_total">
  32. <field name="amount_untaxed" widget='monetary' options="{'currency_field': 'currency_id'}"/>
  33. <field name="amount_discount" widget='monetary' options="{'currency_field': 'currency_id'}"/>
  34. <field name="amount_tax" widget='monetary' options="{'currency_field': 'currency_id'}"/>
  35. <div class="oe_subtotal_footer_separator oe_inline">
  36. <label for="amount_total" />
  37. <button name="button_dummy"
  38. states="draft,sent" string="(update)" type="object" class="oe_edit_only oe_link"/>
  39. </div>
  40. <field name="amount_total" nolabel="1" class="oe_subtotal_footer_separator" widget='monetary' options="{'currency_field': 'currency_id'}"/>
  41. </group>
  42. </group>
  43. </xpath>
  44. <xpath expr="//button[@string='Create Invoice']" position="attributes">
  45. <attribute name="context">{'discount_type':discount_type,'discount_rate':discount_rate,'amount_discount':amount_discount}</attribute>
  46. </xpath>
  47. </field>
  48. </record>
  49. </data>
  50. </openerp>