-
-
Notifications
You must be signed in to change notification settings - Fork 545
[18.0][MIG] website_sale_charge_payment_fee: Migration to version 18.0 #1123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
eduezerouali-tecnativa
wants to merge
18
commits into
OCA:18.0
Choose a base branch
from
Tecnativa:18.0-mig-website_sale_charge_payment_fee
base: 18.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
952d33f
ADD website_sale_charge_payment_fee
eLBati 9352c2b
[FIX] website_sale_charge_payment_fee: Do not blow up when there is n…
SimoRubi 3acef25
fixup! [FIX] website_sale_charge_payment_fee: Do not blow up when the…
SimoRubi c5e9803
[FIX] website_sale_charge_payment_fee: Use a browse record if there a…
SimoRubi f9843b0
[12.0][MIG] website_sale_charge_payment_fee: Migration to 12.0
5289abc
[IMP] Adjust coding style
415bbc1
[IMP] Imrpove javascript
937d3d6
[IMP] Adjust Pay Now button javascript, remove tax
a96d2fd
[IMP] Fix save_token pattern, adjust fee display
02e204b
[IMP] Adjust update_fee_line, add comment
ac18b6a
[IMP] Add currency to fix price field, update pot
f2f8def
[IMP] Fix required error on charge_fee_currency_id
573e194
[FIX] website_sale_charge_payment_fee: Use hasclass in xpath expression
pedrobaeza 61d7b2a
[IMP] website_sale_charge_payment_fee: black, isort, prettier
miguel-S73 1388000
[MIG] website_sale_charge_payment_fee: Migration to 14.0
miguel-S73 f7b57e9
Translated using Weblate (Spanish)
Ivorra78 4ce9146
[IMP] website_sale_charge_payment_fee: pre-commit auto fixes
miguel-S73 3552f9e
[MIG] website_sale_charge_payment_fee: Migration to 18.0
miguel-S73 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| ============================= | ||
| eCommerce: charge payment fee | ||
| ============================= | ||
|
|
||
| .. | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! This file is generated by oca-gen-addon-readme !! | ||
| !! changes will be overwritten. !! | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! source digest: sha256:3a67cc1583ea293fcac70c6cdcae7551370e3a7669c85ef1dc2b2809983aff5d | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
|
||
| .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
| :target: https://odoo-community.org/page/development-status | ||
| :alt: Beta | ||
| .. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png | ||
| :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html | ||
| :alt: License: LGPL-3 | ||
| .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github | ||
| :target: https://github.com/OCA/e-commerce/tree/18.0/website_sale_charge_payment_fee | ||
| :alt: OCA/e-commerce | ||
| .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
| :target: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_sale_charge_payment_fee | ||
| :alt: Translate me on Weblate | ||
| .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
| :target: https://runboat.odoo-community.org/builds?repo=OCA/e-commerce&target_branch=18.0 | ||
| :alt: Try me on Runboat | ||
|
|
||
| |badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
|
||
| This module allows to associate generic payment fee to online payment | ||
| methods. Thus, when website user select a payment method with additional | ||
| fee, an additional sale order line will be added to online order | ||
|
|
||
| **Table of contents** | ||
|
|
||
| .. contents:: | ||
| :local: | ||
|
|
||
| Configuration | ||
| ============= | ||
|
|
||
| Click | ||
|
|
||
| Accounting -> Configuration -> Payments -> Payment Acquirers | ||
|
|
||
| open an acquirer and in CHARGE PAYMENT FEE tab, you can set the fee to | ||
| be charged to customer. | ||
|
|
||
| Known issues / Roadmap | ||
| ====================== | ||
|
|
||
| - As for now, this module does not handle express checkout. | ||
|
|
||
| Bug Tracker | ||
| =========== | ||
|
|
||
| Bugs are tracked on `GitHub Issues <https://github.com/OCA/e-commerce/issues>`_. | ||
| In case of trouble, please check there if your issue has already been reported. | ||
| If you spotted it first, help us to smash it by providing a detailed and welcomed | ||
| `feedback <https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_charge_payment_fee%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
|
||
| Do not contact contributors directly about support or help with technical issues. | ||
|
|
||
| Credits | ||
| ======= | ||
|
|
||
| Authors | ||
| ------- | ||
|
|
||
| * Agile Business Group | ||
| * AITIC S.A.S | ||
| * Quartile Limited | ||
| * Studio73 | ||
|
|
||
| Contributors | ||
| ------------ | ||
|
|
||
| - Lorenzo Battistini <lorenzo.battistini@agilebg.com> | ||
|
|
||
| - AITIC S.A. <info@aitic.com.ar> | ||
|
|
||
| - Quartile Limited <info@quartile.co> | ||
|
|
||
| - `Studio73 <https://www.studio73.es>`__: | ||
|
|
||
| - Miguel Gandia | ||
|
|
||
| Maintainers | ||
| ----------- | ||
|
|
||
| This module is maintained by the OCA. | ||
|
|
||
| .. image:: https://odoo-community.org/logo.png | ||
| :alt: Odoo Community Association | ||
| :target: https://odoo-community.org | ||
|
|
||
| OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
| mission is to support the collaborative development of Odoo features and | ||
| promote its widespread use. | ||
|
|
||
| .. |maintainer-miguel-S73| image:: https://github.com/miguel-S73.png?size=40px | ||
| :target: https://github.com/miguel-S73 | ||
| :alt: miguel-S73 | ||
|
|
||
| Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
|
||
| |maintainer-miguel-S73| | ||
|
|
||
| This module is part of the `OCA/e-commerce <https://github.com/OCA/e-commerce/tree/18.0/website_sale_charge_payment_fee>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| from . import models | ||
| from . import controllers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Copyright 2018 Lorenzo Battistini - Agile Business Group | ||
| # Copyright 2020 AITIC S.A.S | ||
| # Copyright 2020 Quartile Limited | ||
| # Copyright 2024 Miguel Gandia - Studio73 | ||
| # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). | ||
| { | ||
| "name": "eCommerce: charge payment fee", | ||
| "summary": "Payment fee charged to customer", | ||
| "version": "18.0.1.0.0", | ||
| "category": "Website", | ||
| "website": "https://github.com/OCA/e-commerce", | ||
| "maintainers": ["miguel-S73"], | ||
| "author": "Agile Business Group, " | ||
| "AITIC S.A.S, " | ||
| "Quartile Limited, " | ||
| "Studio73, " | ||
| "Odoo Community Association (OCA)", | ||
| "license": "LGPL-3", | ||
| "application": False, | ||
| "installable": True, | ||
| "depends": ["payment", "website_sale"], | ||
| "data": ["views/payment_provider_views.xml", "views/website_sale_templates.xml"], | ||
| "assets": { | ||
| "web.assets_frontend": [ | ||
| "website_sale_charge_payment_fee/static/src/js/website_sale_fee.esm.js", | ||
| ], | ||
| "web.assets_tests": [ | ||
| "website_sale_charge_payment_fee/static/tests/tours/website_sale_fee_tour.esm.js", | ||
| ], | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Copyright 2018 Lorenzo Battistini - Agile Business Group | ||
| # Copyright 2020 AITIC S.A.S | ||
| # Copyright 2020 Quartile Limited | ||
| # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). | ||
|
|
||
| from odoo import http | ||
| from odoo.http import request | ||
|
|
||
| from odoo.addons.website_sale.controllers.main import WebsiteSale | ||
|
|
||
|
|
||
| class WebsiteSaleFee(WebsiteSale): | ||
| @http.route( | ||
| "/shop/payment", type="http", auth="public", website=True, sitemap=False | ||
| ) | ||
| def shop_payment(self, **post): | ||
| order = request.website.sudo().sale_get_order() | ||
| render_values = self._get_shop_payment_values(order, **post) | ||
| provider_id = post.get("provider_id") | ||
| payment_option_id = post.get("payment_option_id") | ||
| payment_methods_sudo = render_values.get("payment_methods_sudo") | ||
| providers_sudo = render_values.get("providers_sudo") | ||
| selected_provider = False | ||
| if provider_id or providers_sudo: | ||
| if provider_id: | ||
| selected_provider = request.env["payment.provider"].browse( | ||
| int(provider_id) | ||
| ) | ||
| else: | ||
| _selected_provider = [ | ||
| provider_sudo | ||
| for provider_sudo in payment_methods_sudo.provider_ids | ||
| if provider_sudo in providers_sudo | ||
| ][:1] | ||
| if len(_selected_provider) > 0: | ||
| selected_provider = _selected_provider[0] | ||
| order.sudo().update_fee_line(selected_provider.sudo()) | ||
| res = super().shop_payment(**post) | ||
| if payment_option_id: | ||
| res.qcontext["selected_payment_method"] = int(payment_option_id) | ||
| if selected_provider: | ||
| res.qcontext["selected_provider"] = selected_provider | ||
| return res | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * website_sale_charge_payment_fee | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 18.0+e\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "POT-Creation-Date: 2025-04-17 16:07+0000\n" | ||
| "PO-Revision-Date: 2025-04-17 16:07+0000\n" | ||
| "Last-Translator: \n" | ||
| "Language-Team: \n" | ||
| "MIME-Version: 1.0\n" | ||
| "Content-Type: text/plain; charset=UTF-8\n" | ||
| "Content-Transfer-Encoding: \n" | ||
| "Plural-Forms: \n" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model_terms:ir.ui.view,arch_db:website_sale_charge_payment_fee.method_form_fee | ||
| msgid "(Fee:" | ||
| msgstr "(Tasa:" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model:ir.model.fields,help:website_sale_charge_payment_fee.field_payment_provider__charge_fee | ||
| msgid "" | ||
| "An extra fee line will be added to online order when using this payment " | ||
| "method" | ||
| msgstr "" | ||
| "Se añadirá una línea de tarifa adicional al pedido en línea cuando se " | ||
| "utilice este método de pago" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model_terms:ir.ui.view,arch_db:website_sale_charge_payment_fee.provider_form_fee_inherit | ||
| msgid "Charge payment fee" | ||
| msgstr "Cargo por pago" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_provider__charge_fee_type | ||
| msgid "Computation type" | ||
| msgstr "Tipo de computación" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_provider__charge_fee_currency_id | ||
| msgid "Fee Currency" | ||
| msgstr "Divisa de la Tasa" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_provider__charge_fee_description | ||
| msgid "Fee Description" | ||
| msgstr "Descripción de Tasa" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_provider__charge_fee_product_id | ||
| msgid "Fee Product" | ||
| msgstr "Producto de tarifa" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_provider__charge_fee | ||
| msgid "Fee charged to customer" | ||
| msgstr "Tarifa cobrada al cliente" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model:ir.model.fields.selection,name:website_sale_charge_payment_fee.selection__payment_provider__charge_fee_type__fixed | ||
| msgid "Fixed" | ||
| msgstr "Fijo" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_provider__charge_fee_fixed_price | ||
| msgid "Fixed Price" | ||
| msgstr "Precio Fijo" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model_terms:ir.ui.view,arch_db:website_sale_charge_payment_fee.payment_fee | ||
| msgid "Payment Fee" | ||
| msgstr "Cuota de pago:" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_sale_order__amount_payment_fee | ||
| msgid "Payment Fee Amount" | ||
| msgstr "Importe de la tarifa de pago" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model:ir.model,name:website_sale_charge_payment_fee.model_payment_provider | ||
| msgid "Payment Provider" | ||
| msgstr "Proveedor de pago" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_sale_order_line__payment_fee_line | ||
| msgid "Payment fee line" | ||
| msgstr "Línea de cuota pago" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model:ir.model.fields,field_description:website_sale_charge_payment_fee.field_payment_provider__charge_fee_percentage | ||
| #: model:ir.model.fields.selection,name:website_sale_charge_payment_fee.selection__payment_provider__charge_fee_type__percentage | ||
| msgid "Percentage" | ||
| msgstr "Porcentaje" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model:ir.model.fields,help:website_sale_charge_payment_fee.field_payment_provider__charge_fee_percentage | ||
| msgid "Percentage applied to order total" | ||
| msgstr "Porcentaje aplicado al total del pedido" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model:ir.model,name:website_sale_charge_payment_fee.model_sale_order | ||
| msgid "Sales Order" | ||
| msgstr "Pedido de venta" | ||
|
|
||
| #. module: website_sale_charge_payment_fee | ||
| #: model:ir.model,name:website_sale_charge_payment_fee.model_sale_order_line | ||
| msgid "Sales Order Line" | ||
| msgstr "Línea de pedido de venta" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class
PaymentPortal, doesn’t have theshop_paymentfunction in thepaymentmodule. This method is added in thewebsite_salemodule. Why did you change the class to inherit from it instead of inheriting from theWebsiteSaleclass?