Browse Source

Prepare module for OCA.

This means:

- Add proper README.
- Use new-style copyright & license headers.
- Update translation.
- Remove .pot.
- Drop CRM dependency.
- Move fields into Sales & Purchases tab.
- Rename some fields.
- Probably something more.
pull/224/head
Jairo Llopis 9 years ago
parent
commit
ee698418a2
  1. 82
      partner_capital/README.rst
  2. 9
      partner_capital/__init__.py
  3. 31
      partner_capital/__openerp__.py
  4. 155
      partner_capital/i18n/crm_capital.pot
  5. 146
      partner_capital/i18n/es.po
  6. 16
      partner_capital/models/__init__.py
  7. 37
      partner_capital/models/crm_lead.py
  8. 12
      partner_capital/models/crm_turnover_range.py
  9. 25
      partner_capital/models/res_partner.py
  10. 14
      partner_capital/models/res_partner_turnover_range.py
  11. 8
      partner_capital/security/ir.model.access.csv
  12. 78
      partner_capital/views/crm_lead_view.xml
  13. 29
      partner_capital/views/crm_turnover_range_view.xml
  14. 33
      partner_capital/views/res_partner_turnover_range_view.xml
  15. 34
      partner_capital/views/res_partner_view.xml

82
partner_capital/README.rst

@ -1,18 +1,82 @@
Capital in CRM
================
.. 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
This module allows to set capital country, capital registered and turnover
for companies in the CRM main objects (lead, opportunity, partner), and
propagate them through the workflow.
===============
Partners Capital
===============
By capital country we mean country of origin of the capital of the company
By capital registered we mean the amount of money registered in comercial
registry, aka social capital or just capital of a company
By turnover we can define a range an a concret amount
This module extends the functionality of partners to support setting capital
country, registered capital amount and turnover.
By capital country we mean country of origin of the capital of the company.
By registered capital amount we mean the amount of money registered in the
corresponding commercial registry, A.K.A. social capital or just capital of a
company.
By turnover we can define a range for a concrete amount.
Usage
=====
To use this module, you need to:
* Go to any partner's form.
* You will find the new fields in *Sales & Purchases > Capital*.
To manage turnover ranges, you need to:
* Go to *Sales > Configuration > Address Book > Turnover ranges*.
.. 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/8.0
Known issues / Roadmap
======================
* Add automatic rules to calculate turnover range and company size.
* Allow customization of company sizes.
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 smashing it by providing a detailed and welcomed `feedback
<https://github.com/OCA/
partner-contact/issues/new?body=module:%20
partner_capital%0Aversion:%20
8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits
=======
Images
------
* `Antiun Ingeniería S.L. <http://www.antiun.com>`_: Icon.
Contributors
------------
* Antonio Espinosa <antonioea@antiun.com>
* Rafael Blasco <rafabn@antiun.com>
* Jairo Llopis <yajo.sk8@gmail.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.

9
partner_capital/__init__.py

@ -1,6 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com)
# Antonio Espinosa <antonioea@antiun.com>
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models

31
partner_capital/__openerp__.py

@ -1,37 +1,20 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Odoo Source Management Solution
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com)
# Antonio Espinosa <antonioea@antiun.com>
#
# 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Capital in CRM',
'version': '1.0',
'name': 'Partners Capital',
'version': '8.0.1.0.0',
'category': 'Customer Relationship Management',
'author': 'Antiun Ingeniería S.L.',
'website': 'http://www.antiun.com',
'depends': [
'crm',
'base',
],
'data': [
'views/crm_turnover_range_view.xml',
'views/crm_lead_view.xml',
'views/res_partner_turnover_range_view.xml',
'views/res_partner_view.xml',
'security/ir.model.access.csv',
],

155
partner_capital/i18n/crm_capital.pot

