From d106d5631e33784ad85bcc43cc71dda5529bd0db Mon Sep 17 00:00:00 2001 From: Juliana Date: Wed, 18 Aug 2021 18:42:29 +0200 Subject: [PATCH] INit module --- __manifest__.py | 1 + controllers/__pycache__/main.cpython-37.pyc | Bin 1587 -> 1791 bytes controllers/main.py | 6 +++ views/template.xml | 55 ++++++++++---------- 4 files changed, 35 insertions(+), 27 deletions(-) diff --git a/__manifest__.py b/__manifest__.py index 302260e..d75bcc4 100755 --- a/__manifest__.py +++ b/__manifest__.py @@ -14,5 +14,6 @@ ], "data": [ 'views/res_config_settings_views.xml', + 'views/template.xml', ], } diff --git a/controllers/__pycache__/main.cpython-37.pyc b/controllers/__pycache__/main.cpython-37.pyc index c72acb8d0ca9be81a38db14e3f94a604a21711f1..1c498fa880a4aabdf4f61a9e5cf8b3194a904496 100644 GIT binary patch delta 833 zcmZuvOK;Oa5cb-;w(}&aP)R9mB_0X}DR5}vQjh?tNCkyTiG-AkWwI-p)Xt{68v#{O zso=mh_y+(t?(jFbaNG-L&inwFaaGEpUd`uu?Kd;K`?dO~R=;1Xl^yuL-(E_(h<;+9o!5+$eLC{FyYB3>QGotYxI@$y_m2HX zzQUrAMWH6^Z1m5JWjsl=26&Z;vFX`rlF8}V#OW{_ny6%%o=${P49Z$MNR(07g(^AD zO~=-Cl8X4bFtJozC>!n$v1m0KNhuqME3mN5H=E zhBO5T-Lpio{G0oR(0t9icnJ^H(yb@mUT-5}DgaZ3=nFDowk6l9l<#>PD>V!tgKc0V z@pQryBjS;k<0w#b`A=_kaUR0QrHfvQ`j^4Gkhkgk$0r<>|2QIF%^~>}gcib80PF6& zP^S}KhwyUlvi89>%q9R)s1{MbfUtz%A}k|deT93}3c~4!gp-{E(KvhPHc5jvNilCH z3N4jf%7W6CP;KKARbKv)-T2_s{0D2V;VGYRA89zg4c9Ztr>VG$B{W_{l@!Zs)cyhm CeY1!F delta 624 zcmZuu&r94;5YGFReYrfH{tdq%jekgW{?ECU+?OQr!* zCncHFqenC&8T~~wc0(?C#zBMZD3*()+lh?fP@3~rXi_EY0&UozG_F-&g)r;Tx_zKi zq+*}w>NiZ~UJ$g}VUo0>b~^~n7;ptBVn)#)N5I}PSb~nEitt%7bxhiRl-P-YVtomO>e#c diff --git a/controllers/main.py b/controllers/main.py index be85507..c0682e0 100644 --- a/controllers/main.py +++ b/controllers/main.py @@ -2,6 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import http +from odoo.http import request from odoo.addons.website_sale.controllers.main import WebsiteSale from odoo.addons.website_coupon.controllers.main import WebsiteCoupon @@ -11,6 +12,11 @@ class WebsiteCoupon(WebsiteCoupon): @http.route(['/shop/cart'], type='http', auth="public", website=True, sitemap=False) def cart(self, access_token=None, revive='', **post): res = super(WebsiteCoupon, self).cart(access_token, revive, **post) + order = request.website.sale_get_order() + res.qcontext['no_pass_payment'] = False + if order.amount_total <= request.website.amount_limit: + res.qcontext['no_pass_payment'] = True + res.qcontext['amount_limit'] = request.website.amount_limit return res diff --git a/views/template.xml b/views/template.xml index 5d957f0..4e8bd57 100755 --- a/views/template.xml +++ b/views/template.xml @@ -1,33 +1,34 @@ -