[IMP] website_sale: remove /shop/terms controller in favor of /terms

This commit is contained in:
Arnaud Joset
2020-10-06 10:26:56 +00:00
committed by Yannick Tivisse
parent 264f4b708a
commit 4d7ebb8cf5
4 changed files with 14 additions and 48 deletions
+11 -1
View File
@@ -1,11 +1,21 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, SUPERUSER_ID
from odoo import api, SUPERUSER_ID, _
from . import controllers
from . import models
from . import wizard
from . import report
def pre_init_hook(cr):
env = api.Environment(cr, SUPERUSER_ID, {})
terms_conditions = env['ir.config_parameter'].get_param('account.use_invoice_terms')
if not terms_conditions:
env['ir.config_parameter'].set_param('account.use_invoice_terms', True)
companies = env['res.company'].search([])
for company in companies:
company.terms_type = 'html'
company.invoice_terms = _('Terms & Conditions: %s/terms', company.get_base_url())
def uninstall_hook(cr, registry):
''' Need to reenable the `product` pricelist multi-company rule that were
+1
View File
@@ -33,5 +33,6 @@
'qweb': ['static/src/xml/*.xml'],
'installable': True,
'application': True,
'pre_init_hook': 'pre_init_hook',
'uninstall_hook': 'uninstall_hook',
}
-4
View File
@@ -1010,10 +1010,6 @@ class WebsiteSale(http.Controller):
PaymentProcessing.remove_payment_transaction(tx)
return request.redirect('/shop/confirmation')
@http.route(['/shop/terms'], type='http', auth="public", website=True, sitemap=True)
def terms(self, **kw):
return request.render("website_sale.terms")
@http.route(['/shop/confirmation'], type='http', auth="public", website=True, sitemap=False)
def payment_confirmation(self, **post):
""" End of checkout process controller. Confirmation is basically seing
+2 -43
View File
@@ -682,7 +682,7 @@
<template id="product_custom_text" inherit_id="website_sale.product" active="True" customize_show="True" name="Terms and Conditions">
<xpath expr="//div[@id='product_details']" position="inside">
<p class="text-muted">
<a href="/shop/terms">Terms and Conditions</a><br/>
<a href="/terms">Terms and Conditions</a><br/>
30-day money-back guarantee<br/>
Shipping: 2-3 Business Days
</p>
@@ -1623,7 +1623,7 @@
<div class="custom-control custom-checkbox float-right mt-2 oe_accept_cgv_button">
<input type="checkbox" id="checkbox_cgv" class="custom-control-input"/>
<label for="checkbox_cgv" class="custom-control-label">
I agree to the <a target="_BLANK" href="/shop/terms">terms &amp; conditions</a>
I agree to the <a target="_BLANK" href="/terms">terms &amp; conditions</a>
</label>
</div>
</xpath>
@@ -1821,47 +1821,6 @@
</xpath>
</template>
<template id="terms" name="Terms &amp; Conditions">
<t t-call="website.layout">
<div id="wrap">
<div class="oe_structure" id="oe_structure_website_sale_terms_1">
<section class="s_title" data-vcss="001">
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="text-center">Terms &amp;amp; Conditions</h1>
<div class="card s_well clearfix">
<div class="card-body">
<ul>
<li>The <b>Intellectual Property</b> disclosure will inform users that the contents, logo and other visual media you created is your property and is protected by copyright laws.</li>
<li>A <b>Termination</b> clause will inform that users’ accounts on your website and mobile app or users’ access to your website and mobile (if users can’t have an account with you) can be terminated in case of abuses or at your sole discretion.</li>
<li>A <b>Governing Law</b> will inform users which laws govern the agreement. This should the country in which your company is headquartered or the country from which you operate your web site and mobile app.</li>
<li>A <b>Links To Other Web Sites</b> clause will inform users that you are not responsible for any third party web sites that you link to. This kind of clause will generally inform users that they are responsible for reading and agreeing (or disagreeing) with the Terms and Conditions or Privacy Policies of these third parties.</li>
<li>If your website or mobile apps allows users to create content and make that content public to other users, a <b>Content</b> section will inform users that they own the rights to the content they have created.<br/>The “Content” clause usually mentions that users must give you (the website or mobile app developer) a license so that you can share this content on your website/mobile app and to make it available to other users.<br/>Because the content created by users is public to other users, a DMCA notice clause (or Copyright Infringement ) section is helpful to inform users and copyright authors that, if any content is found to be a copyright infringement, you will respond to any DMCA take down notices received and you will take down the content.</li>
<li>A <b>Limit What Users Can Do</b> clause can inform users that by agreeing to use your service, they’re also agreeing to not do certain things. This can be part of a very long and thorough list in your Terms and Conditions agreements so as to encompass the most amount of negative uses.</li>
</ul>
<small class="text-muted float-right">Source: https://termsfeed.com/blog/sample-terms-and-conditions-template</small>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="s_text_block" data-snippet="s_text_block">
<div class="container">
<div class="row">
<div class="col-lg-12 mb16 mt16">
<p style='white-space:pre' t-esc="website.company_id.invoice_terms"/>
</div>
</div>
</div>
</section>
</div>
<div class="oe_structure" id="oe_structure_website_sale_terms_2"/>
</div>
</t>
</template>
<template id="website_sale.shop_product_carousel" name="Shop Product Carousel">
<t t-set="product_images" t-value="product_variant._get_images() if product_variant else product._get_images()"/>
<div id="o-carousel-product" class="carousel slide" data-ride="carousel" data-interval="0">