@ -1,155 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_capital
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-26 15:15+0000\n"
"PO-Revision-Date: 2015-05-26 15:15+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: crm_capital
#: selection:crm.lead,company_size:0
#: selection:res.partner,company_size:0
msgid "Big"
msgstr ""
#. module: crm_capital
#: view:crm.lead:crm_capital.crm_case_form_view_leads_capital
#: view:crm.lead:crm_capital.crm_case_form_view_oppor_capital
#: view:crm.lead:crm_capital.view_crm_case_leads_filter_capital
#: view:crm.lead:crm_capital.view_crm_case_opportunities_filter_capital
#: field:crm.lead,capital_country:0
#: view:res.partner:crm_capital.view_partner_form_capital
#: view:res.partner:crm_capital.view_res_partner_filter_capital
#: field:res.partner,capital_country:0
msgid "Capital country"
msgstr ""
#. module: crm_capital
#: field:crm.lead,capital_registered:0
#: field:res.partner,capital_registered:0
msgid "Capital registered"
msgstr ""
#. module: crm_capital
#: view:crm.lead:crm_capital.view_crm_case_leads_filter_capital
#: view:crm.lead:crm_capital.view_crm_case_opportunities_filter_capital
#: field:crm.lead,company_size:0
#: view:res.partner:crm_capital.view_res_partner_filter_capital
#: field:res.partner,company_size:0
msgid "Company size"
msgstr ""
#. module: crm_capital
#: help:crm.lead,capital_country:0
#: help:res.partner,capital_country:0
msgid "Country of origin of the capital of this company"
msgstr ""
#. module: crm_capital
#: field:crm.turnover_range,create_uid:0
msgid "Created by"
msgstr ""
#. module: crm_capital
#: field:crm.turnover_range,create_date:0
msgid "Created on"
msgstr ""
#. module: crm_capital
#: field:crm.turnover_range,id:0
msgid "ID"
msgstr ""
#. module: crm_capital
#: field:crm.turnover_range,write_uid:0
msgid "Last Updated by"
msgstr ""
#. module: crm_capital
#: field:crm.turnover_range,write_date:0
msgid "Last Updated on"
msgstr ""
#. module: crm_capital
#: model:ir.model,name:crm_capital.model_crm_lead
msgid "Lead/Opportunity"
msgstr ""
#. module: crm_capital
#: selection:crm.lead,company_size:0
#: selection:res.partner,company_size:0
msgid "Medium"
msgstr ""
#. module: crm_capital
#: selection:crm.lead,company_size:0
#: selection:res.partner,company_size:0
msgid "Micro"
msgstr ""
#. module: crm_capital
#: field:crm.turnover_range,name:0
msgid "Name"
msgstr ""
#. module: crm_capital
#: model:ir.model,name:crm_capital.model_res_partner
msgid "Partner"
msgstr ""
#. module: crm_capital
#: view:crm.lead:crm_capital.view_crm_case_leads_filter_capital
#: view:crm.lead:crm_capital.view_crm_case_opportunities_filter_capital
msgid "Sales Team"
msgstr ""
#. module: crm_capital
#: view:res.partner:crm_capital.view_res_partner_filter_capital
msgid "Salesperson"
msgstr ""
#. module: crm_capital
#: selection:crm.lead,company_size:0
#: selection:res.partner,company_size:0
msgid "Small"
msgstr ""
#. module: crm_capital
#: view:crm.lead:crm_capital.view_crm_case_leads_filter_capital
#: view:crm.lead:crm_capital.view_crm_case_opportunities_filter_capital
#: view:res.partner:crm_capital.view_res_partner_filter_capital
msgid "Turnover"
msgstr ""
#. module: crm_capital
#: field:crm.lead,turnover_number:0
#: field:res.partner,turnover_number:0
msgid "Turnover number"
msgstr ""
#. module: crm_capital
#: view:crm.lead:crm_capital.crm_case_form_view_leads_capital
#: view:crm.lead:crm_capital.crm_case_form_view_oppor_capital
#: field:crm.lead,turnover_range:0
#: model:ir.model,name:crm_capital.model_crm_turnover_range
#: view:res.partner:crm_capital.view_partner_form_capital
#: field:res.partner,turnover_range:0
msgid "Turnover range"
msgstr ""
#. module: crm_capital
#: view:crm.turnover_range:crm_capital.crm_turnover_range_tree_view
#: model:ir.actions.act_window,name:crm_capital.crm_turnover_range_action
#: model:ir.ui.menu,name:crm_capital.menu_crm_turnover_range
msgid "Turnover ranges"
msgstr ""

146
partner_capital/i18n/es.po

