David Vidal
8 years ago
committed by
David
13 changed files with 215 additions and 399 deletions
-
62partner_risk_insurance/README.rst
-
20partner_risk_insurance/__init__.py
-
26partner_risk_insurance/__manifest__.py
-
38partner_risk_insurance/__openerp__.py
-
71partner_risk_insurance/i18n/es.po
-
101partner_risk_insurance/i18n/es_ES.po
-
112partner_risk_insurance/i18n/partner_risk_insurance.pot
-
23partner_risk_insurance/models/__init__.py
-
46partner_risk_insurance/models/partner.py
-
57partner_risk_insurance/models/res_partner.py
-
3partner_risk_insurance/tests/__init__.py
-
24partner_risk_insurance/tests/test_partner_risk_insurance.py
-
31partner_risk_insurance/views/res_partner_view.xml
@ -0,0 +1,62 @@ |
|||||
|
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg |
||||
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
||||
|
:alt: License: AGPL-3 |
||||
|
|
||||
|
====================== |
||||
|
Partner Risk Insurance |
||||
|
====================== |
||||
|
|
||||
|
This module allows to set risk insurance information in the partners. |
||||
|
|
||||
|
Usage |
||||
|
===== |
||||
|
|
||||
|
In the partner page under the *Financial Risk* tab there is a new group called |
||||
|
*Credit Insurance*. |
||||
|
|
||||
|
The partner's credit limit can now be computed according to the sum of two new |
||||
|
fields: **Company's Credit Limit** and **Insurance's Credit Limit**. |
||||
|
|
||||
|
Another insurance info can be registered like: Incurance's Credit Coverage, |
||||
|
Insurance Grant Date or Insurance codes. |
||||
|
|
||||
|
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas |
||||
|
:alt: Try me on Runbot |
||||
|
:target: https://runbot.odoo-community.org/runbot/134/10.0 |
||||
|
|
||||
|
Bug Tracker |
||||
|
=========== |
||||
|
|
||||
|
Bugs are tracked on `GitHub Issues |
||||
|
<https://github.com/OCA/partner-contact/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 |
||||
|
======= |
||||
|
|
||||
|
Images |
||||
|
------ |
||||
|
|
||||
|
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_. |
||||
|
|
||||
|
Contributors |
||||
|
------------ |
||||
|
|
||||
|
* Daniel Campos <danielcampos@avanzosc.es> |
||||
|
* David Vidal <david.vidal@tecnativa.com> |
||||
|
|
||||
|
Maintainer |
||||
|
---------- |
||||
|
|
||||
|
.. image:: https://odoo-community.org/logo.png |
||||
|
:alt: Odoo Community Association |
||||
|
: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 https://odoo-community.org. |
@ -1,23 +1,3 @@ |
|||||
# -*- encoding: utf-8 -*- |
# -*- encoding: utf-8 -*- |
||||
############################################################################## |
|
||||
# |
|
||||
# OpenERP, Open Source Management Solution |
|
||||
# Copyright (C) 2009 Albert Cervera i Areny (http://www.nan-tic.com). |
|
||||
# Copyright (c) 2014 Factor Libre SL. |
|
||||
# |
|
||||
# This program is free software: you can redistribute it and/or modify |
|
||||
# it under the terms of the GNU General Public License as published by |
|
||||
# the Free Software Foundation, either version 3 of the License, or |
|
||||
# (at your option) any later version. |
|
||||
# |
|
||||
# This program is distributed in the hope that it will be useful, |
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
# GNU General Public License for more details. |
|
||||
# |
|
||||
# You should have received a copy of the GNU General Public License |
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||
# |
|
||||
############################################################################## |
|
||||
|
|
||||
from . import models |
from . import models |
@ -0,0 +1,26 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Copyright 2009 NaN·tic - Albert Cervera |
||||
|
# Copyright 2014 Factor Libre S.L. |
||||
|
# Copyright 2014 AvancOSC - Daniel Campos |
||||
|
# Copyright 2017 Tecnativa - David Vidal |
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
{ |
||||
|
'name': 'Partner Risk Insurance', |
||||
|
'version': '10.0.1.0.0', |
||||
|
'category': 'Sales Management', |
||||
|
'summary': 'Lets set risk insurance info in the partners', |
||||
|
'author': 'AvanzOSC,' |
||||
|
'Factor Libre S.L,' |
||||
|
'NaN·tic,' |
||||
|
'Tecnativa,' |
||||
|
'Odoo Community Association (OCA)', |
||||
|
'website': 'https://github.com/OCA/partner-contact', |
||||
|
'license': 'AGPL-3', |
||||
|
'depends': [ |
||||
|
'partner_financial_risk', |
||||
|
], |
||||
|
'data': [ |
||||
|
'views/res_partner_view.xml', |
||||
|
], |
||||
|
'installable': True, |
||||
|
} |
@ -1,38 +0,0 @@ |
|||||
# -*- encoding: utf-8 -*- |
|
||||
############################################################################## |
|
||||
# |
|
||||
# This program is free software: you can redistribute it and/or modify |
|
||||
# it under the terms of the GNU Affero General Public License as published |
|
||||
# by the Free Software Foundation, either version 3 of the License, or |
|
||||
# (at your option) any later version. |
|
||||
# |
|
||||
# This program is distributed in the hope that it will be useful, |
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
# GNU General Public License for more details. |
|
||||
# |
|
||||
# You should have received a copy of the GNU General Public License |
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/. |
|
||||
# |
|
||||
############################################################################## |
|
||||
|
|
||||
{ |
|
||||
"name": "Partner Risk Insurance", |
|
||||
"version": "1.0", |
|
||||
"description": """ |
|
||||
This module adds a new tab in the partner form to introduce risk insurance |
|
||||
information. |
|
||||
""", |
|
||||
"author": "OdooMRP team," |
|
||||
"AvanzOSC," |
|
||||
"Serv. Tecnol. Avanzados - Pedro M. Baeza," |
|
||||
"Factor Libre S.L," |
|
||||
"NaN·tic", |
|
||||
'contributors': ["Daniel Campos <danielcampos@avanzosc.es>"], |
|
||||
"website": "http://www.factorlibre.com", |
|
||||
"depends": [], |
|
||||
"category": "Custom Modules", |
|
||||
"data": ['views/res_partner_view.xml'], |
|
||||
"active": False, |
|
||||
"installable": True |
|
||||
} |
|
@ -1,101 +0,0 @@ |
|||||
# Translation of Odoo Server. |
|
||||
# This file contains the translation of the following modules: |
|
||||
# * partner_risk_insurance |
|
||||
# |
|
||||
# Translators: |
|
||||
# Albert Cervera i Areny <albert@nan-tic.com>, 2009 |
|
||||
msgid "" |
|
||||
msgstr "" |
|
||||
"Project-Id-Version: odoomrp-wip (8.0)\n" |
|
||||
"Report-Msgid-Bugs-To: \n" |
|
||||
"POT-Creation-Date: 2015-10-07 10:44+0000\n" |
|
||||
"PO-Revision-Date: 2015-09-10 16:43+0000\n" |
|
||||
"Last-Translator: OCA Transbot <transbot@odoo-community.org>\n" |
|
||||
"Language-Team: Spanish (Spain) (http://www.transifex.com/oca/odoomrp-wip-8-0/language/es_ES/)\n" |
|
||||
"MIME-Version: 1.0\n" |
|
||||
"Content-Type: text/plain; charset=UTF-8\n" |
|
||||
"Content-Transfer-Encoding: \n" |
|
||||
"Language: es_ES\n" |
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: help:res.partner,risk_insurance_code:0 |
|
||||
msgid "Code assigned to this partner by the risk insurance company." |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: field:res.partner,company_credit_limit:0 |
|
||||
msgid "Company's Credit Limit" |
|
||||
msgstr "Crédito concedido por la companyía" |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: view:res.partner:partner_risk_insurance.view_partner_form |
|
||||
msgid "Credit Insurance" |
|
||||
msgstr "Seguro de riesgo" |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: help:res.partner,company_credit_limit:0 |
|
||||
msgid "Credit limit granted by the company." |
|
||||
msgstr "Crédito concedido por la companyía." |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: help:res.partner,insurance_credit_limit:0 |
|
||||
msgid "Credit limit granted by the insurance company." |
|
||||
msgstr "Crédito concedido por la compañía aseguradora." |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: help:res.partner,risk_insurance_grant_date:0 |
|
||||
msgid "Date when the insurance was granted by the insurance company." |
|
||||
msgstr "Fecha en que se concedió el seguro." |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: field:res.partner,risk_insurance_code:0 |
|
||||
msgid "Insurance Code" |
|
||||
msgstr "Código del seguro" |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: field:res.partner,risk_insurance_code_2:0 |
|
||||
msgid "Insurance Code 2" |
|
||||
msgstr "Código del seguro 2" |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: field:res.partner,risk_insurance_grant_date:0 |
|
||||
msgid "Insurance Grant Date" |
|
||||
msgstr "Fecha de concesión del seguro" |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: field:res.partner,risk_insurance_requested:0 |
|
||||
msgid "Insurance Requested" |
|
||||
msgstr "Seguro solicitado" |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: field:res.partner,risk_insurance_coverage_percent:0 |
|
||||
msgid "Insurance's Credit Coverage" |
|
||||
msgstr "Cobertura de riesgo del seguro" |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: field:res.partner,insurance_credit_limit:0 |
|
||||
msgid "Insurance's Credit Limit" |
|
||||
msgstr "Crédito concedido por el seguro" |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: help:res.partner,risk_insurance_requested:0 |
|
||||
msgid "" |
|
||||
"Mark this field if an insurance was requested for the credit of this " |
|
||||
"partner." |
|
||||
msgstr "Marque este campo si se ha pedido un seguro para el crédito de esta empresa." |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: model:ir.model,name:partner_risk_insurance.model_res_partner |
|
||||
msgid "Partner" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: help:res.partner,risk_insurance_coverage_percent:0 |
|
||||
msgid "Percentage of the credit covered by the insurance." |
|
||||
msgstr "Porcentage de crédito cubierto por el seguro." |
|
||||
|
|
||||
#. module: partner_risk_insurance |
|
||||
#: help:res.partner,risk_insurance_code_2:0 |
|
||||
msgid "Secondary code assigned to this partner by the risk insurance company." |
|
||||
msgstr "" |
|
@ -1,112 +0,0 @@ |
|||||
# Translation of OpenERP Server. |
|
||||
# This file contains the translation of the following modules: |
|
||||
# * nan_partner_risk_insurance |
|
||||
# |
|
||||
msgid "" |
|
||||
msgstr "" |
|
||||
"Project-Id-Version: OpenERP Server 5.0.6\n" |
|
||||
"Report-Msgid-Bugs-To: support@openerp.com\n" |
|
||||
"POT-Creation-Date: 2009-09-23 18:14:48+0000\n" |
|
||||
"PO-Revision-Date: 2009-09-23 18:14:48+0000\n" |
|
||||
"Last-Translator: <>\n" |
|
||||
"Language-Team: \n" |
|
||||
"MIME-Version: 1.0\n" |
|
||||
"Content-Type: text/plain; charset=UTF-8\n" |
|
||||
"Content-Transfer-Encoding: \n" |
|
||||
"Plural-Forms: \n" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: field:res.partner,risk_insurance_code_2:0 |
|
||||
msgid "Insurance Code 2" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: constraint:ir.ui.view:0 |
|
||||
msgid "Invalid XML for View Architecture!" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: help:res.partner,company_credit_limit:0 |
|
||||
msgid "Credit limit granted by the company." |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: field:res.partner,risk_insurance_code:0 |
|
||||
msgid "Insurance Code" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: field:res.partner,company_credit_limit:0 |
|
||||
msgid "Company's Credit Limit" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: help:res.partner,risk_insurance_requested:0 |
|
||||
msgid "Mark this field if an insurance was requested for the credit of this partner." |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: help:res.partner,risk_insurance_coverage_percent:0 |
|
||||
msgid "Percentage of the credit covered by the insurance." |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: field:res.partner,risk_insurance_grant_date:0 |
|
||||
msgid "Insurance Grant Date" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: field:res.partner,insurance_credit_limit:0 |
|
||||
msgid "Insurance's Credit Limit" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: field:res.partner,risk_insurance_requested:0 |
|
||||
msgid "Insurance Requested" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: help:res.partner,risk_insurance_grant_date:0 |
|
||||
msgid "Date when the insurance was granted by the insurance company." |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: help:res.partner,risk_insurance_code_2:0 |
|
||||
msgid "This fields is needed because some risk insurance companies require a supplementary code for each partner." |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: view:res.partner:0 |
|
||||
msgid "Credit Insurance" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: help:res.partner,risk_insurance_code:0 |
|
||||
msgid "This fields is used to store the code the risk insurance company assigns to this partner." |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: view:res.partner:0 |
|
||||
msgid "Accounting" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: help:res.partner,insurance_credit_limit:0 |
|
||||
msgid "Credit limit granted by the insurance company." |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: field:res.partner,risk_insurance_coverage_percent:0 |
|
||||
msgid "Insurance's Credit Coverage" |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: model:ir.module.module,description:nan_partner_risk_insurance.module_meta_information |
|
||||
msgid "This module adds a new tab in the partner form to introduce risk insurance information." |
|
||||
msgstr "" |
|
||||
|
|
||||
#. module: nan_partner_risk_insurance |
|
||||
#: model:ir.module.module,shortdesc:nan_partner_risk_insurance.module_meta_information |
|
||||
msgid "Partner Risk Insurance" |
|
||||
msgstr "" |
|
||||
|
|
@ -1,24 +1,3 @@ |
|||||
# -*- encoding: utf-8 -*- |
# -*- encoding: utf-8 -*- |
||||
############################################################################## |
|
||||
# |
|
||||
# OpenERP, Open Source Management Solution |
|
||||
# Copyright (C) 2009 Albert Cervera i Areny (http://www.nan-tic.com). |
|
||||
# All Rights Reserved |
|
||||
# Copyright (c) 2014 Factor Libre SL. All Rights Reserved |
|
||||
# |
|
||||
# This program is free software: you can redistribute it and/or modify |
|
||||
# it under the terms of the GNU General Public License as published by |
|
||||
# the Free Software Foundation, either version 3 of the License, or |
|
||||
# (at your option) any later version. |
|
||||
# |
|
||||
# This program is distributed in the hope that it will be useful, |
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
# GNU General Public License for more details. |
|
||||
# |
|
||||
# You should have received a copy of the GNU General Public License |
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
||||
# |
|
||||
############################################################################## |
|
||||
|
|
||||
from . import res_partner |
|
||||
|
from . import partner |
@ -0,0 +1,46 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Copyright 2014 AvancOSC - Daniel Campos |
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
|
||||
|
from odoo import api, fields, models |
||||
|
|
||||
|
|
||||
|
class Partner(models.Model): |
||||
|
_inherit = 'res.partner' |
||||
|
|
||||
|
company_credit_limit = fields.Float( |
||||
|
string='Company\'s Credit Limit', |
||||
|
help='Credit limit granted by the company.', |
||||
|
) |
||||
|
insurance_credit_limit = fields.Float( |
||||
|
string='Insurance\'s Credit Limit', |
||||
|
help='Credit limit granted by the insurance company.', |
||||
|
) |
||||
|
risk_insurance_coverage_percent = fields.Float( |
||||
|
string='Insurance\'s Credit Coverage', |
||||
|
help='Percentage of the credit covered by the insurance.', |
||||
|
) |
||||
|
risk_insurance_requested = fields.Boolean( |
||||
|
string='Insurance Requested', |
||||
|
help='Mark this field if an insurance was requested for the credit of ' |
||||
|
'this partner.', |
||||
|
) |
||||
|
risk_insurance_grant_date = fields.Date( |
||||
|
string='Insurance Grant Date', |
||||
|
help='Date when the insurance was granted by the insurance company.', |
||||
|
) |
||||
|
risk_insurance_code = fields.Char( |
||||
|
string='Insurance Code', |
||||
|
help='Code assigned to this partner by the risk insurance company.', |
||||
|
) |
||||
|
risk_insurance_code_2 = fields.Char( |
||||
|
string='Insurance Code 2', |
||||
|
help='Secondary code assigned to this partner by the risk insurance ' |
||||
|
'company.', |
||||
|
) |
||||
|
|
||||
|
@api.onchange('insurance_credit_limit', 'company_credit_limit') |
||||
|
def _onchage_insurance_credit_limit(self): |
||||
|
self.ensure_one() |
||||
|
self.credit_limit = (self.insurance_credit_limit + |
||||
|
self.company_credit_limit) |
@ -1,57 +0,0 @@ |
|||||
|
|
||||
# -*- encoding: utf-8 -*- |
|
||||
############################################################################## |
|
||||
# |
|
||||
# This program is free software: you can redistribute it and/or modify |
|
||||
# it under the terms of the GNU Affero General Public License as published |
|
||||
# by the Free Software Foundation, either version 3 of the License, or |
|
||||
# (at your option) any later version. |
|
||||
# |
|
||||
# This program is distributed in the hope that it will be useful, |
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
||||
# GNU General Public License for more details. |
|
||||
# |
|
||||
# You should have received a copy of the GNU General Public License |
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/. |
|
||||
# |
|
||||
############################################################################## |
|
||||
|
|
||||
|
|
||||
from openerp import models, fields, api |
|
||||
|
|
||||
|
|
||||
class ResPartner(models.Model): |
|
||||
_inherit = 'res.partner' |
|
||||
|
|
||||
@api.one |
|
||||
@api.depends('company_credit_limit', 'insurance_credit_limit') |
|
||||
def _credit_limit(self): |
|
||||
self.credit_limit = (self.company_credit_limit + |
|
||||
self.insurance_credit_limit) |
|
||||
|
|
||||
credit_limit = fields.Float('Credit Limit', store=True, |
|
||||
compute=_credit_limit) |
|
||||
company_credit_limit = fields.Float("Company's Credit Limit", |
|
||||
help='Credit limit granted by the ' |
|
||||
'company.') |
|
||||
insurance_credit_limit = fields.Float("Insurance's Credit Limit", |
|
||||
help='Credit limit granted by the ' |
|
||||
'insurance company.') |
|
||||
risk_insurance_coverage_percent = fields.Float( |
|
||||
"Insurance's Credit Coverage", help='Percentage of the credit covered ' |
|
||||
'by the insurance.') |
|
||||
risk_insurance_requested = fields.Boolean( |
|
||||
'Insurance Requested', help='Mark this field if an insurance was ' |
|
||||
'requested for the credit of this partner.') |
|
||||
risk_insurance_grant_date = fields.Date('Insurance Grant Date', |
|
||||
help='Date when the insurance was ' |
|
||||
'granted by the insurance company.' |
|
||||
) |
|
||||
risk_insurance_code = fields.Char('Insurance Code', |
|
||||
help='Code assigned to this partner by ' |
|
||||
'the risk insurance company.') |
|
||||
risk_insurance_code_2 = fields.Char('Insurance Code 2', |
|
||||
help='Secondary code assigned to this ' |
|
||||
'partner by the risk insurance ' |
|
||||
'company.') |
|
@ -0,0 +1,3 @@ |
|||||
|
# -*- encoding: utf-8 -*- |
||||
|
|
||||
|
from . import test_partner_risk_insurance |
@ -0,0 +1,24 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# Copyright 2017 Tecnativa - David Vidal |
||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
|
||||
|
from odoo.tests import common |
||||
|
|
||||
|
|
||||
|
class TestPartnerRiskInsurance(common.SavepointCase): |
||||
|
|
||||
|
@classmethod |
||||
|
def setUpClass(cls): |
||||
|
super(TestPartnerRiskInsurance, cls).setUpClass() |
||||
|
cls.partner = cls.env['res.partner'].create({ |
||||
|
'name': 'Mr. Odoo', |
||||
|
}) |
||||
|
|
||||
|
def test_compute_credit(self): |
||||
|
self.partner.company_credit_limit = 1000.0 |
||||
|
self.partner.insurance_credit_limit = 3000.0 |
||||
|
self.partner._onchage_insurance_credit_limit() |
||||
|
self.assertEqual(self.partner.credit_limit, 4000.0) |
||||
|
# Set credit limit manually: |
||||
|
self.partner.credit_limit = 1500.0 |
||||
|
self.assertEqual(self.partner.credit_limit, 1500.0) |
@ -1,35 +1,28 @@ |
|||||
<?xml version="1.0"?> |
|
||||
<openerp> |
|
||||
<data> |
|
||||
<!--Add risk insurance tab in partner form. --> |
|
||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
|
||||
<record model="ir.ui.view" id="view_partner_form"> |
<record model="ir.ui.view" id="view_partner_form"> |
||||
<field name="name">res.partner.form.risk_insurance</field> |
<field name="name">res.partner.form.risk_insurance</field> |
||||
<field name="model">res.partner</field> |
<field name="model">res.partner</field> |
||||
<field name="type">form</field> |
<field name="type">form</field> |
||||
<field name="inherit_id" ref="base.view_partner_form" /> |
|
||||
|
<field name="inherit_id" ref="partner_financial_risk.res_partner_view_risk" /> |
||||
<field name="arch" type="xml"> |
<field name="arch" type="xml"> |
||||
<notebook position="inside"> |
|
||||
<page string="Credit Insurance"> |
|
||||
|
<page name="financial_risk" position="inside"> |
||||
|
<group name="credit_insurance" string="Credit Insurance"> |
||||
<group> |
<group> |
||||
<group> |
|
||||
<field name="company_credit_limit" /> |
<field name="company_credit_limit" /> |
||||
<field name="insurance_credit_limit" /> |
<field name="insurance_credit_limit" /> |
||||
</group> |
|
||||
<group> |
|
||||
<field name="risk_insurance_requested" /> |
<field name="risk_insurance_requested" /> |
||||
<field name="risk_insurance_grant_date" /> |
<field name="risk_insurance_grant_date" /> |
||||
</group> |
|
||||
<group> |
|
||||
|
</group> |
||||
|
<group> |
||||
<field name="risk_insurance_coverage_percent" /> |
<field name="risk_insurance_coverage_percent" /> |
||||
</group> |
|
||||
<group> |
|
||||
<field name="risk_insurance_code" /> |
<field name="risk_insurance_code" /> |
||||
<field name="risk_insurance_code_2" /> |
<field name="risk_insurance_code_2" /> |
||||
</group> |
|
||||
</group> |
</group> |
||||
</page> |
|
||||
</notebook> |
|
||||
|
</group> |
||||
|
</page> |
||||
</field> |
</field> |
||||
</record> |
</record> |
||||
</data> |
|
||||
</openerp> |
|
||||
|
|
||||
|
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue