[ADD]16.0-bank_and_contract_portal:add rules for internal user using portal

This commit is contained in:
2024-09-26 14:33:55 +02:00
parent 37142bfa98
commit 8b2c182103
11 changed files with 90 additions and 185 deletions

View File

@@ -18,7 +18,7 @@
</div>
<div class="row">
<div id="iban"
t-attf-class="form-group #{error.get('acc_number') and 'o_has_error' or ''} col-xl-12">
t-attf-class="form-group #{error.get('acc_number') and 'o_has_error' or ''}">
<label class="col-form-label" for="acc_number">IBAN : </label>
<label class="text-danger"> *</label>
<input t-if="can_edit_bank_account" type="text" name="acc_number"
@@ -28,7 +28,7 @@
<span t-if="not can_edit_bank_account" t-field="bank_account.acc_number" />
</div>
<div id="partner_id"
t-attf-class="form-group #{error.get('partner_id') and 'o_has_error' or ''} col-xl-12">
t-attf-class="form-group #{error.get('partner_id') and 'o_has_error' or ''}">
<label class="col-form-label" for="partner_id">Contact name: </label>
<input t-if="can_edit_bank_account" type="text" name="partner_id"
required="False"
@@ -38,7 +38,7 @@
<span t-if="not can_edit_bank_account" t-field="bank_account.partner_id.name" />
</div>
<div id="iban_holder_name_if_different"
t-attf-class="form-group #{error.get('acc_holder_name') and 'o_has_error' or ''} col-xl-12">
t-attf-class="form-group #{error.get('acc_holder_name') and 'o_has_error' or ''">
<label class="col-form-label" for="bank_id">Name of IBAN holder if different : </label>
<input t-if="can_edit_bank_account" type="text" name="acc_holder_name"
t-attf-class="form-control #{error.get('acc_holder_name') and 'is-invalid' or ''}"
@@ -46,7 +46,7 @@
<span t-if="not can_edit_bank_account" t-field="bank_account.acc_holder_name" />
</div>
<div id="bank_id"
t-attf-class="form-group #{error.get('bank_id') and 'o_has_error' or ''} col-xl-12">
t-attf-class="form-group #{error.get('bank_id') and 'o_has_error' or ''}">
<label class="col-form-label" for="bank_id">Banque name : </label>
<select t-if="can_edit_bank_account" type="text" name="bank_id"
t-attf-class="form-control #{error.get('bank_id') and 'is-invalid' or ''}">

View File

@@ -15,14 +15,14 @@
<tr class="active">
<th>IBAN</th>
<th>Contact name</th>
<th>Name of IBAN holder if different</th>
<th style="max-width: 15rem;">Name of IBAN holder if different</th>
<th>Number of associated mandates</th>
</tr>
</thead>
<tbody>
<t t-foreach="bank_accounts" t-as="bank_account">
<tr>
<td>
<td style="min-width: 294px;">
<a
t-attf-href="/my/bank_account/#{bank_account.id}?{{ keep_query() }}">
<span t-field="bank_account.acc_number" />

View File

@@ -1,60 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="portal_my_mandate" name="Mandate details">
<t t-call="portal.portal_layout">
<t t-set="additional_title">My mandate details</t>
<form action="/my/mandate/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">
<br />
<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>
<div class="row">
<div id="reference"
t-attf-class="form-group #{error.get('unique_mandate_reference') and 'o_has_error' or ''} col-xl-12">
<label class="col-form-label" for="unique_mandate_reference">Reference : </label>
<label class="text-danger"> *</label>
<input t-if="can_edit_mandate" type="text" name="unique_mandate_reference"
required="True"
t-attf-class="form-control #{error.get('unique_mandate_reference') and 'is-invalid' or ''}"
t-att-value="unique_mandate_reference or mandate.unique_mandate_reference" />
<span t-if="not can_edit_mandate" t-field="mandate.unique_mandate_reference" />
</div>
<div id="format"
t-attf-class="form-group #{error.get('format') and 'o_has_error' or ''} col-xl-12">
<label class="col-form-label" for="format">Format : </label>
<label class="text-danger"> *</label>
<input t-if="can_edit_mandate" type="text" name="format"
required="True"
t-attf-class="form-control #{error.get('format') and 'is-invalid' or ''}"
t-att-value="format or mandate.format" />
<span t-if="not can_edit_mandate" t-field="mandate.format" />
</div>
</div>
<br />
<input type="hidden" name="mandate_id" t-att-value="mandate_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/mandates">
<span class="fa fa-arrow-left" /> Back to my mandates list </a>
</div>
</t>
</template>
</odoo>

View File

@@ -14,7 +14,6 @@
<thead>
<tr class="active">
<th>Reference</th>
<th>Format</th>
<th>Contact name</th>
<th>Signature date</th>
<th>Last debit date</th>
@@ -28,17 +27,14 @@
<td>
<span t-field="mandate.unique_mandate_reference" />
</td>
<td>
<span t-field="mandate.format" />
</td>
<td>
<span t-field="mandate.partner_id" />
</td>
<td>
<span t-field="mandate.last_debit_date" />
<span t-field="mandate.signature_date" />
</td>
<td>
<span t-field="mandate.signature_date" />
<span t-field="mandate.last_debit_date" />
</td>
<td>
<span t-field="mandate.state" />