@ -1,155 +1,133 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * crm_capital
# * partner_capital
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-26 15:15+0000\n"
"PO-Revision-Date: 2015-05-26 15:15+0000\n"
"POT-Creation-Date: 2015-12-16 17:27+0000\n"
"PO-Revision-Date: 2015-12-16 18:29+0100\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"Language: es\n"
"X-Generator: Poedit 1.8.5\n"
#. module: crm_capital
#: selection:crm.lead,company_size:0
#. module: partner_capital
#: selection:res.partner,company_size:0
msgid "Big"
msgstr "Grande"
#. module: crm_capital
#: view:crm.lead:crm_capital.crm_case_form_view_leads_capital
#: view:crm.lead:crm_capital.crm_case_form_view_oppor_capital
#: view:crm.lead:crm_capital.view_crm_case_leads_filter_capital
#: view:crm.lead:crm_capital.view_crm_case_opportunities_filter_capital
#: field:crm.lead,capital_country:0
#: view:res.partner:crm_capital.view_partner_form_capital
#: view:res.partner:crm_capital.view_res_partner_filter_capital
#. module: partner_capital
#: view:res.partner:partner_capital.view_partner_form_capital
msgid "Capital"
msgstr "Capital"
#. module: partner_capital
#: field:res.partner,capital_amount:0
msgid "Capital amount"
msgstr "Capital amount"
#. module: partner_capital
#: view:res.partner:partner_capital.view_res_partner_filter_capital
#: field:res.partner,capital_country:0
msgid "Capital country"
msgstr "Nacionalidad del capital"
#. module: crm_capital
#: field:crm.lead,capital_registered:0
#: field:res.partner,capital_registered:0
msgid "Capital registered"
msgstr "Capital social"
#. module: crm_capital
#: view:crm.lead:crm_capital.view_crm_case_leads_filter_capital
#: view:crm.lead:crm_capital.view_crm_case_opportunities_filter_capital
#: field:crm.lead,company_size:0
#: view:res.partner:crm_capital.view_res_partner_filter_capital
#. module: partner_capital
#: view:res.partner:partner_capital.view_res_partner_filter_capital
#: field:res.partner,company_size:0
msgid "Company size"
msgstr "Tamaño de la companía"
#. module: crm_capital
#: help:crm.lead,capital_country:0
#. module: partner_capital
#: help:res.partner,capital_country:0
msgid "Country of origin of the capital of this company"
msgstr "País de origen del capital social de esta empresa"
msgid "Country of origin of this company's capital."
msgstr "País de origen del capital de esta empresa."
#. module: crm_capital
#: field:crm.turnover_range,create_uid:0
#. module: partner_capital
#: field:res.partner.turnover_range,create_uid:0
msgid "Created by"
msgstr "Creado por"
#. module: crm_capital
#: field:crm.turnover_range,create_date:0
#. module: partner_capital
#: field:res.partner.turnover_range,create_date:0
msgid "Created on"
msgstr "Creado en"
#. module: crm_capital
#: field:crm.turnover_range,id:0
#. module: partner_capital
#: field:res.partner.turnover_range,id:0
msgid "ID"
msgstr "ID"
#. module: crm_capital
#: field:crm.turnover_range,write_uid:0
#. module: partner_capital
#: field:res.partner.turnover_range,write_uid:0
msgid "Last Updated by"
msgstr "Última actualización por"
#. module: crm_capital
#: field:crm.turnover_range,write_date:0
#. module: partner_capital
#: field:res.partner.turnover_range,write_date:0
msgid "Last Updated on"
msgstr "última actualización en"
#. module: crm_capital
#: model:ir.model,name:crm_capital.model_crm_lead
msgid "Lead/Opportunity"
msgstr "Iniciativa/Oportunidad"
msgstr "Última actualización en"
#. module: crm_capital
#: selection:crm.lead,company_size:0
#. module: partner_capital
#: selection:res.partner,company_size:0
msgid "Medium"
msgstr "Medio"
#. module: crm_capital
#: selection:crm.lead,company_size:0
#. module: partner_capital
#: selection:res.partner,company_size:0
msgid "Micro"
msgstr "Micro"
#. module: crm_capital
#: field:crm.turnover_range,name:0
#. module: partner_capital
#: field:res.partner.turnover_range,name:0
msgid "Name"
msgstr "Nombre"
#. module: crm_capital
#: model:ir.model,name:crm_capital.model_res_partner
#. module: partner_capital
#: model:ir.model,name:partner_capital.model_res_partner
msgid "Partner"
msgstr "Empresa"
#. module: crm_capital
#: view:crm.lead:crm_capital.view_crm_case_leads_filter_capital
#: view:crm.lead:crm_capital.view_crm_case_opportunities_filter_capital
msgid "Sales Team"
msgstr "Equipo de ventas"
#. module: partner_capital
#: help:res.partner,capital_amount:0
msgid "Publicly registered capital amount."
msgstr "Importe del capital públicamente registrado."
#. module: crm_capital
#: view:res.partner:crm_capital.view_res_partner_filter_capital
#. module: partner_capital
#: view:res.partner:partner_capital.view_res_partner_filter_capital
msgid "Salesperson"
msgstr "Comercial"
#. module: crm_capital
#: selection:crm.lead,company_size:0
#. module: partner_capital
#: selection:res.partner,company_size:0
msgid "Small"
msgstr "Pequeño"
#. module: crm_capital
#: view:crm.lead:crm_capital.view_crm_case_leads_filter_capital
#: view:crm.lead:crm_capital.view_crm_case_opportunities_filter_capital
#: view:res.partner:crm_capital.view_res_partner_filter_capital
#. module: partner_capital
#: view:res.partner:partner_capital.view_res_partner_filter_capital
msgid "Turnover"
msgstr "Facturación"
#. module: crm_capital
#: field:crm.lead,turnover_number:0
#: field:res.partner,turnover_number:0
msgid "Turnover number"
msgstr "Número de facturación"
#. module: crm_capital
#: view:crm.lead:crm_capital.crm_case_form_view_leads_capital
#: view:crm.lead:crm_capital.crm_case_form_view_oppor_capital
#: field:crm.lead,turnover_range:0
#: model:ir.model,name:crm_capital.model_crm_turnover_range
#: view:res.partner:crm_capital.view_partner_form_capital
#: field:res.partner,turnover_range:0
#. module: partner_capital
#: field:res.partner,turnover_amount:0
msgid "Turnover amount"
msgstr "Cantidad de facturación"
#. module: partner_capital
#: model:ir.model,name:partner_capital.model_res_partner_turnover_range
#: field:res.partner,turnover_range_id:0
msgid "Turnover range"
msgstr "Rango de facturación"
#. module: crm_capital
#: view:crm.turnover_range:crm_capital.crm_turnover_range_tree_view
#: model:ir.actions.act_window,name:crm_capital.crm_turnover_range_action
#: model:ir.ui.menu,name:crm_capital.menu_crm_turnover_range
#. module: partner_capital
#: model:ir.actions.act_window,name:partner_capital.res_partner_turnover_range_action
#: model:ir.ui.menu,name:partner_capital.menu_res_partner_turnover_range
#: view:res.partner.turnover_range:partner_capital.res_partner_turnover_range_tree_view
msgid "Turnover ranges"
msgstr "Rangos de facturación"

