You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
3.5 KiB

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <odoo>
  3. <record id="view_partner_form" model="ir.ui.view">
  4. <field name="name">Add separate fields for street name and number</field>
  5. <field name="model">res.partner</field>
  6. <field name="inherit_id" ref="base.view_partner_form"/>
  7. <field name="arch" type="xml">
  8. <xpath expr="//div[@class='o_address_format']//field[@name='street']"
  9. position="after">
  10. <field name="street_name" class="o_address_street_name"
  11. placeholder="Street..."
  12. attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}"
  13. />
  14. <field name="street_number" class="o_address_street_number"
  15. placeholder="Number..."
  16. attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}"
  17. />
  18. </xpath>
  19. <xpath expr="//div[@class='o_address_format']//field[@name='street']"
  20. position="attributes">
  21. <attribute name="invisible">1</attribute>
  22. </xpath>
  23. <xpath expr="//div[@name='div_address']//field[@name='street']"
  24. position="after">
  25. <field name="street_name" class="o_address_street_name"
  26. placeholder="Street..."
  27. />
  28. <field name="street_number" class="o_address_street_number"
  29. placeholder="Number..."
  30. />
  31. </xpath>
  32. <xpath expr="//div[@name='div_address']//field[@name='street']"
  33. position="attributes">
  34. <attribute name="invisible">1</attribute>
  35. </xpath>
  36. <xpath expr="//field[@name='child_ids']" position="attributes">
  37. <attribute name="context">{'default_parent_id': active_id, 'default_street_name': street_name, 'default_street_number': street_number, 'default_street2': street2, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_supplier': supplier, 'default_customer': customer}</attribute>
  38. </xpath>
  39. </field>
  40. </record>
  41. <record id="view_partner_address_form" model="ir.ui.view">
  42. <field name="name">Add separate fields for street name and number in address form</field>
  43. <field name="model">res.partner</field>
  44. <field name="inherit_id" ref="base.view_partner_address_form"/>
  45. <field name="arch" type="xml">
  46. <xpath expr="//div[@class='o_address_format']//field[@name='street']"
  47. position="after">
  48. <field name="street_name" class="o_address_street_name"
  49. placeholder="Street..."
  50. />
  51. <field name="street_number" class="o_address_street_number"
  52. placeholder="Number..."
  53. />
  54. </xpath>
  55. <xpath expr="//div[@class='o_address_format']//field[@name='street']"
  56. position="attributes">
  57. <attribute name="invisible">1</attribute>
  58. </xpath>
  59. </field>
  60. </record>
  61. </odoo>