Skip to content

Commit

Permalink
[IMP]website_sale_ux: re-adds website_login_documents on view
Browse files Browse the repository at this point in the history
  • Loading branch information
jok-adhoc committed Feb 1, 2023
1 parent cfd292d commit c8e06ee
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 1 deletion.
1 change: 1 addition & 0 deletions website_sale_ux/__init__.py
Expand Up @@ -3,3 +3,4 @@
# directory
##############################################################################
from . import controllers
from . import models
3 changes: 2 additions & 1 deletion website_sale_ux/__manifest__.py
Expand Up @@ -20,7 +20,7 @@
{
'name': 'Website Sale UX',
'category': 'base.module_category_knowledge_management',
'version': "16.0.1.0.0",
'version': "16.0.1.1.0",
'author': 'ADHOC SA',
'website': 'www.adhoc.com.ar',
'license': 'AGPL-3',
Expand All @@ -32,6 +32,7 @@
'demo': [],
'data': [
'views/product_template_views.xml',
'views/res_config_settings_views.xml',
],
'installable': True,
}
5 changes: 5 additions & 0 deletions website_sale_ux/models/__init__.py
@@ -0,0 +1,5 @@
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from . import res_config_settings
19 changes: 19 additions & 0 deletions website_sale_ux/models/res_config_settings.py
@@ -0,0 +1,19 @@
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo import models, api


class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'

@api.model
def _inverse_account_on_checkout(self):
for record in self:
if not record.website_id:
continue
record.website_id.account_on_checkout = record.account_on_checkout
# account_on_checkout implies different values for `auth_signup_uninvited
if record.account_on_checkout == 'disabled':
record.website_id.auth_signup_uninvited = 'b2b'
30 changes: 30 additions & 0 deletions website_sale_ux/views/res_config_settings_views.xml
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="res_config_settings_view_form">
<field name="name">res.config.settings.view.form.inherit.website.sale</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="website_sale.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='website_login_documents']/div[hasclass('o_setting_right_pane')]" position="before">
<div class="col-12 col-lg-6 o_setting_box" id="website_login_documents" title=" To send invitations in B2B mode, open a contact or select several ones in list view and click on 'Portal Access Management' option in the dropdown menu *Action*.">
<div class="o_setting_left_pane">
</div>
<div class="o_setting_right_pane">
<label for="auth_signup_uninvited"/>
<div class="text-muted">
Let your customers log in to see their documents
</div>
<div class="mt8">
<field name="auth_signup_uninvited" class="o_light_label" widget="radio" options="{'horizontal': true}" required="True"/>
</div>
<div class="content-group" attrs="{'invisible': [('auth_signup_uninvited','=','b2b')]}">
<div class="mt8">
<button type="object" name="action_open_template_user" string="Default Access Rights" icon="fa-arrow-right" class="btn-link"/>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>

0 comments on commit c8e06ee

Please sign in to comment.