16
partner_capital/models/__init__.py

@ -1,8 +1,10 @@
# -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com)
# Antonio Espinosa <antonioea@antiun.com>
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import crm_turnover_range
from . import crm_lead
from . import res_partner
from . import (
res_partner_turnover_range,
res_partner,
)

37
partner_capital/models/crm_lead.py

@ -1,37 +0,0 @@
# -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields
class CrmLead(models.Model):
_inherit = 'crm.lead'
capital_country = fields.Many2one(
'res.country', string="Capital country",
help="Country of origin of the capital of this company")
capital_registered = fields.Integer(string="Capital registered")
turnover_range = fields.Many2one(comodel_name='crm.turnover_range')
turnover_number = fields.Integer()
company_size = fields.Selection(
string="Company size",
selection=[('micro', 'Micro'), ('small', 'Small'),
('medium', 'Medium'), ('big', 'Big')])
def _lead_create_contact(self, cr, uid, lead, name, is_company,
parent_id=False, context=None):
"""Propagate capital_country and capital_registered to created partner.
"""
partner_id = super(CrmLead, self)._lead_create_contact(
cr, uid, lead, name, is_company, parent_id=parent_id,
context=context)
self.pool['res.partner'].write(
cr, uid, partner_id, {
'capital_country': lead.capital_country.id,
'capital_registered': lead.capital_registered,
'turnover_range': lead.turnover_range.id,
'turnover_number': lead.turnover_number,
'company_size': lead.company_size,
}, context=context)
return partner_id

