res_partner_view.xml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?xml version="1.0"?>
  2. <openerp>
  3. <data>
  4. <act_window
  5. id="action_open_cars"
  6. name="Vehiculos"
  7. res_model="car.service"
  8. view_type="form"
  9. view_mode="tree,form"
  10. domain="[('partner_id', '=', active_id)]"/>
  11. <act_window
  12. id="action_open_secure_cars"
  13. name="Vehiculos Asegurados"
  14. res_model="car.service"
  15. view_type="form"
  16. view_mode="tree,form"
  17. domain="[('secure_id', '=', active_id)]"/>
  18. <record id="res_partner_secure_form_view" model="ir.ui.view">
  19. <field name="name">partner.secure.form.view</field>
  20. <field name="model">res.partner</field>
  21. <field name="inherit_id" ref="base.view_partner_form"/>
  22. <field name="arch" type="xml">
  23. <field name="category_id" position="after">
  24. <field name="is_insurer" class="oe_inline" attrs="{'invisible': [('is_company','=', False)]}"/><label for="is_insurer" string="¿Es un Aseguradora?" attrs="{'invisible': [('is_company','=', False)]}"/>
  25. <field name="is_agent" class="oe_inline" attrs="{'invisible': [('is_company','!=', False)]}"/><label for="is_agent" string="¿Es un Agente?" attrs="{'invisible': [('is_company','!=', False)]}"/>
  26. </field>
  27. <field name="parent_id" position="replace">
  28. <field name="parent_id" placeholder="Company" domain="[('is_company', '=', True),('is_insurer', '=', True)]" context="{'default_is_company': True, 'default_supplier': supplier, 'default_customer': customer}" attrs="{'invisible': [('is_company','=', True),('parent_id', '=', False)],'required': [('is_agent','=', True)]}" on_change="onchange_address(use_parent_address, parent_id)"/>
  29. </field>
  30. <div name="buttons" position="after">
  31. <div class="oe_right oe_button_box">
  32. <button
  33. class="oe_inline oe_stat_button"
  34. type="action"
  35. name="%(action_open_cars)d"
  36. icon="fa fa-car"
  37. attrs="{'invisible': [('customer', '=', False)]}">
  38. <field name="car_count" string="Vehiculos" widget="statinfo" />
  39. </button>
  40. <button
  41. class="oe_inline oe_stat_button"
  42. type="action"
  43. name="%(action_open_secure_cars)d"
  44. icon="fa fa-folder-open"
  45. attrs="{'invisible': [('is_insurer', '=', False)]}">
  46. <field name="car_secure_count" string="Asegurados" widget="statinfo" />
  47. </button>
  48. </div>
  49. </div>
  50. </field>
  51. </record>
  52. </data>
  53. </openerp>