Skip to content

Commit

Permalink
[IMP] account_partner_reconcile: black, isort
Browse files Browse the repository at this point in the history
  • Loading branch information
MiquelRForgeFlow committed Jan 29, 2020
1 parent 52fefa9 commit ebee511
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ line_length=88
known_odoo=odoo
known_odoo_addons=odoo.addons
sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER
known_third_party=
known_third_party=setuptools
23 changes: 9 additions & 14 deletions account_partner_reconcile/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

{
'name': "Account Partner Reconcile",
'version': '12.0.1.0.1',
'category': 'Accounting',
'author': 'Eficent,'
'Odoo Community Association (OCA), ',
'website': 'https://github.com/OCA/account-reconcile',
'license': 'AGPL-3',
"depends": [
'account',
],
"data": [
'views/res_partner_view.xml',
],
"installable": True
"name": "Account Partner Reconcile",
"version": "12.0.1.0.1",
"category": "Accounting",
"author": "Eficent," "Odoo Community Association (OCA), ",
"website": "https://github.com/OCA/account-reconcile",
"license": "AGPL-3",
"depends": ["account"],
"data": ["views/res_partner_view.xml"],
"installable": True,
}
22 changes: 12 additions & 10 deletions account_partner_reconcile/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,24 @@


class ResPartner(models.Model):
_inherit = 'res.partner'
_inherit = "res.partner"

@api.multi
def action_open_reconcile(self):
# Open reconciliation view for customers and suppliers
reconcile_mode = self.env.context.get('reconcile_mode', False)
reconcile_mode = self.env.context.get("reconcile_mode", False)
accounts = self.property_account_payable_id
if reconcile_mode == 'customers':
if reconcile_mode == "customers":
accounts = self.property_account_receivable_id

action_context = {'show_mode_selector': True,
'partner_ids': [self.id, ],
'mode': reconcile_mode,
'account_ids': accounts.ids}
action_context = {
"show_mode_selector": True,
"partner_ids": [self.id],
"mode": reconcile_mode,
"account_ids": accounts.ids,
}
return {
'type': 'ir.actions.client',
'tag': 'manual_reconciliation_view',
'context': action_context,
"type": "ir.actions.client",
"tag": "manual_reconciliation_view",
"context": action_context,
}
2 changes: 1 addition & 1 deletion account_partner_reconcile/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
The button is visible only to users that belong to the accounting groups
"Accountant" or "Adviser".
"Accountant" or "Adviser".
2 changes: 1 addition & 1 deletion account_partner_reconcile/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#. Enable 'Show Full Accounting Features'
#. Create a new Customer Invoice and Payment
#. Go to the Customer/Supplier view form and click on Match payments
#. Go to the Customer/Supplier view form and click on Match payments
30 changes: 14 additions & 16 deletions account_partner_reconcile/tests/test_account_partner_reconcile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,24 @@ class TestAccountPartnerReconcile(TransactionCase):
def setUp(self):
super(TestAccountPartnerReconcile, self).setUp()

self.partner1 = self.env.ref('base.res_partner_1')
self.partner1 = self.env.ref("base.res_partner_1")

def test_account_partner_reconcile(self):
res = self.partner1.action_open_reconcile()

# assertDictContainsSubset is deprecated in Python <3.2
expect = {
'type': 'ir.actions.client',
'tag': 'manual_reconciliation_view',
}
expect = {"type": "ir.actions.client", "tag": "manual_reconciliation_view"}
self.assertDictEqual(
expect, {k: v for k, v in res.items() if k in expect},
'There was an error and the manual_reconciliation_view '
'couldn\'t be opened.')

expect = {
'partner_ids': self.partner1.ids,
'show_mode_selector': True,
}
expect,
{k: v for k, v in res.items() if k in expect},
"There was an error and the manual_reconciliation_view "
"couldn't be opened.",
)

expect = {"partner_ids": self.partner1.ids, "show_mode_selector": True}
self.assertDictEqual(
expect, {k: v for k, v in res['context'].items() if k in expect},
'There was an error and the manual_reconciliation_view '
'couldn\'t be opened.')
expect,
{k: v for k, v in res["context"].items() if k in expect},
"There was an error and the manual_reconciliation_view "
"couldn't be opened.",
)
3 changes: 1 addition & 2 deletions account_reconcile_restrict_partner_mismatch/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import models
from . import report
from . import models, report
11 changes: 3 additions & 8 deletions setup/_metapackage/setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import setuptools

with open('VERSION.txt', 'r') as f:
with open("VERSION.txt", "r") as f:
version = f.read().strip()

setuptools.setup(
name="odoo13-addons-oca-account-reconcile",
description="Meta package for oca-account-reconcile Odoo addons",
version=version,
install_requires=[
'odoo13-addon-account_reconcile_restrict_partner_mismatch',
],
classifiers=[
'Programming Language :: Python',
'Framework :: Odoo',
]
install_requires=["odoo13-addon-account_reconcile_restrict_partner_mismatch"],
classifiers=["Programming Language :: Python", "Framework :: Odoo"],
)
5 changes: 1 addition & 4 deletions setup/account_reconcile_restrict_partner_mismatch/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
setuptools.setup(setup_requires=["setuptools-odoo"], odoo_addon=True)

0 comments on commit ebee511

Please sign in to comment.