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 13, 2023
1 parent 79b4106 commit 42c8acf
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 1 deletion.
1 change: 1 addition & 0 deletions website_sale_ux/README.rst
Expand Up @@ -19,6 +19,7 @@ Website Sale UX
* If the product has not variants, when user clicks Add to cart button then the product is added to the Cart (default behaviour).
* If the product has variants, when users click the Add to cart button then they are redirected to the Product page (new feature) so they could choice among all variants, instead of opening the pop-up to choice among all variants (default behaviour). This new feature is required because "variant pop-up" shows a malfunction when user tries to add to cart a bigger quantity of a variant product than stock available.
#. By default the frontend eCommerce search bar searches among all products when user is on Catalog page and browsing All products category, but if user is browsing an specific product category then the search bar searchs among this category`s products only. This module improves the searching of frontend eCommerce search bar by allowing the users all the time to search among all products no matter which product category is browsing at that moment. This function works when user press enter but not with dropdown pre-search results.
#. By default, on Settings > Website the option Customer account (which set Free sign up option or By invitation on website) is not able. This module adds this setting option per website.

Installation
============
Expand Down
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 42c8acf

Please sign in to comment.