Browse Source

Merge pull request #455 from Tecnativa/10.0-mig-partner_risk_insurance

[MIG] partner_risk_insurance: Migration to 10.0
pull/590/head
Pedro M. Baeza 7 years ago
committed by GitHub
parent
commit
8cbf6bf897
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 62
      partner_risk_insurance/README.rst
  2. 3
      partner_risk_insurance/__init__.py
  3. 26
      partner_risk_insurance/__manifest__.py
  4. 101
      partner_risk_insurance/i18n/ca.po
  5. 112
      partner_risk_insurance/i18n/es.po
  6. 101
      partner_risk_insurance/i18n/pt.po
  7. 100
      partner_risk_insurance/i18n/pt_BR.po
  8. 101
      partner_risk_insurance/i18n/sl.po
  9. 3
      partner_risk_insurance/models/__init__.py
  10. 46
      partner_risk_insurance/models/partner.py
  11. 3
      partner_risk_insurance/tests/__init__.py
  12. 24
      partner_risk_insurance/tests/test_partner_risk_insurance.py
  13. 28
      partner_risk_insurance/views/res_partner_view.xml

62
partner_risk_insurance/README.rst

@ -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.

3
partner_risk_insurance/__init__.py

@ -0,0 +1,3 @@
# -*- encoding: utf-8 -*-
from . import models

26
partner_risk_insurance/__manifest__.py

@ -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,
}

101
partner_risk_insurance/i18n/ca.po

@ -0,0 +1,101 @@
# 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: Catalan (http://www.transifex.com/oca/odoomrp-wip-8-0/language/ca/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: ca\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èdit concedit per la companyia"
#. module: partner_risk_insurance
#: view:res.partner:partner_risk_insurance.view_partner_form
msgid "Credit Insurance"
msgstr "Assegurança de risc"
#. module: partner_risk_insurance
#: help:res.partner,company_credit_limit:0
msgid "Credit limit granted by the company."
msgstr "Crèdit concedit per la companyia"
#. module: partner_risk_insurance
#: help:res.partner,insurance_credit_limit:0
msgid "Credit limit granted by the insurance company."
msgstr "Crèdit concedit per la companyia asseguradora."
#. module: partner_risk_insurance
#: help:res.partner,risk_insurance_grant_date:0
msgid "Date when the insurance was granted by the insurance company."
msgstr "Data en què es va concedir l'assegurança."
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_code:0
msgid "Insurance Code"
msgstr "Codi de l'assegurança"
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_code_2:0
msgid "Insurance Code 2"
msgstr "Codi de l'assegurança 2"
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_grant_date:0
msgid "Insurance Grant Date"
msgstr "Data de concessió de l'assegurança"
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_requested:0
msgid "Insurance Requested"
msgstr "Assegurança sol·licitada"
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_coverage_percent:0
msgid "Insurance's Credit Coverage"
msgstr "Cobertura de risc de l'assegurança"
#. module: partner_risk_insurance
#: field:res.partner,insurance_credit_limit:0
msgid "Insurance's Credit Limit"
msgstr "Crèdit concedit per l'assegurança"
#. 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 "Marqueu aquest camp si s'ha demanat una assegurança pel crèdit d'aquesta 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 "Percentatge de cobertura del crèdit de l'assegurança."
#. 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 ""

112
partner_risk_insurance/i18n/es.po

