Skip to content

Commit

Permalink
[MIG] payroll_account: Migration to 15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mtelahun committed Nov 11, 2022
1 parent 3278bc0 commit 91c8c41
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 32 deletions.
10 changes: 5 additions & 5 deletions payroll_account/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Payroll Accounting
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpayroll-lightgray.png?logo=github
:target: https://github.com/OCA/payroll/tree/14.0/payroll_account
:target: https://github.com/OCA/payroll/tree/15.0/payroll_account
:alt: OCA/payroll
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/payroll-14-0/payroll-14-0-payroll_account
:target: https://translation.odoo-community.org/projects/payroll-15-0/payroll-15-0-payroll_account
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/281/14.0
:target: https://runbot.odoo-community.org/runbot/281/15.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -48,7 +48,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/payroll/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/payroll/issues/new?body=module:%20payroll_account%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/payroll/issues/new?body=module:%20payroll_account%0Aversion:%2015.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 @@ -90,6 +90,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-appstogrow| |maintainer-nimarosa|

This module is part of the `OCA/payroll <https://github.com/OCA/payroll/tree/14.0/payroll_account>`_ project on GitHub.
This module is part of the `OCA/payroll <https://github.com/OCA/payroll/tree/15.0/payroll_account>`_ 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 payroll_account/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
"name": "Payroll Accounting",
"version": "14.0.2.1.0",
"version": "15.0.1.0.0",
"category": "Payroll",
"website": "https://github.com/OCA/payroll",
"license": "LGPL-3",
Expand Down
3 changes: 2 additions & 1 deletion payroll_account/models/hr_payroll_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ def create(self, vals):

@api.onchange("contract_id")
def onchange_contract(self):
super(HrPayslip, self).onchange_contract()
res = super(HrPayslip, self).onchange_contract()
self.journal_id = (
self.contract_id.journal_id.id
or (not self.contract_id and self.default_get(["journal_id"])["journal_id"])
or self.journal_id
)
return res

def action_payslip_cancel(self):
for payslip in self:
Expand Down
8 changes: 4 additions & 4 deletions payroll_account/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Payroll Accounting</title>
<style type="text/css">

Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Payroll Accounting</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" 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" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/payroll/tree/14.0/payroll_account"><img alt="OCA/payroll" src="https://img.shields.io/badge/github-OCA%2Fpayroll-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/payroll-14-0/payroll-14-0-payroll_account"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/281/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" 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" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/payroll/tree/15.0/payroll_account"><img alt="OCA/payroll" src="https://img.shields.io/badge/github-OCA%2Fpayroll-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/payroll-15-0/payroll-15-0-payroll_account"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/281/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>Generic Payroll system Integrated with Accounting.</p>
<p>This module is a backport from Odoo SA and as such, it is not included in the OCA CLA.
That means we do not have a copy of the copyright on it like all other OCA modules.</p>
Expand Down Expand Up @@ -395,7 +395,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/payroll/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 smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/payroll/issues/new?body=module:%20payroll_account%0Aversion:%2014.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/payroll/issues/new?body=module:%20payroll_account%0Aversion:%2015.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 @@ -422,7 +422,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external" href="https://github.com/appstogrow"><img alt="appstogrow" src="https://github.com/appstogrow.png?size=40px" /></a> <a class="reference external" href="https://github.com/nimarosa"><img alt="nimarosa" src="https://github.com/nimarosa.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/payroll/tree/14.0/payroll_account">OCA/payroll</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/payroll/tree/15.0/payroll_account">OCA/payroll</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
43 changes: 23 additions & 20 deletions payroll_account/tests/test_payroll_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class TestPayrollAccount(common.TransactionCase):
def setUp(self):
super(TestPayrollAccount, self).setUp()

# Activate company currency
self.env.user.company_id.currency_id.active = True

self.payslip_action_id = self.ref("payroll.hr_payslip_menu")

self.res_partner_bank = self.env["res.partner.bank"].create(
Expand Down Expand Up @@ -150,16 +153,16 @@ def test_00_hr_payslip(self):
self.assertEqual(self.hr_payslip.state, "draft", "State not changed!")

# I click on "Compute Sheet" button.
context = {
"lang": "en_US",
"tz": False,
"active_model": "hr.payslip",
"department_id": False,
"active_ids": [self.payslip_action_id],
"section_id": False,
"active_id": self.payslip_action_id,
}
self.hr_payslip.with_context(context).compute_sheet()
self.hr_payslip.with_context(
{},
lang="en_US",
tz=False,
active_model="hr.payslip",
department_id=False,
active_ids=[self.payslip_action_id],
section_id=False,
active_id=self.payslip_action_id,
).compute_sheet()

# I want to check cancel button.
# So I first cancel the sheet then make it set to draft.
Expand Down Expand Up @@ -195,16 +198,16 @@ def test_hr_payslip_no_accounts(self):
self.hr_payslip.write(vals)

# I click on "Compute Sheet" button.
context = {
"lang": "en_US",
"tz": False,
"active_model": "hr.payslip",
"department_id": False,
"active_ids": [self.payslip_action_id],
"section_id": False,
"active_id": self.payslip_action_id,
}
self.hr_payslip.with_context(context).compute_sheet()
self.hr_payslip.with_context(
{},
lang="en_US",
tz=False,
active_model="hr.payslip",
department_id=False,
active_ids=[self.payslip_action_id],
section_id=False,
active_id=self.payslip_action_id,
).compute_sheet()

# Confirm Payslip (no account moves)
self.hr_payslip.action_payslip_done()
Expand Down
2 changes: 1 addition & 1 deletion payroll_account/views/hr_payroll_account_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<field name="model">hr.contract</field>
<field name="inherit_id" ref="hr_contract.hr_contract_view_form" />
<field name="arch" type="xml">
<xpath expr="//group[@name='duration_group']" position="after">
<xpath expr="//group[@name='top_info_right']" position="after">
<group string="Accounting">
<field
name="analytic_account_id"
Expand Down

0 comments on commit 91c8c41

Please sign in to comment.