12
partner_capital/models/crm_turnover_range.py

@ -1,12 +0,0 @@
# -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields
class CrmTurnoverRange(models.Model):
_name = 'crm.turnover_range'
_description = "Turnover range"
name = fields.Char(required=True, translate=True)

25
partner_capital/models/res_partner.py

@ -1,7 +1,9 @@
# -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com)
# Antonio Espinosa <antonioea@antiun.com>
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
@ -9,11 +11,16 @@ class ResPartner(models.Model):
_inherit = 'res.partner'
capital_country = fields.Many2one(
'res.country', string="Capital country",
help="Country of origin of the capital of this company")
capital_registered = fields.Integer(string="Capital registered")
turnover_range = fields.Many2one(comodel_name='crm.turnover_range')
turnover_number = fields.Integer()
'res.country',
"Capital country",
help="Country of origin of this company's capital.")
capital_amount = fields.Float(
"Capital amount",
help="Publicly registered capital amount.")
turnover_range_id = fields.Many2one(
'res.partner.turnover_range',
"Turnover range")
turnover_amount = fields.Float()
company_size = fields.Selection(
string="Company size",
selection=[('micro', 'Micro'), ('small', 'Small'),

14
partner_capital/models/res_partner_turnover_range.py

@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Antiun Ingeniería S.L. (http://www.antiun.com)
# Antonio Espinosa <antonioea@antiun.com>
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class ResPartnerTurnoverRange(models.Model):
_name = 'res.partner.turnover_range'
_description = "Turnover range"
name = fields.Char(required=True, translate=True)

8
partner_capital/security/ir.model.access.csv

@ -1,5 +1,5 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_crm_turnover_public","crm_turnover_range group_public","model_crm_turnover_range","base.group_public",1,0,0,0
"access_crm_turnover_portal","crm_turnover_range group_portal","model_crm_turnover_range","base.group_portal",1,0,0,0
"access_crm_turnover_group_partner_manager","crm_turnover_range group_partner_manager","model_crm_turnover_range","base.group_partner_manager",1,1,1,1
"access_crm_turnover_group_user","crm_turnover_range group_user","model_crm_turnover_range","base.group_user",1,0,0,0
"access_crm_turnover_public","res_partner_turnover_range group_public","model_res_partner_turnover_range","base.group_public",1,0,0,0
"access_crm_turnover_portal","res_partner_turnover_range group_portal","model_res_partner_turnover_range","base.group_portal",1,0,0,0
"access_crm_turnover_group_partner_manager","res_partner_turnover_range group_partner_manager","model_res_partner_turnover_range","base.group_partner_manager",1,1,1,1
"access_crm_turnover_group_user","res_partner_turnover_range group_user","model_res_partner_turnover_range","base.group_user",1,0,0,0

78
partner_capital/views/crm_lead_view.xml

@ -1,78 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="crm_case_form_view_leads">
<field name="name">Add capital fields</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_form_view_leads"/>
<field name="arch" type="xml">
<field name="partner_id" position="before">
<field name="capital_country" placeholder="Capital country"
options='{"no_open": True}'/>
<field name="capital_registered"/>
<field name="turnover_range" placeholder="Turnover range"
options='{"no_open": True}'/>
<field name="turnover_number"/>
<field name="company_size"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="view_crm_case_leads_filter">
<field name="name">Add capital fields for grouping</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.view_crm_case_leads_filter"/>
<field name="arch" type="xml">
<filter string="Sales Team" position="after">
<filter string="Capital country"
domain="[]"
context="{'group_by': 'capital_country'}"/>
<filter string="Turnover"
domain="[]"
context="{'group_by': 'turnover_number'}"/>
<filter string="Company size"
domain="[]"
context="{'group_by': 'company_size'}"/>
</filter>
</field>
</record>
<record model="ir.ui.view" id="crm_case_form_view_oppor">
<field name="name">Add capital fields</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
<field name="arch" type="xml">
<field name="partner_id" position="before">
<field name="capital_country" placeholder="Capital country"
options='{"no_open": True}'/>
<field name="capital_registered"/>
<field name="turnover_range" placeholder="Turnover range"
options='{"no_open": True}'/>
<field name="turnover_number"/>
<field name="company_size"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="view_crm_case_opportunities_filter">
<field name="name">Add capital fields for grouping</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.view_crm_case_opportunities_filter"/>
<field name="arch" type="xml">
<filter string="Sales Team" position="after">
<filter string="Capital country"
domain="[]"
context="{'group_by': 'capital_country'}"/>
<filter string="Turnover"
domain="[]"
context="{'group_by': 'turnover_number'}"/>
<filter string="Company size"
domain="[]"
context="{'group_by': 'company_size'}"/>
</filter>
</field>
</record>
</data>
</openerp>

29
partner_capital/views/crm_turnover_range_view.xml

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="crm_turnover_range_action" model="ir.actions.act_window">
<field name="name">Turnover ranges</field>
<field name="res_model">crm.turnover_range</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
</record>
<record id="crm_turnover_range_tree_view" model="ir.ui.view">
<field name="name">CRM Turnover range tree</field>
<field name="model">crm.turnover_range</field>
<field name="arch" type="xml">
<tree string="Turnover ranges" editable="top">
<field name="name"/>
</tree>
</field>
</record>
<menuitem action="crm_turnover_range_action"
id="menu_crm_turnover_range"
name="Turnover ranges"
parent="base.menu_crm_config_lead"
sequence="5"/>
</data>
</openerp>

33
partner_capital/views/res_partner_turnover_range_view.xml

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- © 2015 Antiun Ingeniería S.L. - Antonio Espinosa
© 2015 Antiun Ingeniería S.L. - Jairo Llopis
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<openerp>
<data>
<record id="res_partner_turnover_range_action" model="ir.actions.act_window">
<field name="name">Turnover ranges</field>
<field name="res_model">res.partner.turnover_range</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
</record>
<record id="res_partner_turnover_range_tree_view" model="ir.ui.view">
<field name="name">CRM Turnover range tree</field>
<field name="model">res.partner.turnover_range</field>
<field name="arch" type="xml">
<tree string="Turnover ranges" editable="top">
<field name="name"/>
</tree>
</field>
</record>
<menuitem action="res_partner_turnover_range_action"
id="menu_res_partner_turnover_range"
name="Turnover ranges"
parent="base.menu_config_address_book"
sequence="5"/>
</data>
</openerp>

34
partner_capital/views/res_partner_view.xml

@ -1,4 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- © 2015 Antiun Ingeniería S.L. - Antonio Espinosa
© 2015 Antiun Ingeniería S.L. - Jairo Llopis
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<openerp>
<data>
@ -7,20 +11,20 @@
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="phone" position="before">
<field name="capital_country" placeholder="Capital country"
attrs="{'invisible': [('is_company', '=', False)]}"
options='{"no_open": True}'/>
<field name="capital_registered"
attrs="{'invisible': [('is_company', '=', False)]}"/>
<field name="turnover_range" placeholder="Turnover range"
attrs="{'invisible': [('is_company', '=', False)]}"
options='{"no_open": True}'/>
<field name="turnover_number"
attrs="{'invisible': [('is_company', '=', False)]}"/>
<field name="company_size"
attrs="{'invisible': [('is_company', '=', False)]}"/>
</field>
<xpath expr="//page[@name='sales_purchases']" position="inside">
<group name="captial" string="Capital">
<field name="capital_country"
attrs="{'invisible': [('is_company', '=', False)]}"/>
<field name="capital_amount"
attrs="{'invisible': [('is_company', '=', False)]}"/>
<field name="turnover_range_id"
attrs="{'invisible': [('is_company', '=', False)]}"/>
<field name="turnover_amount"
attrs="{'invisible': [('is_company', '=', False)]}"/>
<field name="company_size"
attrs="{'invisible': [('is_company', '=', False)]}"/>
</group>
</xpath>
</field>
</record>
@ -44,4 +48,4 @@
</record>
</data>
</openerp>
</openerp>
Loading…
Cancel
Save