@ -0,0 +1,112 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_risk_insurance
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-03 08:18+0000\n"
"PO-Revision-Date: 2017-08-03 10:20+0200\n"
"Last-Translator: Pedro M. Baeza <pedro.baeza@tecnativa.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: partner_risk_insurance
#: model:ir.model.fields,help:partner_risk_insurance.field_res_partner_risk_insurance_code
#: model:ir.model.fields,help:partner_risk_insurance.field_res_users_risk_insurance_code
msgid "Code assigned to this partner by the risk insurance company."
msgstr "Code assigned to this partner by the risk insurance company."
#. module: partner_risk_insurance
#: model:ir.model.fields,field_description:partner_risk_insurance.field_res_partner_company_credit_limit
#: model:ir.model.fields,field_description:partner_risk_insurance.field_res_users_company_credit_limit
msgid "Company's Credit Limit"
msgstr "Límite de crédito de la compañía"
#. module: partner_risk_insurance
#: model:ir.ui.view,arch_db:partner_risk_insurance.view_partner_form
msgid "Credit Insurance"
msgstr "Seguro de riesgo"
#. module: partner_risk_insurance
#: model:ir.model.fields,help:partner_risk_insurance.field_res_partner_company_credit_limit
#: model:ir.model.fields,help:partner_risk_insurance.field_res_users_company_credit_limit
msgid "Credit limit granted by the company."
msgstr "Límite de crédito concedido por la compañía"
#. module: partner_risk_insurance
#: model:ir.model.fields,help:partner_risk_insurance.field_res_partner_insurance_credit_limit
#: model:ir.model.fields,help:partner_risk_insurance.field_res_users_insurance_credit_limit
msgid "Credit limit granted by the insurance company."
msgstr "Crédito concedido por la compañía aseguradora."
#. module: partner_risk_insurance
#: model:ir.model.fields,help:partner_risk_insurance.field_res_partner_risk_insurance_grant_date
#: model:ir.model.fields,help:partner_risk_insurance.field_res_users_risk_insurance_grant_date
msgid "Date when the insurance was granted by the insurance company."
msgstr "Fecha en que se concedió el seguro."
#. module: partner_risk_insurance
#: model:ir.model.fields,field_description:partner_risk_insurance.field_res_partner_risk_insurance_code
#: model:ir.model.fields,field_description:partner_risk_insurance.field_res_users_risk_insurance_code
msgid "Insurance Code"
msgstr "Código del seguro"
#. module: partner_risk_insurance
#: model:ir.model.fields,field_description:partner_risk_insurance.field_res_partner_risk_insurance_code_2
#: model:ir.model.fields,field_description:partner_risk_insurance.field_res_users_risk_insurance_code_2
msgid "Insurance Code 2"
msgstr "Código del seguro 2"
#. module: partner_risk_insurance
#: model:ir.model.fields,field_description:partner_risk_insurance.field_res_partner_risk_insurance_grant_date
#: model:ir.model.fields,field_description:partner_risk_insurance.field_res_users_risk_insurance_grant_date
msgid "Insurance Grant Date"
msgstr "Fecha de concesión del seguro"
#. module: partner_risk_insurance
#: model:ir.model.fields,field_description:partner_risk_insurance.field_res_partner_risk_insurance_requested
#: model:ir.model.fields,field_description:partner_risk_insurance.field_res_users_risk_insurance_requested
msgid "Insurance Requested"
msgstr "Seguro solicitado"
#. module: partner_risk_insurance
#: model:ir.model.fields,field_description:partner_risk_insurance.field_res_partner_risk_insurance_coverage_percent
#: model:ir.model.fields,field_description:partner_risk_insurance.field_res_users_risk_insurance_coverage_percent
msgid "Insurance's Credit Coverage"
msgstr "Cobertura de riesgo del seguro"
#. module: partner_risk_insurance
#: model:ir.model.fields,field_description:partner_risk_insurance.field_res_partner_insurance_credit_limit
#: model:ir.model.fields,field_description:partner_risk_insurance.field_res_users_insurance_credit_limit
msgid "Insurance's Credit Limit"
msgstr "Crédito concedido por el seguro"
#. module: partner_risk_insurance
#: model:ir.model.fields,help:partner_risk_insurance.field_res_partner_risk_insurance_requested
#: model:ir.model.fields,help:partner_risk_insurance.field_res_users_risk_insurance_requested
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 "Empresa"
#. module: partner_risk_insurance
#: model:ir.model.fields,help:partner_risk_insurance.field_res_partner_risk_insurance_coverage_percent
#: model:ir.model.fields,help:partner_risk_insurance.field_res_users_risk_insurance_coverage_percent
msgid "Percentage of the credit covered by the insurance."
msgstr "Porcentaje de crédito cubierto por el seguro."
#. module: partner_risk_insurance
#: model:ir.model.fields,help:partner_risk_insurance.field_res_partner_risk_insurance_code_2
#: model:ir.model.fields,help:partner_risk_insurance.field_res_users_risk_insurance_code_2
msgid "Secondary code assigned to this partner by the risk insurance company."
msgstr "Secondary code assigned to this partner by the risk insurance company."

