portal_wizard_views.xml 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- wizard action on res.partner -->
  4. <record id="partner_wizard_action_create_and_open" model="ir.actions.server">
  5. <field name="name">Grant portal access</field>
  6. <field name="model_id" ref="portal.model_portal_wizard"/>
  7. <field name="binding_model_id" ref="base.model_res_partner"/>
  8. <field name="state">code</field>
  9. <field name="code">action = model.action_open_wizard()</field>
  10. </record>
  11. <record id="partner_wizard_action" model="ir.actions.act_window">
  12. <field name="name">Grant portal access</field>
  13. <field name="res_model">portal.wizard</field>
  14. <field name="view_mode">form</field>
  15. <field name="target">new</field>
  16. <field name="binding_model_id" eval="False"/>
  17. </record>
  18. <!-- wizard view -->
  19. <record id="wizard_view" model="ir.ui.view">
  20. <field name="name">Grant portal access</field>
  21. <field name="model">portal.wizard</field>
  22. <field name="arch" type="xml">
  23. <form string="Portal Access Management">
  24. <div class="mb-3">
  25. Select which contacts should belong to the portal in the list below.
  26. The email address of each selected contact must be valid and unique.
  27. If necessary, you can fix any contact's email address directly in the list.
  28. </div>
  29. <field name="welcome_message"
  30. placeholder="This text is included at the end of the email sent to new portal users."
  31. class="mb-3"/>
  32. <field name="user_ids" class="o_portal_wizard_user_one2many" widget="portal_wizard_user_one2many">
  33. <tree string="Contacts" editable="bottom" create="false" delete="false">
  34. <field name="partner_id" force_save="1"/>
  35. <field name="email" attrs="{'readonly': [('is_internal', '=', True)]}"/>
  36. <field name="email_state" invisible="1"/>
  37. <button name="action_refresh_modal" type="object" icon="fa-check text-success"
  38. attrs="{'invisible': [('email_state', '!=', 'ok')]}" title="Valid Email Address"/>
  39. <button name="action_refresh_modal" type="object" icon="fa-times text-danger"
  40. attrs="{'invisible': [('email_state', '!=', 'ko')]}" title="Invalid Email Address"/>
  41. <button name="action_refresh_modal" type="object" icon="fa-user-times text-danger"
  42. attrs="{'invisible': [('email_state', '!=', 'exist')]}" title="Email Address already taken by another user"/>
  43. <field name="login_date"/>
  44. <field name="is_portal" invisible="1"/>
  45. <field name="is_internal" invisible="1"/>
  46. <button string="Grant Access" name="action_grant_access" type="object" class="btn-secondary"
  47. attrs="{'invisible': ['|', '|', ('is_portal', '=', True), ('is_internal', '=', True), ('email_state', '!=', 'ok')]}"/>
  48. <button string="Revoke Access" name="action_revoke_access" type="object" class="btn-secondary"
  49. attrs="{'invisible': ['|', ('is_portal', '=', False), ('is_internal', '=', True)]}"/>
  50. <button string="Re-Invite" name="action_invite_again" type="object" class="btn-secondary"
  51. attrs="{'invisible': ['|', '|', ('is_portal', '=', False), ('is_internal', '=', True), ('email_state', '!=', 'ok')]}"/>
  52. <button string="Internal User" attrs="{'invisible': [('is_internal', '=', False)]}"
  53. disabled="True" title="This partner is linked to an internal User and already has access to the Portal."/>
  54. </tree>
  55. </field>
  56. <footer>
  57. <button string="Close" class="btn-primary" special="save" data-hotkey="v" />
  58. </footer>
  59. </form>
  60. </field>
  61. </record>
  62. </odoo>