[MIG] partner_profiles_portal : Migration to 16.0
This commit is contained in:
committed by
Stéphan Sainléger
parent
df455303fa
commit
43cddf0b79
39
partner_profiles_portal/views/portal_home_template.xml
Normal file
39
partner_profiles_portal/views/portal_home_template.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="portal_my_home_profile_menu" name="Portal My Home: Profile Menu"
|
||||
inherit_id="portal.portal_layout" priority="40">
|
||||
<xpath expr="//div[hasclass('o_portal_my_details')]" position="replace">
|
||||
<div class="o_portal_my_details">
|
||||
<h4>Your Details </h4>
|
||||
<hr class="mt-1 mb-0" />
|
||||
<div class="mb8" t-field="user_id.partner_id"
|
||||
t-options="{"widget": "contact", "fields": ["email", "phone", "address", "name"]}" />
|
||||
<div name="profiles_management">
|
||||
<div id="account">
|
||||
<a t-attf-href="/my/account">
|
||||
<button class="btn btn-primary mb8">
|
||||
My information
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
<div
|
||||
id="structures" t-if="not user_id.partner_id.is_company">
|
||||
<a t-attf-href="/my/structures">
|
||||
<button class="btn btn-primary mb8">
|
||||
My structures
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
<div
|
||||
id="positions" t-if="user_id.partner_id.is_company">
|
||||
<a t-attf-href="/my/positions">
|
||||
<button class="btn btn-primary mb8">
|
||||
My positions
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
243
partner_profiles_portal/views/portal_my_account.xml
Normal file
243
partner_profiles_portal/views/portal_my_account.xml
Normal file
@@ -0,0 +1,243 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="portal_my_details_profiles" inherit_id="portal.portal_my_details"
|
||||
name="User profiles details">
|
||||
<xpath expr="//form" position="replace">
|
||||
<div class="oe_structure" id="oe_structure_portal_my_details_1" />
|
||||
<form action="/my/account" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()" />
|
||||
<div class="row o_portal_details">
|
||||
<div class="col-lg-12">
|
||||
<div id="messages" class="col-lg-12">
|
||||
<div t-if="success" class="alert alert-success">
|
||||
<i class="fa fa-fw fa-check-circle" /> Data saved! </div>
|
||||
<div t-if="error_message" class="alert alert-danger" role="alert">
|
||||
<t t-foreach="error_message" t-as="err">
|
||||
<t t-out="err" />
|
||||
<br />
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="name">
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_name') and 'o_has_error' or ''} col-xl-12">
|
||||
<label t-if="partner.is_company" class="col-form-label"
|
||||
for="main_name">Structure's name</label>
|
||||
<label t-if="not partner.is_company" class="col-form-label"
|
||||
for="main_name">Firstname and Lastname</label>
|
||||
<label class="text-danger"> *</label>
|
||||
<input type="text" name="main_name" required="True"
|
||||
t-attf-class="form-control #{error.get('main_name') and 'is-invalid' or ''}"
|
||||
t-att-value="main_name or partner.name" />
|
||||
</div>
|
||||
</div>
|
||||
<div id="logo">
|
||||
<label class="col-form-label">Image</label>
|
||||
<div class="row">
|
||||
<div t-attf-class="col-xl-2">
|
||||
<i>Current logo/picture:</i>
|
||||
<div name="image" t-field="partner.image_512"
|
||||
t-options="{"widget": "image", "preview_image": "image_512", "class": "d-block mx-auto mb16"}" />
|
||||
</div>
|
||||
<div class="form-group form-field form-field-binary"
|
||||
data-model-field="false" data-optional="true"
|
||||
t-attf-class="col-xl-2">
|
||||
<i>New logo/picture:</i>
|
||||
<i>
|
||||
<input type="file" name="main_logo" multiple="false"
|
||||
data-show-upload="true" data-show-caption="true"
|
||||
accept="image/*" />
|
||||
</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="contact">
|
||||
<br />
|
||||
<h3>
|
||||
Contact information
|
||||
</h3>
|
||||
<div class="row" id="email">
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_email') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="main_email">Email</label>
|
||||
<label class="text-danger"> *</label>
|
||||
<small>- Modification causes log out. Sign in just after!</small>
|
||||
<input type="email" name="main_email" required="True"
|
||||
t-attf-class="form-control #{error.get('main_email') and 'is-invalid' or ''}"
|
||||
t-att-value="main_email or partner.email" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="adress">
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_street') and 'o_has_error' or ''} col-xl-12">
|
||||
<label class="col-form-label" for="main_street">Street</label>
|
||||
<input type="text" name="main_street"
|
||||
t-attf-class="form-control #{error.get('main_street') and 'is-invalid' or ''}"
|
||||
t-att-value="main_street or partner.street" />
|
||||
<input type="text" name="main_street2"
|
||||
t-attf-class="form-control #{error.get('main_street2') and 'is-invalid' or ''}"
|
||||
t-att-value="main_street2 or partner.street2" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_zip') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="main_zip">Zip / Postal Code</label>
|
||||
<input type="text" name="main_zip"
|
||||
t-attf-class="form-control #{error.get('zip') and 'is-invalid' or ''}"
|
||||
t-att-value="main_zip or partner.zip" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_city') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="main_city">City</label>
|
||||
<input type="text" name="main_city"
|
||||
t-attf-class="form-control #{error.get('main_city') and 'is-invalid' or ''}"
|
||||
t-att-value="main_city or partner.city" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_country_id') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="main_country_id">Country</label>
|
||||
<label class="text-danger"> *</label>
|
||||
<select name="main_country_id" required="True"
|
||||
t-attf-class="form-control #{error.get('main_country_id') and 'is-invalid' or ''}">
|
||||
<option value="">Country...</option>
|
||||
<t t-foreach="countries or []" t-as="country">
|
||||
<option t-att-value="country.id"
|
||||
t-att-selected="country.id == int(main_country_id) if main_country_id else country.id == partner.country_id.id">
|
||||
<t t-out="country.name" />
|
||||
</option>
|
||||
</t>
|
||||
</select>
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_state_id') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="main_state_id">State /
|
||||
Province</label>
|
||||
<select name="main_state_id"
|
||||
t-attf-class="form-control #{error.get('state_id') and 'is-invalid' or ''}">
|
||||
<option value="">select...</option>
|
||||
<t t-foreach="states or []" t-as="state">
|
||||
<option t-att-value="state.id" style="display:none;"
|
||||
t-att-data-country_id="state.country_id.id"
|
||||
t-att-selected="state.id == partner.state_id.id">
|
||||
<t t-out="state.name" />
|
||||
</option>
|
||||
</t>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="other_contact_data">
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_phone') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="main_phone">Phone</label>
|
||||
<input type="tel" name="main_phone"
|
||||
t-attf-class="form-control #{error.get('main_phone') and 'is-invalid' or ''}"
|
||||
t-att-value="main_phone or partner.phone" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_mobile') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="main_mobile">Mobile</label>
|
||||
<input type="tel" name="main_mobile"
|
||||
t-attf-class="form-control #{error.get('main_mobile') and 'is-invalid' or ''}"
|
||||
t-att-value="main_mobile or partner.mobile" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_website') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="main_website">Website</label>
|
||||
<input type="text" name="main_website"
|
||||
t-attf-class="form-control #{error.get('main_website') and 'is-invalid' or ''}"
|
||||
t-att-value="main_website or partner.website" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<div class="s_card card bg-white w-100" id="public">
|
||||
<h3 class="card-header">
|
||||
Public information
|
||||
</h3>
|
||||
<div class="card-body">
|
||||
<p> The following information are public information that might be
|
||||
used in tierce applications (annuary for instance).<br /> You
|
||||
can customize them (and be anonymous for instance) to publicly
|
||||
show whatever you need or want. </p>
|
||||
<div class="row">
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_name') and 'o_has_error' or ''} col-xl-12">
|
||||
<label class="col-form-label" for="public_name">Name /
|
||||
Nickname</label>
|
||||
<label class="text-danger"> *</label>
|
||||
<input type="text" name="public_name" required="True"
|
||||
t-attf-class="form-control #{error.get('public_name') and 'is-invalid' or ''}"
|
||||
t-att-value="public_name or public_partner.name" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_street') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="public_street">Street</label>
|
||||
<input type="text" name="public_street"
|
||||
t-attf-class="form-control #{error.get('public_street') and 'is-invalid' or ''}"
|
||||
t-att-value="public_street or public_partner.street" />
|
||||
<input type="text" name="public_street2"
|
||||
t-attf-class="form-control #{error.get('public_street2') and 'is-invalid' or ''}"
|
||||
t-att-value="public_street2 or public_partner.street2" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_zip') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="public_zip">Zip / Postal
|
||||
Code</label>
|
||||
<input type="text" name="public_zip"
|
||||
t-attf-class="form-control #{error.get('public_zip') and 'is-invalid' or ''}"
|
||||
t-att-value="public_zip or public_partner.zip" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_city') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="public_city">City</label>
|
||||
<input type="text" name="public_city"
|
||||
t-attf-class="form-control #{error.get('public_city') and 'is-invalid' or ''}"
|
||||
t-att-value="public_city or public_partner.city" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_phone') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="public_phone">Phone</label>
|
||||
<input type="tel" name="public_phone"
|
||||
t-attf-class="form-control #{error.get('public_phone') and 'is-invalid' or ''}"
|
||||
t-att-value="public_phone or public_partner.phone" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_mobile') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="public_mobile">Mobile</label>
|
||||
<input type="tel" name="public_mobile"
|
||||
t-attf-class="form-control #{error.get('public_mobile') and 'is-invalid' or ''}"
|
||||
t-att-value="public_mobile or public_partner.mobile" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_email') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="public_email">Email</label>
|
||||
<input type="email" name="public_email"
|
||||
t-attf-class="form-control #{error.get('public_email') and 'is-invalid' or ''}"
|
||||
t-att-value="public_email or public_partner.email" />
|
||||
</div>
|
||||
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_website') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="public_website">Website</label>
|
||||
<input type="text" name="public_website"
|
||||
t-attf-class="form-control #{error.get('public_website') and 'is-invalid' or ''}"
|
||||
t-att-value="public_website or public_partner.website" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="redirect" t-att-value="redirect" />
|
||||
<div style="text-align:right;">
|
||||
<button type="submit"
|
||||
class="btn btn-primary ">Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="oe_structure" id="oe_structure_portal_my_details_2" />
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="portal_my_positions" name="My Positions">
|
||||
<t t-call="portal.portal_layout">
|
||||
<t t-set="breadcrumbs_searchbar" t-value="True" />
|
||||
<t t-call="portal.portal_searchbar">
|
||||
<t t-set="title">My Positions</t>
|
||||
</t>
|
||||
<h3>
|
||||
My positions
|
||||
</h3>
|
||||
<div class="oe_position" id="oe_position_portal_my_positions_1" />
|
||||
<t t-if="not positions">
|
||||
<div class="alert alert-warning mt8" role="alert">
|
||||
You do not have any positions in your structure.
|
||||
</div>
|
||||
</t>
|
||||
<t t-if="positions" t-call="portal.portal_table">
|
||||
<thead>
|
||||
<tr class="active">
|
||||
<th>
|
||||
<span class='d-none d-md-inline'>Person name</span>
|
||||
</th>
|
||||
<th>
|
||||
<span class='d-none d-md-inline'>Function</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="positions" t-as="position">
|
||||
<td>
|
||||
<a t-attf-href="/my/position/#{position.id}?{{ keep_query() }}">
|
||||
<span t-field="position.name" />
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<span t-field="position.function" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
</odoo>
|
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="portal_my_structures" name="My Structures">
|
||||
<t t-call="portal.portal_layout">
|
||||
<t t-set="breadcrumbs_searchbar" t-value="True" />
|
||||
<t t-call="portal.portal_searchbar">
|
||||
<t t-set="title">My Structures</t>
|
||||
</t>
|
||||
<h3>
|
||||
My structures
|
||||
</h3>
|
||||
<div class="oe_structure" id="oe_structure_portal_my_structures_1" />
|
||||
<t t-if="not structures">
|
||||
<div class="alert alert-warning mt8" role="alert">
|
||||
You are not linked with any structure.
|
||||
</div>
|
||||
</t>
|
||||
<t t-if="structures" t-call="portal.portal_table">
|
||||
<thead>
|
||||
<tr class="active">
|
||||
<th>
|
||||
<span class='d-none d-md-inline'>Structure name</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="structures" t-as="structure">
|
||||
<td>
|
||||
<a t-attf-href="/my/structure/#{structure.id}?{{ keep_query() }}">
|
||||
<span t-field="structure.name" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
</odoo>
|
@@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="portal_position" name="Position Details">
|
||||
<t t-call="portal.portal_layout">
|
||||
<t t-set="o_portal_fullwidth_alert" groups="profile.group_profile_user">
|
||||
<t t-call="portal.portal_back_in_edit_mode">
|
||||
<t t-set="backend_url"
|
||||
t-value="'/web#return_label=Website&model=res.partner&id=%s&view_type=form' % (position.id)" />
|
||||
</t>
|
||||
</t>
|
||||
<t t-set="additional_title">My Position Details</t>
|
||||
<div style="text-align:right">
|
||||
<br />
|
||||
<a href="/my/positions">
|
||||
<span class="fa fa-arrow-left" /> Back to my positions list </a>
|
||||
</div>
|
||||
<form action="/my/position/save" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()" />
|
||||
<div class="row o_portal_details">
|
||||
<div class="col-lg-12">
|
||||
<h1 style="text-align: center;">
|
||||
<span t-field="position.name" /> details </h1>
|
||||
<div t-if="success" class="alert alert-success py-1 mb-2">
|
||||
<i class="fa fa-fw fa-check-circle" /> Data saved! </div>
|
||||
<div t-if="error_message" role="alert" class="col-lg-12 alert alert-danger">
|
||||
<t t-foreach="error_message" t-as="err">
|
||||
<t t-out="err" />
|
||||
<br />
|
||||
</t>
|
||||
</div>
|
||||
<!-- ##################### -->
|
||||
<!-- POSITION PROFILE DATA -->
|
||||
<!-- ##################### -->
|
||||
<div>
|
||||
<br />
|
||||
<h3>
|
||||
<span t-field="position.name" />'s position in the structure </h3>
|
||||
<div class="row" id="position_function">
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('function') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="function">Function: </label>
|
||||
<input type="text" name="function"
|
||||
t-attf-class="form-control #{error.get('function') and 'is-invalid' or ''}"
|
||||
t-att-value="function or position.function" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="position_contact">
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('email') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="email">Email Pro: </label>
|
||||
<input type="email" name="email"
|
||||
t-attf-class="form-control #{error.get('email') and 'is-invalid' or ''}"
|
||||
t-att-value="email or position.email" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('phone') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="phone">Phone Pro: </label>
|
||||
<input type="tel" name="phone"
|
||||
t-attf-class="form-control #{error.get('phone') and 'is-invalid' or ''}"
|
||||
t-att-value="phone or position.phone" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="position_access_rights">
|
||||
<br />
|
||||
<h3>
|
||||
Access rights </h3>
|
||||
<div id="edit_structure_profiles"
|
||||
t-attf-class="form-group #{error.get('edit_structure_profiles') and 'o_has_error' or ''} col-xl-6">
|
||||
<input type="checkbox" name="edit_structure_profiles"
|
||||
t-att-checked="edit_structure_profiles or position.edit_structure_profiles" />
|
||||
<label class="col-form-label" for="edit_structure_profiles">Manage
|
||||
the structure's profiles</label>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<input type="hidden" name="position_id" t-att-value="position_id" />
|
||||
<input type="hidden" name="redirect" t-att-value="redirect" />
|
||||
<div style="text-align:right;">
|
||||
<button type="submit"
|
||||
class="btn btn-primary ">Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div style="text-align:right">
|
||||
<br />
|
||||
<a href="/my/positions">
|
||||
<span class="fa fa-arrow-left" /> Back to my positions list </a>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
</odoo>
|
@@ -0,0 +1,318 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="portal_structure" name="Structure Details">
|
||||
<t t-call="portal.portal_layout">
|
||||
<t t-set="o_portal_fullwidth_alert" groups="profile.group_profile_user">
|
||||
<t t-call="portal.portal_back_in_edit_mode">
|
||||
<t t-set="backend_url"
|
||||
t-value="'/web#return_label=Website&model=res.partner&id=%s&view_type=form' % (structure.id)" />
|
||||
</t>
|
||||
</t>
|
||||
<t t-set="additional_title">My Structure Details</t>
|
||||
<div style="text-align:right">
|
||||
<br />
|
||||
<a href="/my/structures">
|
||||
<span class="fa fa-arrow-left" /> Back to my structures list </a>
|
||||
</div>
|
||||
<form action="/my/structure/save" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()" />
|
||||
<div class="row o_portal_details">
|
||||
<div class="col-lg-12">
|
||||
<h1 style="text-align: center;">
|
||||
<span t-field="structure.name" /> details </h1>
|
||||
<div t-if="success" class="alert alert-success py-1 mb-2">
|
||||
<i class="fa fa-fw fa-check-circle" /> Data saved! </div>
|
||||
<div t-if="error_message" role="alert" class="col-lg-12 alert alert-danger">
|
||||
<t t-foreach="error_message" t-as="err">
|
||||
<t t-out="err" />
|
||||
<br />
|
||||
</t>
|
||||
</div>
|
||||
<!-- ################# -->
|
||||
<!-- MAIN PROFILE DATA -->
|
||||
<!-- ################# -->
|
||||
<div class="row">
|
||||
<div id="name"
|
||||
t-attf-class="form-group #{error.get('main_name') and 'o_has_error' or ''} col-xl-12">
|
||||
<label class="col-form-label" for="main_name">Name: </label>
|
||||
<label class="text-danger"> *</label>
|
||||
<input t-if="can_edit_structure" type="text" name="main_name"
|
||||
required="True"
|
||||
t-attf-class="form-control #{error.get('main_name') and 'is-invalid' or ''}"
|
||||
t-att-value="main_name or structure.name" />
|
||||
<span t-if="not can_edit_structure" t-field="structure.name" />
|
||||
</div>
|
||||
<div t-attf-class="col-xl-12" id="logo">
|
||||
<label class="col-form-label">Logo: </label>
|
||||
<div class="row">
|
||||
<div t-attf-class="col-xl-2">
|
||||
<i>Current logo:</i>
|
||||
<div name="image" t-field="structure.image_512"
|
||||
t-options="{"widget": "image", "preview_image": "image_512", "class": "d-block mx-auto mb16"}" />
|
||||
</div>
|
||||
<div class="form-group form-field form-field-binary"
|
||||
data-model-field="false" data-optional="true"
|
||||
t-attf-class="col-xl-2" t-if="can_edit_structure">
|
||||
<i>New logo:</i>
|
||||
<i>
|
||||
<input type="file" name="logo" multiple="false"
|
||||
data-show-upload="true" data-show-caption="true"
|
||||
accept="image/*" />
|
||||
</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="contact">
|
||||
<br />
|
||||
<h3>
|
||||
Contact information
|
||||
</h3>
|
||||
<div class="row" id="adress">
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_street') and 'o_has_error' or ''} col-xl-12">
|
||||
<label class="col-form-label" for="main_street">Street: </label>
|
||||
<input t-if="can_edit_structure" type="text" name="main_street"
|
||||
placeholder="Street"
|
||||
t-attf-class="form-control #{error.get('main_street') and 'is-invalid' or ''}"
|
||||
t-att-value="main_street or structure.street" />
|
||||
<span t-if="not can_edit_structure" t-field="structure.street" />
|
||||
<input t-if="can_edit_structure" type="text" name="main_street2"
|
||||
placeholder="Street 2 "
|
||||
t-attf-class="form-control #{error.get('main_street2') and 'is-invalid' or ''}"
|
||||
t-att-value="main_street2 or structure.street2" />
|
||||
<span t-if="not can_edit_structure"> - </span>
|
||||
<span t-if="not can_edit_structure" t-field="structure.street2" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_zip') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="main_zip">Zip /
|
||||
Postal Code: </label>
|
||||
<input t-if="can_edit_structure" type="text" name="main_zip"
|
||||
t-attf-class="form-control #{error.get('main_zip') and 'is-invalid' or ''}"
|
||||
t-att-value="main_zip or structure.zip" />
|
||||
<span t-if="not can_edit_structure" t-field="structure.zip" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_city') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="main_city">City: </label>
|
||||
<input t-if="can_edit_structure" type="text" name="main_city"
|
||||
t-attf-class="form-control #{error.get('main_city') and 'is-invalid' or ''}"
|
||||
t-att-value="main_city or structure.city" />
|
||||
<span t-if="not can_edit_structure" t-field="structure.city" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_country_id') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="main_country_id">Country: </label>
|
||||
<select t-if="can_edit_structure" name="main_country_id"
|
||||
t-attf-class="form-control #{error.get('main_country_id') and 'is-invalid' or ''}">
|
||||
<option value="">Country...</option>
|
||||
<t t-foreach="countries or []" t-as="country">
|
||||
<option t-att-value="country.id"
|
||||
t-att-selected="country.id == int(main_country_id) if main_country_id else country.id == structure.country_id.id">
|
||||
<t t-out="country.name" />
|
||||
</option>
|
||||
</t>
|
||||
</select>
|
||||
<span t-if="not can_edit_structure"
|
||||
t-field="structure.country_id" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="other_contact_data">
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_phone') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="main_phone">Phone: </label>
|
||||
<input t-if="can_edit_structure" type="tel" name="main_phone"
|
||||
t-attf-class="form-control #{error.get('main_phone') and 'is-invalid' or ''}"
|
||||
t-att-value="main_phone or structure.phone" />
|
||||
<span t-if="not can_edit_structure" t-field="structure.phone" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_mobile') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="main_mobile">Mobile: </label>
|
||||
<input t-if="can_edit_structure" type="tel" name="main_mobile"
|
||||
t-attf-class="form-control #{error.get('main_mobile') and 'is-invalid' or ''}"
|
||||
t-att-value="main_mobile or structure.mobile" />
|
||||
<span t-if="not can_edit_structure" t-field="structure.mobile" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_email') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="main_email">Email: </label>
|
||||
<input t-if="can_edit_structure" type="email" name="main_email"
|
||||
required="True"
|
||||
t-attf-class="form-control #{error.get('main_email') and 'is-invalid' or ''}"
|
||||
t-att-value="main_email or structure.email" />
|
||||
<span t-if="not can_edit_structure" t-field="structure.email" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('main_website') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="main_website">Website: </label>
|
||||
<input t-if="can_edit_structure" type="text" name="main_website"
|
||||
placeholder="e.g. https://odoo.com"
|
||||
t-attf-class="form-control #{error.get('main_website') and 'is-invalid' or ''}"
|
||||
t-att-value="main_website or structure.website" />
|
||||
<span t-if="not can_edit_structure" t-field="structure.website" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ##################### -->
|
||||
<!-- POSITION PROFILE DATA -->
|
||||
<!-- ##################### -->
|
||||
<div id="position_data">
|
||||
<br />
|
||||
<h3>
|
||||
Your position in the structure
|
||||
</h3>
|
||||
<div class="row" id="position_function">
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('position_function') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="position_function">Function: </label>
|
||||
<input type="text" name="position_function"
|
||||
t-attf-class="form-control #{error.get('position_function') and 'is-invalid' or ''}"
|
||||
t-att-value="position_function or position_profile.function" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="position_contact">
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('position_email') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="position_email">Email Pro: </label>
|
||||
<input type="email" name="position_email"
|
||||
t-attf-class="form-control #{error.get('position_email') and 'is-invalid' or ''}"
|
||||
t-att-value="position_email or position_profile.email" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('position_phone') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="position_phone">Phone Pro: </label>
|
||||
<input type="tel" name="position_phone"
|
||||
t-attf-class="form-control #{error.get('position_phone') and 'is-invalid' or ''}"
|
||||
t-att-value="position_phone or position_profile.phone" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<!-- ################### -->
|
||||
<!-- PUBLIC PROFILE DATA -->
|
||||
<!-- ################### -->
|
||||
<div class="s_card card bg-white w-100" id="public">
|
||||
<h3 class="card-header">
|
||||
Public contact information
|
||||
</h3>
|
||||
<div class="card-body">
|
||||
<p> The following information are public information that might be
|
||||
used in tierce applications (annuary for instance).<br /> You
|
||||
can customize them (and be anonymous for instance) to publicly
|
||||
show whatever you need or want. </p>
|
||||
<div class="row">
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_name') and 'o_has_error' or ''} col-xl-12">
|
||||
<label class="col-form-label" for="public_name">Public name: </label>
|
||||
<label class="text-danger"> *</label>
|
||||
<input t-if="can_edit_structure" type="text"
|
||||
name="public_name" required="True"
|
||||
t-attf-class="form-control #{error.get('public_name') and 'is-invalid' or ''}"
|
||||
t-att-value="public_name or public_profile.name" />
|
||||
<span t-if="not can_edit_structure"
|
||||
t-field="public_profile.name" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_street') and 'o_has_error' or ''} col-xl-12">
|
||||
<label class="col-form-label" for="public_street">Street: </label>
|
||||
<input t-if="can_edit_structure" type="text"
|
||||
name="public_street" placeholder="Street"
|
||||
t-attf-class="form-control #{error.get('public_street') and 'is-invalid' or ''}"
|
||||
t-att-value="public_street or public_profile.street" />
|
||||
<span t-if="not can_edit_structure"
|
||||
t-field="public_profile.street" />
|
||||
<input t-if="can_edit_structure" type="text"
|
||||
name="public_street2"
|
||||
placeholder="Street 2"
|
||||
t-attf-class="form-control #{error.get('public_street2') and 'is-invalid' or ''}"
|
||||
t-att-value="public_street2 or public_profile.street2" />
|
||||
<span t-if="not can_edit_structure"> - </span>
|
||||
<span t-if="not can_edit_structure"
|
||||
t-field="public_profile.street2" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_zip') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="public_zip">Zip / Postal
|
||||
Code: </label>
|
||||
<input t-if="can_edit_structure" type="text"
|
||||
name="public_zip"
|
||||
t-attf-class="form-control #{error.get('public_zip') and 'is-invalid' or ''}"
|
||||
t-att-value="public_zip or public_profile.zip" />
|
||||
<span t-if="not can_edit_structure"
|
||||
t-field="public_profile.zip" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_city') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="public_city">City: </label>
|
||||
<input t-if="can_edit_structure" type="text"
|
||||
name="public_city"
|
||||
t-attf-class="form-control #{error.get('public_city') and 'is-invalid' or ''}"
|
||||
t-att-value="public_city or public_profile.city" />
|
||||
<span t-if="not can_edit_structure"
|
||||
t-field="public_profile.city" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_phone') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="public_phone">Phone: </label>
|
||||
<input t-if="can_edit_structure" type="tel"
|
||||
name="public_phone"
|
||||
t-attf-class="form-control #{error.get('public_phone') and 'is-invalid' or ''}"
|
||||
t-att-value="public_phone or public_profile.phone" />
|
||||
<span t-if="not can_edit_structure"
|
||||
t-field="public_profile.phone" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_mobile') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="public_mobile">Mobile: </label>
|
||||
<input t-if="can_edit_structure" type="tel"
|
||||
name="public_mobile"
|
||||
t-attf-class="form-control #{error.get('public_mobile') and 'is-invalid' or ''}"
|
||||
t-att-value="public_mobile or public_profile.mobile" />
|
||||
<span t-if="not can_edit_structure"
|
||||
t-field="public_profile.mobile" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_email') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="public_email">Email: </label>
|
||||
<input t-if="can_edit_structure" type="email"
|
||||
name="public_email"
|
||||
t-attf-class="form-control #{error.get('public_email') and 'is-invalid' or ''}"
|
||||
t-att-value="public_email or public_profile.email" />
|
||||
<span t-if="not can_edit_structure"
|
||||
t-field="public_profile.email" />
|
||||
</div>
|
||||
<div
|
||||
t-attf-class="form-group #{error.get('public_website') and 'o_has_error' or ''} col-xl-6">
|
||||
<label class="col-form-label" for="public_website">Website: </label>
|
||||
<input t-if="can_edit_structure" type="text"
|
||||
name="public_website"
|
||||
t-attf-class="form-control #{error.get('public_website') and 'is-invalid' or ''}"
|
||||
t-att-value="public_website or public_profile.website" />
|
||||
<span t-if="not can_edit_structure"
|
||||
t-field="public_profile.website" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="structure_id" t-att-value="structure_id" />
|
||||
<input type="hidden" name="redirect" t-att-value="redirect" />
|
||||
<div style="text-align:right;">
|
||||
<button type="submit"
|
||||
class="btn btn-primary ">Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div style="text-align:right">
|
||||
<br />
|
||||
<a href="/my/structures">
|
||||
<span class="fa fa-arrow-left" /> Back to my structures list </a>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
</odoo>
|
25
partner_profiles_portal/views/res_partner_view.xml
Normal file
25
partner_profiles_portal/views/res_partner_view.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="partner_profiles_form_view" model="ir.ui.view">
|
||||
<field name="name">Partner Profiles Form View</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form" />
|
||||
<field name="priority">99</field>
|
||||
<field name="arch" type="xml">
|
||||
<!-- Main display -->
|
||||
<xpath expr="//group[@name='profile_status']/field[@name='contact_id']"
|
||||
position="before">
|
||||
<field name="odoo_user_id" string="Associated User" readonly="1"
|
||||
attrs="{'invisible': [('is_main_profile','=',False)]}" />
|
||||
</xpath>
|
||||
<xpath expr="//group[@name='profile_status']" position="after">
|
||||
<group name="structure_access_rights"
|
||||
attrs="{'invisible': ['|', ('is_position_profile','=',False), ('parent_id','=',False)]}">
|
||||
<field name="edit_structure_profiles" />
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
Reference in New Issue
Block a user