101
partner_risk_insurance/i18n/pt.po

@ -0,0 +1,101 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_risk_insurance
#
# Translators:
# FIRST AUTHOR <EMAIL@ADDRESS>, 2010
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: Portuguese (http://www.transifex.com/oca/odoomrp-wip-8-0/language/pt/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: pt\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 "Limite de Crédito da Empresa"
#. module: partner_risk_insurance
#: view:res.partner:partner_risk_insurance.view_partner_form
msgid "Credit Insurance"
msgstr "Seguro de Crédito"
#. module: partner_risk_insurance
#: help:res.partner,company_credit_limit:0
msgid "Credit limit granted by the company."
msgstr "Limite de crédito concedido pela empresa."
#. module: partner_risk_insurance
#: help:res.partner,insurance_credit_limit:0
msgid "Credit limit granted by the insurance company."
msgstr "Limite de crédito concedido pela companhia de seguros."
#. module: partner_risk_insurance
#: help:res.partner,risk_insurance_grant_date:0
msgid "Date when the insurance was granted by the insurance company."
msgstr "Data em que o seguro foi concedido pela companhia de seguros."
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_code:0
msgid "Insurance Code"
msgstr "Código de Seguros"
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_code_2:0
msgid "Insurance Code 2"
msgstr "Código de Segurança 2"
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_grant_date:0
msgid "Insurance Grant Date"
msgstr "Data da Concessão do Seguro"
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_requested:0
msgid "Insurance Requested"
msgstr "Seguro Requerido"
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_coverage_percent:0
msgid "Insurance's Credit Coverage"
msgstr "Cobertura do Seguro de Crédito"
#. module: partner_risk_insurance
#: field:res.partner,insurance_credit_limit:0
msgid "Insurance's Credit Limit"
msgstr "Limite do Seguro de Crédito"
#. 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 se o seguro foi solicitado para o crédito deste terceiro."
#. 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 "Percentual do crédito coberto pelo 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 ""

100
partner_risk_insurance/i18n/pt_BR.po

@ -0,0 +1,100 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_risk_insurance
#
# Translators:
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-10-09 03:37+0000\n"
"Last-Translator: danimaribeiro <danimaribeiro@gmail.com>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/odoomrp-wip-8-0/language/pt_BR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: pt_BR\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 ""
#. module: partner_risk_insurance
#: view:res.partner:partner_risk_insurance.view_partner_form
msgid "Credit Insurance"
msgstr ""
#. module: partner_risk_insurance
#: help:res.partner,company_credit_limit:0
msgid "Credit limit granted by the company."
msgstr ""
#. module: partner_risk_insurance
#: help:res.partner,insurance_credit_limit:0
msgid "Credit limit granted by the insurance company."
msgstr ""
#. module: partner_risk_insurance
#: help:res.partner,risk_insurance_grant_date:0
msgid "Date when the insurance was granted by the insurance company."
msgstr ""
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_code:0
msgid "Insurance Code"
msgstr ""
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_code_2:0
msgid "Insurance Code 2"
msgstr ""
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_grant_date:0
msgid "Insurance Grant Date"
msgstr ""
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_requested:0
msgid "Insurance Requested"
msgstr ""
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_coverage_percent:0
msgid "Insurance's Credit Coverage"
msgstr ""
#. module: partner_risk_insurance
#: field:res.partner,insurance_credit_limit:0
msgid "Insurance's Credit Limit"
msgstr ""
#. 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 ""
#. module: partner_risk_insurance
#: model:ir.model,name:partner_risk_insurance.model_res_partner
msgid "Partner"
msgstr "Parceiro"
#. module: partner_risk_insurance
#: help:res.partner,risk_insurance_coverage_percent:0
msgid "Percentage of the credit covered by the insurance."
msgstr ""
#. 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 ""

101
partner_risk_insurance/i18n/sl.po

@ -0,0 +1,101 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_risk_insurance
#
# Translators:
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015
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-20 19:01+0000\n"
"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n"
"Language-Team: Slovenian (http://www.transifex.com/oca/odoomrp-wip-8-0/language/sl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: sl\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
#. module: partner_risk_insurance
#: help:res.partner,risk_insurance_code:0
msgid "Code assigned to this partner by the risk insurance company."
msgstr "Koda, ki jo je partnerju dodelila zavarovalnica za zavarovanje tveganj."
#. module: partner_risk_insurance
#: field:res.partner,company_credit_limit:0
msgid "Company's Credit Limit"
msgstr "Kreditni limit družbe"
#. module: partner_risk_insurance
#: view:res.partner:partner_risk_insurance.view_partner_form
msgid "Credit Insurance"
msgstr "Zavarovanje kredita"
#. module: partner_risk_insurance
#: help:res.partner,company_credit_limit:0
msgid "Credit limit granted by the company."
msgstr "Kreditni limit, ki ga je družba odobrila."
#. module: partner_risk_insurance
#: help:res.partner,insurance_credit_limit:0
msgid "Credit limit granted by the insurance company."
msgstr "Kreditni limit, ki ga je odobrila zavarovalnica."
#. module: partner_risk_insurance
#: help:res.partner,risk_insurance_grant_date:0
msgid "Date when the insurance was granted by the insurance company."
msgstr "Datum, ko je zavarovalnica odobrila zavarovanje."
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_code:0
msgid "Insurance Code"
msgstr "Zavarovalna koda"
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_code_2:0
msgid "Insurance Code 2"
msgstr "Zavarovalna koda 2"
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_grant_date:0
msgid "Insurance Grant Date"
msgstr "Datum odobritve zavarovanja"
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_requested:0
msgid "Insurance Requested"
msgstr "Zavarovanje zahtevano"
#. module: partner_risk_insurance
#: field:res.partner,risk_insurance_coverage_percent:0
msgid "Insurance's Credit Coverage"
msgstr "Zavarovalno kritje kredita"
#. module: partner_risk_insurance
#: field:res.partner,insurance_credit_limit:0
msgid "Insurance's Credit Limit"
msgstr "Kreditni limit zavarovanja"
#. 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 "Označite to polje, če je za kredit tega partnerja zahtevano zavarovanje."
#. module: partner_risk_insurance
#: model:ir.model,name:partner_risk_insurance.model_res_partner
msgid "Partner"
msgstr "Partner"
#. module: partner_risk_insurance
#: help:res.partner,risk_insurance_coverage_percent:0
msgid "Percentage of the credit covered by the insurance."
msgstr "Odstotek kredita, ki ga krije zavarovanje."
#. 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 "Sekundarna koda, ki jo je partnerju dodelila zavarovalnica za zavarovanje tveganj."

3
partner_risk_insurance/models/__init__.py

@ -0,0 +1,3 @@
# -*- encoding: utf-8 -*-
from . import partner

46
partner_risk_insurance/models/partner.py

@ -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)

3
partner_risk_insurance/tests/__init__.py

@ -0,0 +1,3 @@
# -*- encoding: utf-8 -*-
from . import test_partner_risk_insurance

24
partner_risk_insurance/tests/test_partner_risk_insurance.py

@ -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)

28
partner_risk_insurance/views/res_partner_view.xml

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="view_partner_form">
<field name="name">res.partner.form.risk_insurance</field>
<field name="model">res.partner</field>
<field name="type">form</field>
<field name="inherit_id" ref="partner_financial_risk.res_partner_view_risk" />
<field name="arch" type="xml">
<page name="financial_risk" position="inside">
<group name="credit_insurance" string="Credit Insurance">
<group>
<field name="company_credit_limit" />
<field name="insurance_credit_limit" />
<field name="risk_insurance_requested" />
<field name="risk_insurance_grant_date" />
</group>
<group>
<field name="risk_insurance_coverage_percent" />
<field name="risk_insurance_code" />
<field name="risk_insurance_code_2" />
</group>
</group>
</page>
</field>
</record>
</odoo>
Loading…
Cancel
Save