From f9d8ac293a8118ed1e2153d64b9ab551efa331e2 Mon Sep 17 00:00:00 2001 From: David Vidal Date: Thu, 7 Sep 2017 13:47:08 +0200 Subject: [PATCH] [IMP] Minor changes --- partner_financial_risk/README.rst | 7 ++++--- partner_financial_risk/__manifest__.py | 1 - partner_financial_risk/models/res_partner.py | 6 ++---- .../tests/test_partner_financial_risk.py | 15 ++++++++------- partner_financial_risk/views/res_partner_view.xml | 2 +- .../wizard/partner_risk_exceeded_view.xml | 2 +- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/partner_financial_risk/README.rst b/partner_financial_risk/README.rst index fdbb9cd21..0eeb63425 100644 --- a/partner_financial_risk/README.rst +++ b/partner_financial_risk/README.rst @@ -16,9 +16,10 @@ Configuration To configure this module, you need to: -#. Go to *Invoicing/Accounting > Configuration > Settings > Invoicing & Payments* -#. In the *Financial Risk* section, fill *Unpaid Margin* for setting the number - of days to last after the due date to consider an invoice as unpaid. +#. Go to *Invoicing/Accounting > Configuration > Settings > Accounting & + Finance* +#. In the *Financial Risk* section, fill *Maturity Margin* for setting the + number of days to last after the due date to consider an invoice as unpaid. Usage ===== diff --git a/partner_financial_risk/__manifest__.py b/partner_financial_risk/__manifest__.py index 484ca676d..c991eace8 100644 --- a/partner_financial_risk/__manifest__.py +++ b/partner_financial_risk/__manifest__.py @@ -12,7 +12,6 @@ 'website': 'https://www.tecnativa.com', 'depends': [ 'account', - 'sales_team', ], 'data': [ 'data/partner_financial_risk_data.xml', diff --git a/partner_financial_risk/models/res_partner.py b/partner_financial_risk/models/res_partner.py index 0f32d3b78..21b824417 100644 --- a/partner_financial_risk/models/res_partner.py +++ b/partner_financial_risk/models/res_partner.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# © 2016 Carlos Dauden +# Copyright 2016 Carlos Dauden # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from datetime import datetime @@ -60,9 +60,7 @@ class ResPartner(models.Model): @api.multi def _compute_risk_allow_edit(self): - is_editable = self.env.user.has_group( - 'sales_team.group_sale_manager') or self.env.user.has_group( - 'account.group_account_manager') + is_editable = self.env.user.has_group('account.group_account_manager') for partner in self.filtered('customer'): partner.risk_allow_edit = is_editable diff --git a/partner_financial_risk/tests/test_partner_financial_risk.py b/partner_financial_risk/tests/test_partner_financial_risk.py index 25212ca78..00d227cef 100644 --- a/partner_financial_risk/tests/test_partner_financial_risk.py +++ b/partner_financial_risk/tests/test_partner_financial_risk.py @@ -1,16 +1,18 @@ # -*- coding: utf-8 -*- -# © 2016 Carlos Dauden +# Copyright 2016 Carlos Dauden # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo.tests.common import SavepointCase +from odoo.tests import common from odoo import fields -class TestPartnerFinancialRisk(SavepointCase): +class TestPartnerFinancialRisk(common.SavepointCase): + @classmethod def setUpClass(cls): super(TestPartnerFinancialRisk, cls).setUpClass() - cls.env.user.groups_id |= cls.env.ref('sales_team.group_sale_manager') + cls.env.user.groups_id |= cls.env.ref( + 'account.group_account_manager') cls.partner = cls.env['res.partner'].create({ 'name': 'Partner test', 'customer': True, @@ -55,12 +57,11 @@ class TestPartnerFinancialRisk(SavepointCase): 'account_id': cls.account_customer.id, 'type': 'out_invoice', 'journal_id': cls.journal_sale.id, - 'payment_term_id': False, 'invoice_line_ids': [(0, 0, { 'name': 'Test product', 'account_id': cls.account_sale.id, - 'price_unit': 50, - 'quantity': 10, + 'price_unit': 50.0, + 'quantity': 10.0, 'invoice_line_tax_ids': [(6, 0, [cls.tax.id])], })], }) diff --git a/partner_financial_risk/views/res_partner_view.xml b/partner_financial_risk/views/res_partner_view.xml index 623ee666a..f558a0dd3 100644 --- a/partner_financial_risk/views/res_partner_view.xml +++ b/partner_financial_risk/views/res_partner_view.xml @@ -8,7 +8,7 @@ res.partner - + diff --git a/partner_financial_risk/wizard/partner_risk_exceeded_view.xml b/partner_financial_risk/wizard/partner_risk_exceeded_view.xml index add47714e..bf0955b65 100644 --- a/partner_financial_risk/wizard/partner_risk_exceeded_view.xml +++ b/partner_financial_risk/wizard/partner_risk_exceeded_view.xml @@ -17,7 +17,7 @@ class="oe_highlight" name="button_continue" type="object" - groups="sales_team.group_sale_manager,account.group_account_manager" + groups="account.group_account_manager" />