Skip to content

Commit

Permalink
[MIG] hr_expense_advance_clearing: Migration to 15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigonevest committed Nov 9, 2023
1 parent ded2950 commit 36f7b13
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 19 deletions.
12 changes: 6 additions & 6 deletions hr_expense_advance_clearing/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Employee Advance and Clearing
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:13b9633fd88ac0e7992317de9950956e5d7eedf595f9ef5b5593697f11c4dffa
!! source digest: sha256:47860cebcbab56a24212a0f69fe83dcd4ba37d05234a32731e4cc7fc4e73163a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand All @@ -17,13 +17,13 @@ Employee Advance and Clearing
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr-lightgray.png?logo=github
:target: https://github.com/OCA/hr/tree/12.0/hr_expense_advance_clearing
:target: https://github.com/OCA/hr/tree/14.0/hr_expense_advance_clearing
:alt: OCA/hr
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_expense_advance_clearing
:target: https://translation.odoo-community.org/projects/hr-14-0/hr-14-0-hr_expense_advance_clearing
: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/hr&target_branch=12.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr&target_branch=14.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -106,7 +106,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr/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/hr/issues/new?body=module:%20hr_expense_advance_clearing%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/hr/issues/new?body=module:%20hr_expense_advance_clearing%0Aversion:%2014.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.

Expand Down Expand Up @@ -144,6 +144,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-kittiu|

This module is part of the `OCA/hr <https://github.com/OCA/hr/tree/12.0/hr_expense_advance_clearing>`_ project on GitHub.
This module is part of the `OCA/hr <https://github.com/OCA/hr/tree/14.0/hr_expense_advance_clearing>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion hr_expense_advance_clearing/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Employee Advance and Clearing",
"version": "12.0.1.3.0",
"version": "14.0.1.0.0",
"category": "Human Resources",
"author": "Ecosoft, " "Odoo Community Association (OCA)",
"license": "AGPL-3",
Expand Down
4 changes: 1 addition & 3 deletions hr_expense_advance_clearing/models/hr_expense.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class HrExpense(models.Model):
default=False,
)

@api.multi
@api.constrains("advance")
def _check_advance(self):
for expense in self.filtered("advance"):
Expand Down Expand Up @@ -45,7 +44,6 @@ def onchange_advance(self):
else:
self.product_id = False

@api.multi
def _get_account_move_line_values(self):
move_line_values_by_expense = super()._get_account_move_line_values()
# Only when do the clearing, change cr payable to cr advance
Expand All @@ -59,7 +57,7 @@ def _get_account_move_line_values(self):
)
for sheet in sheets:
advance_to_clear = sheet.advance_sheet_residual
for expense_id, move_lines in move_line_values_by_expense.items():
for _expense_id, move_lines in move_line_values_by_expense.items():
payable_move_line = False
for move_line in move_lines:
credit = move_line["credit"]
Expand Down
5 changes: 0 additions & 5 deletions hr_expense_advance_clearing/models/hr_expense_sheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def _compute_advance(self):
)
return

@api.one
@api.constrains("advance_sheet_id", "expense_line_ids")
def _check_advance_expense(self):
advance_lines = self.expense_line_ids.filtered("advance")
Expand All @@ -69,7 +68,6 @@ def _check_advance_expense(self):
_("Advance must contain only 1 " "advance expense line")
)

@api.one
@api.depends("account_move_id.line_ids.amount_residual")
def _compute_clearing_residual(self):
residual_company = 0.0
Expand All @@ -82,15 +80,13 @@ def _compute_clearing_residual(self):
residual_company += line.amount_residual
self.clearing_residual = residual_company

@api.multi
def _compute_amount_payable(self):
for sheet in self:
rec_lines = sheet.account_move_id.line_ids.filtered(
lambda x: x.credit and x.account_id.reconcile and not x.reconciled
)
sheet.amount_payable = -sum(rec_lines.mapped("amount_residual"))

@api.multi
def action_sheet_move_create(self):
res = super(HrExpenseSheet, self).action_sheet_move_create()
# Reconcile advance of this sheet with the advance_sheet
Expand All @@ -109,7 +105,6 @@ def action_sheet_move_create(self):
adv_move_lines.reconcile()
return res

@api.multi
def open_clear_advance(self):
self.ensure_one()
action = self.env.ref(
Expand Down
8 changes: 4 additions & 4 deletions hr_expense_advance_clearing/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ <h1 class="title">Employee Advance and Clearing</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:13b9633fd88ac0e7992317de9950956e5d7eedf595f9ef5b5593697f11c4dffa
!! source digest: sha256:47860cebcbab56a24212a0f69fe83dcd4ba37d05234a32731e4cc7fc4e73163a
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/tree/12.0/hr_expense_advance_clearing"><img alt="OCA/hr" src="https://img.shields.io/badge/github-OCA%2Fhr-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/hr-12-0/hr-12-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&amp;target_branch=12.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<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/tree/14.0/hr_expense_advance_clearing"><img alt="OCA/hr" src="https://img.shields.io/badge/github-OCA%2Fhr-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/hr-14-0/hr-14-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&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Standard Expenses module allow employee to do the expense reimbursement only after the expense has been made.
In other world, employee will need to pay first and reimburse later.</p>
<p>This module, allow company to advance an amount to the employee.
Expand Down Expand Up @@ -456,7 +456,7 @@ <h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/hr/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/hr/issues/new?body=module:%20hr_expense_advance_clearing%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/hr/issues/new?body=module:%20hr_expense_advance_clearing%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -482,7 +482,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<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>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/hr/tree/12.0/hr_expense_advance_clearing">OCA/hr</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/hr/tree/14.0/hr_expense_advance_clearing">OCA/hr</a> project on GitHub.</p>
<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>
</div>
</div>
Expand Down

0 comments on commit 36f7b13

Please sign in to comment.