Skip to content

Commit

Permalink
[MIG] account_payment_return: Migration to 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chienandalu authored and carlosdauden committed Mar 20, 2023
1 parent c445af0 commit bd8c21c
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 70 deletions.
20 changes: 9 additions & 11 deletions account_payment_return/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ history through it.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/96/8.0
:target: https://runbot.odoo-community.org/runbot/96/10.0

Known issues / Roadmap
======================
Expand All @@ -41,13 +41,10 @@ Known issues / Roadmap
Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/
account-payment/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 `here <https://github.com/OCA/
account-payment/issues/new?body=module:%20
account_payment_return%0Aversion:%20
8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/account-payment/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.

Credits
=======
Expand All @@ -60,18 +57,19 @@ Contributors
* Markus Schneider <markus.schneider@initos.com>
* Sergio Teruel <sergio.teruel@tecnativa.com>
* Carlos Dauden <carlos.dauden@tecnativa.com>
* David Vidal <david.vidal@tecnativa.com>

Maintainer
----------

.. image:: http://odoo-community.org/logo.png
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org
:target: https://odoo-community.org

This module is maintained by the OCA.

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.

To contribute to this module, please visit http://odoo-community.org.
To contribute to this module, please visit https://odoo-community.org.
5 changes: 0 additions & 5 deletions account_payment_return/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# -*- coding: utf-8 -*-
# © 2011-2012 7 i TRIA <http://www.7itria.cat>
# © 2011-2012 Avanzosc <http://www.avanzosc.com>
# © 2013 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# © 2014 Markus Schneider <markus.schneider@initos.com>
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# -*- coding: utf-8 -*-
# © 2011-2012 7 i TRIA <http://www.7itria.cat>
# © 2011-2012 Avanzosc <http://www.avanzosc.com>
# © 2013 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# © 2014 Markus Schneider <markus.schneider@initos.com>
# © 2015 Sergio Teruel <sergio.teruel@tecnativa.com>
# © 2015-2017 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# Copyright 2011-2012 7 i TRIA <http://www.7itria.cat>
# Copyright 2011-2012 Avanzosc <http://www.avanzosc.com>
# Copyright 2013 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2014 Markus Schneider <markus.schneider@initos.com>
# Copyright 2015 Sergio Teruel <sergio.teruel@tecnativa.com>
# Copyright 2015-2017 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# Copyright 2017 David Vidal <david.vidal@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Account Payment Returns",
"version": "9.0.1.1.0",
"version": "10.0.1.0.0",
"summary": "Manage the return of your payments",
'license': 'AGPL-3',
"depends": [
Expand All @@ -21,7 +22,7 @@
'Tecnativa, '
'initOS GmbH & Co., '
'Odoo Community Association (OCA)',
'website': 'http://www.tecnativa.com',
'website': 'https://www.tecnativa.com',
'data': [
'security/ir.model.access.csv',
'security/account_payment_return_security.xml',
Expand Down
10 changes: 5 additions & 5 deletions account_payment_return/data/ir_sequence_data.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- © 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
© 2015 Sergio Teruel <sergio.teruel@tecnativa.com>
© 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
<!-- Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
Copyright 2015 Sergio Teruel <sergio.teruel@tecnativa.com>
Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). -->
<odoo>
<data noupdate="1">
<odoo noupdate="1">
<data>

<record id="seq_payment_return" model="ir.sequence">
<field name="name">Payment return</field>
Expand Down
5 changes: 0 additions & 5 deletions account_payment_return/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# -*- coding: utf-8 -*-
# © 2011-2012 7 i TRIA <http://www.7itria.cat>
# © 2011-2012 Avanzosc <http://www.avanzosc.com>
# © 2013 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# © 2014 Markus Schneider <markus.schneider@initos.com>
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import payment_return
Expand Down
8 changes: 4 additions & 4 deletions account_payment_return/models/account_invoice.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
# © 2013 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# © 2014 Markus Schneider <markus.schneider@initos.com>
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# Copyright 2013 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2014 Markus Schneider <markus.schneider@initos.com>
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import json
from operator import itemgetter
from openerp import _, api, models, fields
from odoo import _, api, fields, models


class AccountInvoice(models.Model):
Expand Down
4 changes: 2 additions & 2 deletions account_payment_return/models/account_move.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import fields, models
from odoo import fields, models


class AccountPartialReconcile(models.Model):
Expand Down
18 changes: 9 additions & 9 deletions account_payment_return/models/payment_return.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# -*- coding: utf-8 -*-
# © 2011-2012 7 i TRIA <http://www.7itria.cat>
# © 2011-2012 Avanzosc <http://www.avanzosc.com>
# © 2013 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# © 2014 Markus Schneider <markus.schneider@initos.com>
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# Copyright 2011-2012 7 i TRIA <http://www.7itria.cat>
# Copyright 2011-2012 Avanzosc <http://www.avanzosc.com>
# Copyright 2013 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2014 Markus Schneider <markus.schneider@initos.com>
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import models, fields, api, _
from openerp.exceptions import Warning as UserError
import openerp.addons.decimal_precision as dp
from odoo import _, api, fields, models
from odoo.exceptions import Warning as UserError
import odoo.addons.decimal_precision as dp


class PaymentReturn(models.Model):
Expand Down Expand Up @@ -230,7 +230,7 @@ class PaymentReturnLine(models.Model):
amount = fields.Float(
string='Amount',
help="Returned amount. Can be different from the move amount",
digits_compute=dp.get_precision('Account'))
digits=dp.get_precision('Account'))

@api.multi
def _compute_amount(self):
Expand Down
4 changes: 2 additions & 2 deletions account_payment_return/models/payment_return_reason.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import models, fields, api
from odoo import api, fields, models


class PaymentReturnReason(models.Model):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- © 2015 Sergio Teruel <sergio.teruel@tecnativa.com>
© 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
<!-- Copyright 2015 Sergio Teruel <sergio.teruel@tecnativa.com>
Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). -->
<odoo>

Expand Down
2 changes: 1 addition & 1 deletion account_payment_return/static/src/xml/account_payment.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
<!-- Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). -->
<templates xml:space="preserve">

Expand Down
2 changes: 0 additions & 2 deletions account_payment_return/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from . import test_payment_return
19 changes: 12 additions & 7 deletions account_payment_return/tests/test_payment_return.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# © 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# Copyright 2017 David Vidal <david.vidal@tecnativa.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

import json
from openerp.exceptions import Warning as UserError, ValidationError
from openerp.tests.common import SavepointCase
from odoo.exceptions import Warning as UserError, ValidationError
from odoo.tests.common import SavepointCase


class TestPaymentReturn(SavepointCase):
Expand Down Expand Up @@ -59,7 +60,7 @@ def setUpClass(cls):
'code': 'RTEST',
'name': 'Reason Test'
})
cls.invoice.signal_workflow('invoice_open')
cls.invoice.action_invoice_open()
cls.receivable_line = cls.invoice.move_id.line_ids.filtered(
lambda x: x.account_id.internal_type == 'receivable')
# Invert the move to simulate the payment
Expand Down Expand Up @@ -183,5 +184,9 @@ def test_payments_widget(self):
self.assertEqual(info['content'][1]['amount'], -500.0)

def test_reason_name_search(self):
self.payment_return.line_ids[0].reason_id = 'RTEST'
self.payment_return.line_ids[0].reason_id = 'Reason Test'
reason = self.env['payment.return.reason']
line = self.payment_return.line_ids[0]
line.reason_id = reason.name_search('RTEST')[0]
self.assertEqual(line.reason_id.name, 'Reason Test')
line.reason_id = reason.name_search('Reason Test')[0]
self.assertEqual(line.reason_id.code, 'RTEST')
7 changes: 4 additions & 3 deletions account_payment_return/views/account_invoice_view.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- © 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
© 2015 Sergio Teruel <sergio.teruel@tecnativa.com>
© 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
<!-- Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
Copyright 2015 Sergio Teruel <sergio.teruel@tecnativa.com>
Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). -->
<odoo>

<record id="invoice_return_form" model="ir.ui.view">
<field name="name">account.invoice.form.return</field>
<field name="model">account.invoice</field>
Expand Down
6 changes: 3 additions & 3 deletions account_payment_return/views/payment_return_view.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- © 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
© 2015 Sergio Teruel <sergio.teruel@tecnativa.com>
© 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
<!-- Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com>
Copyright 2015 Sergio Teruel <sergio.teruel@tecnativa.com>
Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). -->
<odoo>
<record model="ir.ui.view" id="payment_return_form_view">
Expand Down

0 comments on commit bd8c21c

Please sign in to comment.