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.

109 lines
4.8 KiB

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!-- Copyright 2019 Open Source Integrators
  3. License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
  4. <odoo>
  5. <record id="partner_form_tier" model="ir.ui.view">
  6. <field name="name">partner.form.tier</field>
  7. <field name="model">res.partner</field>
  8. <field name="inherit_id" ref="base.view_partner_form" />
  9. <field name="arch" type="xml">
  10. <xpath expr="/form/sheet" position="before">
  11. <header>
  12. <field name="state" widget="statusbar" statusbar_visible="new, approved" />
  13. <button
  14. name="request_validation"
  15. string="Request Validation"
  16. attrs="{'invisible': ['|','|',('need_validation', '!=', True),('rejected','=',True),('state','not in',['new','to approve'])]}"
  17. type="object"
  18. />
  19. <button
  20. name="restart_validation"
  21. string="Restart Validation"
  22. attrs="{'invisible': ['|',('review_ids', '=', []),('state','not in',['new','to approve'])]}"
  23. type="object"
  24. />
  25. </header>
  26. </xpath>
  27. <header position="after">
  28. <field name="need_validation" invisible="1" />
  29. <field name="validated" invisible="1" />
  30. <field name="rejected" invisible="1" />
  31. <field name="reviewer_ids" invisible="1" />
  32. <div
  33. class="alert alert-warning"
  34. role="alert"
  35. attrs="{'invisible': ['|', '|', '|',
  36. ('validated', '=', True), ('state', 'not in', ['new','to approve']),
  37. ('rejected', '=', True), ('review_ids', '=', [])]}"
  38. style="margin-bottom:0px;"
  39. >
  40. <p><i class="fa fa-info-circle" />This partner needs to be
  41. approved before it can have transactions.
  42. <field name="can_review" invisible="1" />
  43. <button
  44. name="validate_tier"
  45. string="Validate"
  46. attrs="{'invisible': [('can_review', '=', False)]}"
  47. type="object"
  48. class="oe_inline oe_button btn-success"
  49. icon="fa-thumbs-up"
  50. />
  51. <button
  52. name="reject_tier"
  53. string="Reject"
  54. attrs="{'invisible': [('can_review', '=', False)]}"
  55. type="object"
  56. class="btn-icon btn-danger"
  57. icon="fa-thumbs-down"
  58. />
  59. </p>
  60. </div>
  61. <div
  62. class="alert alert-success"
  63. role="alert"
  64. attrs="{'invisible': ['|', '|', ('validated', '!=', True), ('state', 'not in', ['new','to approve']), ('review_ids', '=', [])]}"
  65. style="margin-bottom:0px;"
  66. >
  67. <p><i class="fa fa-thumbs-up" /> Partner has been <b
  68. >approved and now can have transactions</b>!</p>
  69. </div>
  70. <div
  71. class="alert alert-danger"
  72. role="alert"
  73. attrs="{'invisible': ['|', '|', ('rejected', '!=', True), ('state', 'not in', ['new','to approve']), ('review_ids', '=', [])]}"
  74. style="margin-bottom:0px;"
  75. >
  76. <p><i class="fa fa-thumbs-down" /> Partner creation has been <b
  77. >rejected</b>.</p>
  78. </div>
  79. </header>
  80. <xpath expr="//form/div[hasclass('oe_chatter')]" position="before">
  81. <field
  82. name="review_ids"
  83. widget="tier_validation"
  84. attrs="{'invisible':[('review_ids', '=', [])]}"
  85. />
  86. </xpath>
  87. </field>
  88. </record>
  89. <record id="partner_form_tier_filter" model="ir.ui.view">
  90. <field name="name">partner.form.tier.filter</field>
  91. <field name="model">res.partner</field>
  92. <field name="inherit_id" ref="base.view_res_partner_filter" />
  93. <field name="arch" type="xml">
  94. <filter name="type_person" position="before">
  95. <filter
  96. name="needs_review"
  97. string="Needs my Review"
  98. domain="[('reviewer_ids','in',uid), ('state', 'not in', ['approved','to approve'])]"
  99. help="Partner(s) to review"
  100. />
  101. </filter>
  102. </field>
  103. </record>
  104. </odoo>