Skip to content

Commit 57fc212

Browse files
committed
[FIX] pre-commit
1 parent 288ea25 commit 57fc212

File tree

3 files changed

+32
-27
lines changed

3 files changed

+32
-27
lines changed

hr_expense_advance_clearing/README.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Employee Advance and Clearing
77
!! This file is generated by oca-gen-addon-readme !!
88
!! changes will be overwritten. !!
99
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10-
!! source digest: sha256:3f86d32ea88a35bf634ff890883afa7eed74a9d596f50690ca541b95f506662f
10+
!! source digest: sha256:0b18f15b48427652d4b03f061e7f129f606678149ad968880eb441c870633931
1111
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1212
1313
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -17,13 +17,13 @@ Employee Advance and Clearing
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr--expense-lightgray.png?logo=github
20-
:target: https://github.com/OCA/hr-expense/tree/15.0/hr_expense_advance_clearing
20+
:target: https://github.com/OCA/hr-expense/tree/16.0/hr_expense_advance_clearing
2121
:alt: OCA/hr-expense
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/hr-expense-15-0/hr-expense-15-0-hr_expense_advance_clearing
23+
:target: https://translation.odoo-community.org/projects/hr-expense-16-0/hr-expense-16-0-hr_expense_advance_clearing
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr-expense&target_branch=15.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr-expense&target_branch=16.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -112,7 +112,7 @@ Bug Tracker
112112
Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr-expense/issues>`_.
113113
In case of trouble, please check there if your issue has already been reported.
114114
If you spotted it first, help us to smash it by providing a detailed and welcomed
115-
`feedback <https://github.com/OCA/hr-expense/issues/new?body=module:%20hr_expense_advance_clearing%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
115+
`feedback <https://github.com/OCA/hr-expense/issues/new?body=module:%20hr_expense_advance_clearing%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
116116

117117
Do not contact contributors directly about support or help with technical issues.
118118

@@ -152,6 +152,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
152152

153153
|maintainer-kittiu|
154154

155-
This module is part of the `OCA/hr-expense <https://github.com/OCA/hr-expense/tree/15.0/hr_expense_advance_clearing>`_ project on GitHub.
155+
This module is part of the `OCA/hr-expense <https://github.com/OCA/hr-expense/tree/16.0/hr_expense_advance_clearing>`_ project on GitHub.
156156

157157
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

hr_expense_advance_clearing/static/description/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,9 @@ <h1 class="title">Employee Advance and Clearing</h1>
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370-
!! source digest: sha256:3f86d32ea88a35bf634ff890883afa7eed74a9d596f50690ca541b95f506662f
370+
!! source digest: sha256:0b18f15b48427652d4b03f061e7f129f606678149ad968880eb441c870633931
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/hr-expense/tree/15.0/hr_expense_advance_clearing"><img alt="OCA/hr-expense" src="https://img.shields.io/badge/github-OCA%2Fhr--expense-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/hr-expense-15-0/hr-expense-15-0-hr_expense_advance_clearing"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/hr-expense&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/hr-expense/tree/16.0/hr_expense_advance_clearing"><img alt="OCA/hr-expense" src="https://img.shields.io/badge/github-OCA%2Fhr--expense-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/hr-expense-16-0/hr-expense-16-0-hr_expense_advance_clearing"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/hr-expense&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>Standard Expenses module allow employee to do the expense reimbursement only after the expense has been made.
374374
In other world, employee will need to pay first and reimburse later.</p>
375375
<p>This module, allow company to advance an amount to the employee.
@@ -470,7 +470,7 @@ <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
470470
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/hr-expense/issues">GitHub Issues</a>.
471471
In case of trouble, please check there if your issue has already been reported.
472472
If you spotted it first, help us to smash it by providing a detailed and welcomed
473-
<a class="reference external" href="https://github.com/OCA/hr-expense/issues/new?body=module:%20hr_expense_advance_clearing%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
473+
<a class="reference external" href="https://github.com/OCA/hr-expense/issues/new?body=module:%20hr_expense_advance_clearing%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
474474
<p>Do not contact contributors directly about support or help with technical issues.</p>
475475
</div>
476476
<div class="section" id="credits">
@@ -498,7 +498,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
498498
promote its widespread use.</p>
499499
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
500500
<p><a class="reference external image-reference" href="https://github.com/kittiu"><img alt="kittiu" src="https://github.com/kittiu.png?size=40px" /></a></p>
501-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/hr-expense/tree/15.0/hr_expense_advance_clearing">OCA/hr-expense</a> project on GitHub.</p>
501+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/hr-expense/tree/16.0/hr_expense_advance_clearing">OCA/hr-expense</a> project on GitHub.</p>
502502
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
503503
</div>
504504
</div>

hr_expense_advance_clearing/wizard/account_payment_register.py

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,21 @@ def _validate_over_return(self):
7878
more_info = ""
7979
symbol = self.source_currency_id.symbol
8080
if amount_not_clear:
81-
more_info = _("\nNote: pending amount clearing is {}{}").format(
82-
symbol,
83-
"{:,.2f}".format(amount_not_clear),
84-
)
81+
more_info = _("\nNote: pending amount clearing is %(symbol)s%(amount)s") % {
82+
"symbol": symbol,
83+
"amount": "{:,.2f}".format(amount_not_clear),
84+
}
8585
if float_compare(self.amount, actual_remaining, 2) == 1:
8686
raise UserError(
8787
_(
88-
"You cannot return advance more than actual remaining ({}{}){}"
89-
).format(symbol, "{:,.2f}".format(actual_remaining), more_info)
88+
"You cannot return advance more than actual remaining "
89+
"(%(symbol)s%(amount)s)%(more_info)s"
90+
)
91+
% {
92+
"symbol": symbol,
93+
"amount": "{:,.2f}".format(actual_remaining),
94+
"more_info": more_info,
95+
}
9096
)
9197

9298
def action_create_payments(self):
@@ -124,20 +130,19 @@ def expense_post_return_advance(self):
124130
payment.action_post()
125131

126132
redirect_link = (
127-
"<a href=# data-oe-model=account.payment data-oe-id={}>{}</a>".format(
128-
payment.id, payment.name
129-
)
133+
f"<a href=# data-oe-model=account.payment data-oe-id={payment.id}>"
134+
f"{payment.name}</a>"
130135
) # Account Payment link
131136
# Log the return advance in the chatter
132137
body = _(
133-
"A remaining advance return of {} {} with the reference "
134-
"{} related to your expense {} has been made."
135-
).format(
136-
payment.amount,
137-
payment.currency_id.symbol,
138-
redirect_link,
139-
expense_sheet.name,
140-
)
138+
"A remaining advance return of %(amount)s %(symbol)s with the reference "
139+
"%(ref)s related to your expense %(name)s has been made."
140+
) % {
141+
"amount": payment.amount,
142+
"symbol": payment.currency_id.symbol,
143+
"ref": redirect_link,
144+
"name": expense_sheet.name,
145+
}
141146
expense_sheet.message_post(body=body)
142147

143148
# Reconcile the return advance and the advance,

0 commit comments

Comments
 (0)