res_partner_view.xml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <odoo>
  3. <record id="view_partner_property_form" model="ir.ui.view">
  4. <field name="name">res.partner.pos.form.inherit</field>
  5. <field name="model">res.partner</field>
  6. <field name="inherit_id" ref="base.view_partner_form"/>
  7. <field name="priority" eval="4"/>
  8. <field name="arch" type="xml">
  9. <div name="button_box" position="inside">
  10. <button class="oe_stat_button" type="object" name="action_view_pos_order"
  11. groups="point_of_sale.group_pos_user"
  12. context="{'default_partner_id': active_id}"
  13. attrs="{'invisible': [('pos_order_count', '=', 0)]}"
  14. icon="fa-shopping-bag">
  15. <field string="PoS Orders" name="pos_order_count" widget="statinfo"/>
  16. </button>
  17. </div>
  18. <xpath expr="//group[@name='purchase']" position="after">
  19. <group string="Point Of Sale" name="point_of_sale" groups="point_of_sale.group_pos_user">
  20. <field name="barcode"/>
  21. </group>
  22. </xpath>
  23. </field>
  24. </record>
  25. <record id="view_partner_pos_kanban" model="ir.ui.view">
  26. <field name="name">res.partner.pos.kanban.inherit</field>
  27. <field name="model">res.partner</field>
  28. <field name="inherit_id" ref="base.res_partner_kanban_view"/>
  29. <field name="arch" type="xml">
  30. <field name="state_id" position="before">
  31. <field name="pos_order_count" groups="point_of_sale.group_pos_user"/>
  32. </field>
  33. <xpath expr="//div[hasclass('oe_kanban_bottom_left')]" position="inside">
  34. <a t-if="record.pos_order_count.value>0" data-type="object" data-name="action_view_pos_order"
  35. groups="point_of_sale.group_pos_user"
  36. href="#" class="oe_kanban_action oe_kanban_action_a me-1">
  37. <span class="badge rounded-pill">
  38. <i class="fa fa-fw fa-shopping-bag" role="img" aria-label="Shopping cart" title="Shopping cart"/>
  39. <t t-out="record.pos_order_count.value"/>
  40. </span>
  41. </a>
  42. </xpath>
  43. </field>
  44. </record>
  45. </odoo>