Skip to content

Commit b22f76c

Browse files
dhrs-odoovava-odoo
authored andcommitted
[FIX] bike_leasing: fix the issue of pricelist and modified payment methods and button
In this commit we have added selectable true in the pricelist and also modified wire transfer payment method to recurring invoice also we have modified the pay now button to get a quote as well modified add to cart button to request a quote Task-4204593
1 parent 22c01ba commit b22f76c

File tree

9 files changed

+58
-6
lines changed

9 files changed

+58
-6
lines changed

bike_leasing/__manifest__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
'website_helpdesk',
2020
'website_payment',
2121
'website_sale',
22+
'payment_custom',
2223
'theme_vehicle',
2324
],
2425
'data': [
@@ -38,12 +39,15 @@
3839
'data/product_product.xml',
3940
'data/product_pricelist.xml',
4041
'data/product_pricelist_item.xml',
42+
'data/delivery_carrier.xml',
4143
'data/knowledge_cover.xml',
4244
'data/knowledge_article.xml',
4345
'data/knowledge_article_favorite.xml',
4446
'data/mail_message.xml',
45-
'data/ir_model_data.xml',
4647
'data/ir_attachment_post.xml',
48+
'data/website_view.xml',
49+
'data/payment_provider.xml',
50+
'data/ir_model_data.xml',
4751
],
4852
'demo': [
4953
'demo/website.xml',
@@ -62,7 +66,6 @@
6266
'demo/purchase_order_line.xml',
6367
'demo/purchase_order_confirm.xml',
6468
'demo/helpdesk_ticket.xml',
65-
'demo/payment_provider_demo_post.xml',
6669
],
6770
'license': 'OPL-1',
6871
'author': 'Odoo S.A.',
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<odoo noupdate="1">
3+
<record id="delivery.free_delivery_carrier" model="delivery.carrier">
4+
<field name="name">After quote validation</field>
5+
</record>
6+
</odoo>

bike_leasing/data/ir_model_data.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,16 @@
66
<field name="module">__cloc_exclude__</field>
77
<field name="res_id" eval="ref('welcome_article_body')"/>
88
</record>
9+
<record id="cloc_exclude_add_to_cart" model="ir.model.data">
10+
<field name="name">cloc_exclude_add_to_cart</field>
11+
<field name="model">ir.ui.view</field>
12+
<field name="module">__cloc_exclude__</field>
13+
<field name="res_id" ref="product"/>
14+
</record>
15+
<record id="cloc_exclude_pay_now" model="ir.model.data">
16+
<field name="name">cloc_exclude_pay_now</field>
17+
<field name="model">ir.ui.view</field>
18+
<field name="module">__cloc_exclude__</field>
19+
<field name="res_id" ref="pay_now_rename"/>
20+
</record>
921
</odoo>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<odoo noupdate="1">
3+
<record id="payment.payment_provider_transfer" model="payment.provider">
4+
<field name="name">Recurring Invoice</field>
5+
<field name="state">enabled</field>
6+
<field name="is_published">True</field>
7+
</record>
8+
<record id="payment_custom.payment_method_wire_transfer" model="payment.method">
9+
<field name="name">Recurring Invoice</field>
10+
</record>
11+
</odoo>

bike_leasing/data/product_pricelist.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@
33
<record id="product_pricelist_2" model="product.pricelist">
44
<field name="name">Monthly</field>
55
<field name="sequence">1</field>
6+
<field name="selectable" eval="True"/>
67
<field name="website_id" ref="website.default_website"/>
78
<field name="x_auto_post_pricelist">monthly</field>
89
</record>
910
<record id="product_pricelist_3" model="product.pricelist">
1011
<field name="name">Quarterly</field>
12+
<field name="selectable" eval="True"/>
1113
<field name="website_id" ref="website.default_website"/>
1214
<field name="x_auto_post_pricelist">quarterly</field>
1315
</record>
1416
<record id="product_pricelist_4" model="product.pricelist">
1517
<field name="name">Yearly</field>
18+
<field name="selectable" eval="True"/>
1619
<field name="website_id" ref="website.default_website"/>
1720
<field name="x_auto_post_pricelist">yearly</field>
1821
</record>

bike_leasing/data/product_template.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<field name="image_1920" type="base64" file="bike_leasing/static/src/binary/product_template/10-image_1920"/>
66
<field name="service_type">manual</field>
77
<field name="categ_id" ref="product.product_category_all"/>
8+
<field name="list_price">50</field>
89
<field name="type">service</field>
910
<field name="purchase_method">purchase</field>
1011
<field name="description_sale">24/7 assistance: [email protected]</field>

bike_leasing/data/website_view.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<odoo>
3+
<template inherit_id='website_sale.product' id="product" name="rename of add to cart">
4+
<xpath expr="//a[@id='add_to_cart']" position="replace">
5+
<a data-animation-selector=".o_wsale_product_images" role="button" id="add_to_cart"
6+
t-attf-class="btn btn-primary js_check_product a-submit flex-grow-1" href="#"
7+
class="btn btn-primary js_check_product a-submit flex-grow-1">
8+
<i class="fa fa-shopping-cart me-2"/> Get a quote
9+
</a>
10+
</xpath>
11+
</template>
12+
<template id="pay_now_rename" inherit_id="payment.submit_button">
13+
<xpath expr="//button[@name='o_payment_submit_button']" position="attributes">
14+
<attribute name="t-out">"Get a Quote"</attribute>
15+
</xpath>
16+
</template>
17+
</odoo>

bike_leasing/demo/payment_provider_demo_post.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/test_generic/tests/test_industry_requirements.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ def test_payment_demo(self):
1717
index_database = sys_args.index('-d')
1818
if not sys_args[index_database + 1].endswith('imported_with_demo'):
1919
return
20+
if 'bike_leasing' in self.installed_modules:
21+
# we don't pay the cart in this industry, we get a quote
22+
return
2023
if self.env['ir.module.module']._get('website_sale').state == 'installed':
2124
self.assertTrue(
2225
self.env['ir.module.module']._get('payment_demo').state == 'installed',

0 commit comments

Comments
 (0)