account_invoice.xml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <openerp>
  3. <data>
  4. <record id="invoice_pricelist_form" model="ir.ui.view">
  5. <field name="name">account.invoice.pricelist.form</field>
  6. <field name="model">account.invoice</field>
  7. <field name="inherit_id" ref="account.invoice_form"/>
  8. <field name="arch" type="xml">
  9. <xpath expr="//field[@name='fiscal_position']" position="after">
  10. <field name="pricelist_id" domain="[('type','=','sale'),('active','=',True)]" groups="product.group_sale_pricelist" attrs="{'readonly':[('state','!=','draft')]}" string="Lista de precios"/>
  11. </xpath>
  12. <xpath expr="//field[@name='invoice_line']/tree/field[@name='product_id']" position="attributes">
  13. <attribute name="context">{'type': type, 'pricelist_id': parent.pricelist_id}</attribute>
  14. </xpath>
  15. <xpath expr="//field[@name='invoice_line']/tree/field[@name='quantity']" position="attributes">
  16. <attribute name="context">{'type': type, 'pricelist_id': parent.pricelist_id}</attribute>
  17. <attribute name="on_change">product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, parent.company_id, context)</attribute>
  18. </xpath>
  19. </field>
  20. </record>
  21. <record id="invoice_pricelist_supplier_form" model="ir.ui.view">
  22. <field name="name">account.invoice.pricelist.form</field>
  23. <field name="model">account.invoice</field>
  24. <field name="inherit_id" ref="account.invoice_supplier_form"/>
  25. <field name="arch" type="xml">
  26. <xpath expr="//field[@name='fiscal_position']" position="after">
  27. <field name="pricelist_id" domain="[('type','=','purchase'),('active','=',True)]" groups="product.group_purchase_pricelist" attrs="{'readonly':[('state','!=','draft')]}" string="Lista de precios"/>
  28. </xpath>
  29. <xpath expr="//field[@name='invoice_line']/tree/field[@name='product_id']" position="attributes">
  30. <attribute name="context">{'type': type, 'pricelist_id': parent.pricelist_id}</attribute>
  31. </xpath>
  32. <xpath expr="//field[@name='invoice_line']/tree/field[@name='quantity']" position="attributes">
  33. <attribute name="context">{'type': type, 'pricelist_id': parent.pricelist_id}</attribute>
  34. <attribute name="on_change">product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, parent.company_id, context)</attribute>
  35. </xpath>
  36. </field>
  37. </record>
  38. </data>
  39. </openerp>