Skip to content

Commit cc77939

Browse files
committed
Merge PR #3739 into 18.0
Signed-off-by rvalyi
2 parents 9af6ff1 + b8048ae commit cc77939

18 files changed

Lines changed: 874 additions & 0 deletions
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
==========================
2+
Sale Transaction Form Link
3+
==========================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:b0ced99fe2989b0340090847a4d6731e95b95d11d83038901b4f62af787d0046
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github
20+
:target: https://github.com/OCA/sale-workflow/tree/18.0/sale_transaction_form_link
21+
:alt: OCA/sale-workflow
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_transaction_form_link
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
- This module adds a button on Sale Order Form in order to see all the
32+
payment transactions related to that Sale Order.
33+
34+
|image|
35+
36+
.. |image| image:: https://user-images.githubusercontent.com/19529533/129061695-62739c7a-2d35-4764-b922-d5ea6dc0102d.png
37+
38+
**Table of contents**
39+
40+
.. contents::
41+
:local:
42+
43+
Usage
44+
=====
45+
46+
- Go to Sales > Orders > Orders and pick one.
47+
- On Sale Order form, you have a button to go to the payment transaction
48+
if some exist.
49+
50+
Bug Tracker
51+
===========
52+
53+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_.
54+
In case of trouble, please check there if your issue has already been reported.
55+
If you spotted it first, help us to smash it by providing a detailed and welcomed
56+
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_transaction_form_link%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
57+
58+
Do not contact contributors directly about support or help with technical issues.
59+
60+
Credits
61+
=======
62+
63+
Authors
64+
-------
65+
66+
* ACSONE SA/NV
67+
68+
Contributors
69+
------------
70+
71+
- Denis Roussel <denis.roussel@acsone.eu>
72+
73+
- `Binhex <https://binhex.cloud>`__:
74+
75+
- Zuzanna Elzbieta Szalaty Szalaty <zuzanna@binhex.cloud>
76+
77+
Maintainers
78+
-----------
79+
80+
This module is maintained by the OCA.
81+
82+
.. image:: https://odoo-community.org/logo.png
83+
:alt: Odoo Community Association
84+
:target: https://odoo-community.org
85+
86+
OCA, or the Odoo Community Association, is a nonprofit organization whose
87+
mission is to support the collaborative development of Odoo features and
88+
promote its widespread use.
89+
90+
.. |maintainer-rousseldenis| image:: https://github.com/rousseldenis.png?size=40px
91+
:target: https://github.com/rousseldenis
92+
:alt: rousseldenis
93+
94+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
95+
96+
|maintainer-rousseldenis|
97+
98+
This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/18.0/sale_transaction_form_link>`_ project on GitHub.
99+
100+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2020 ACSONE SA/NV
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
3+
4+
{
5+
"name": "Sale Transaction Form Link",
6+
"summary": """
7+
Allows to display a link to payment transactions on Sale Order form view.""",
8+
"version": "18.0.1.0.0",
9+
"license": "AGPL-3",
10+
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
11+
"website": "https://github.com/OCA/sale-workflow",
12+
"maintainers": ["rousseldenis"],
13+
"depends": [
14+
"payment",
15+
"sale",
16+
],
17+
"data": [
18+
"views/sale_order.xml",
19+
],
20+
"demo": [
21+
"demo/payment_transaction.xml",
22+
],
23+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<!-- Copyright 2021 ACSONE SA/NV
3+
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
4+
<odoo noupdate="1">
5+
<record id="transaction_sale_6" model="payment.transaction">
6+
<field name="provider_id" ref="payment.payment_provider_adyen" />
7+
<field name="amount">750.0</field>
8+
<field name="partner_id" ref="base.res_partner_18" />
9+
<field name="state">draft</field>
10+
<field name="sale_order_ids" eval="[(6, 0, [ref('sale.sale_order_6')])]" />
11+
<field
12+
name="currency_id"
13+
eval="obj().env.ref('sale.sale_order_6').currency_id"
14+
model="sale.order"
15+
/>
16+
<field name="payment_method_id" ref="payment.payment_method_bank_account" />
17+
</record>
18+
</odoo>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * sale_transaction_form_link
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 14.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"PO-Revision-Date: 2024-01-17 00:04+0000\n"
10+
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
11+
"Language-Team: none\n"
12+
"Language: es\n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
17+
"X-Generator: Weblate 4.17\n"
18+
19+
#. module: sale_transaction_form_link
20+
#: model:ir.model.fields,field_description:sale_transaction_form_link.field_sale_order__display_name
21+
msgid "Display Name"
22+
msgstr "Mostrar Nombre"
23+
24+
#. module: sale_transaction_form_link
25+
#: model:ir.model.fields,field_description:sale_transaction_form_link.field_sale_order__id
26+
msgid "ID"
27+
msgstr "ID"
28+
29+
#. module: sale_transaction_form_link
30+
#: model:ir.model.fields,field_description:sale_transaction_form_link.field_sale_order____last_update
31+
msgid "Last Modified on"
32+
msgstr "Última Modificación el"
33+
34+
#. module: sale_transaction_form_link
35+
#: model:ir.model.fields,field_description:sale_transaction_form_link.field_sale_order__payment_transaction_count
36+
msgid "Number of payment transactions"
37+
msgstr "Número de transacciones de pago"
38+
39+
#. module: sale_transaction_form_link
40+
#: model:ir.model,name:sale_transaction_form_link.model_sale_order
41+
msgid "Sales Order"
42+
msgstr "Orden de Ventas"
43+
44+
#. module: sale_transaction_form_link
45+
#: model_terms:ir.ui.view,arch_db:sale_transaction_form_link.sale_order_form_view
46+
msgid "Transactions"
47+
msgstr "Transacciones"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * sale_transaction_form_link
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 16.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"PO-Revision-Date: 2024-10-03 11:06+0000\n"
10+
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
11+
"Language-Team: none\n"
12+
"Language: it\n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: \n"
16+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
17+
"X-Generator: Weblate 5.6.2\n"
18+
19+
#. module: sale_transaction_form_link
20+
#: model:ir.model.fields,field_description:sale_transaction_form_link.field_sale_order__payment_transaction_count
21+
msgid "Number of payment transactions"
22+
msgstr "Numero di transazioni di pagamento"
23+
24+
#. module: sale_transaction_form_link
25+
#: model:ir.model,name:sale_transaction_form_link.model_sale_order
26+
msgid "Sales Order"
27+
msgstr "Ordine di vendita"
28+
29+
#. module: sale_transaction_form_link
30+
#: model_terms:ir.ui.view,arch_db:sale_transaction_form_link.sale_order_form_view
31+
msgid "Transactions"
32+
msgstr "Transazioni"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * sale_transaction_form_link
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 16.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"Last-Translator: \n"
10+
"Language-Team: \n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: \n"
15+
16+
#. module: sale_transaction_form_link
17+
#: model:ir.model.fields,field_description:sale_transaction_form_link.field_sale_order__payment_transaction_count
18+
msgid "Number of payment transactions"
19+
msgstr ""
20+
21+
#. module: sale_transaction_form_link
22+
#: model:ir.model,name:sale_transaction_form_link.model_sale_order
23+
msgid "Sales Order"
24+
msgstr ""
25+
26+
#. module: sale_transaction_form_link
27+
#: model_terms:ir.ui.view,arch_db:sale_transaction_form_link.sale_order_form_view
28+
msgid "Transactions"
29+
msgstr ""
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import sale_order
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright 2020 ACSONE SA/NV
2+
# Copyright 2025 Jacques-Etienne Baudoux (BCIM) <je@bcim.be>
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
4+
5+
from odoo import api, fields, models
6+
7+
8+
class SaleOrder(models.Model):
9+
_inherit = "sale.order"
10+
11+
payment_transaction_count = fields.Integer(
12+
string="Number of payment transactions",
13+
compute="_compute_payment_transaction_count",
14+
)
15+
16+
@api.depends("transaction_ids")
17+
def _compute_payment_transaction_count(self):
18+
for rec in self:
19+
rec.payment_transaction_count = len(rec.transaction_ids)
20+
21+
def action_view_transaction(self):
22+
action = {
23+
"type": "ir.actions.act_window",
24+
"name": "Payment Transactions",
25+
"res_model": "payment.transaction",
26+
}
27+
if self.payment_transaction_count == 1:
28+
action.update({"res_id": self.transaction_ids.id, "view_mode": "form"})
29+
else:
30+
action.update(
31+
{
32+
"view_mode": "list,form",
33+
"domain": [("id", "in", self.transaction_ids.ids)],
34+
}
35+
)
36+
return action
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"

0 commit comments

Comments
 (0)