Browse Source

[MIG] partner_capital: Migration to 13.0

14.0
kongrattapong 5 years ago
committed by Víctor Martínez
parent
commit
f5962710a1
  1. 11
      partner_capital/README.rst
  2. 2
      partner_capital/__init__.py
  3. 2
      partner_capital/__manifest__.py
  4. 15
      partner_capital/i18n/partner_capital.pot
  5. 2
      partner_capital/models/__init__.py
  6. 14
      partner_capital/models/res_partner.py
  7. 1
      partner_capital/readme/CONTRIBUTORS.rst
  8. 7
      partner_capital/static/description/index.html
  9. 43
      partner_capital/views/res_partner_turnover_range_view.xml
  10. 81
      partner_capital/views/res_partner_view.xml

11
partner_capital/README.rst

@ -14,13 +14,13 @@ Partners Capital
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github
:target: https://github.com/OCA/partner-contact/tree/12.0/partner_capital
:target: https://github.com/OCA/partner-contact/tree/13.0/partner_capital
:alt: OCA/partner-contact :alt: OCA/partner-contact
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_capital
:target: https://translation.odoo-community.org/projects/partner-contact-13-0/partner-contact-13-0-partner_capital
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/134/12.0
:target: https://runbot.odoo-community.org/runbot/134/13.0
:alt: Try me on Runbot :alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@ -65,7 +65,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/partner-contact/issues>`_. 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. 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 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:%20partner_capital%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_capital%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues. Do not contact contributors directly about support or help with technical issues.
@ -86,6 +86,7 @@ Contributors
* Jairo Llopis <jairo.llopis@tecnativa.com> * Jairo Llopis <jairo.llopis@tecnativa.com>
* David Vidal <david.vidal@tecnativa.com> * David Vidal <david.vidal@tecnativa.com>
* Alexandre Díaz <alexandre.diaz@tecnativa.com> * Alexandre Díaz <alexandre.diaz@tecnativa.com>
* Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>
Maintainers Maintainers
~~~~~~~~~~~ ~~~~~~~~~~~
@ -100,6 +101,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/12.0/partner_capital>`_ project on GitHub.
This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/13.0/partner_capital>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

2
partner_capital/__init__.py

@ -1 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import models from . import models

2
partner_capital/__manifest__.py

@ -5,7 +5,7 @@
{ {
"name": "Partners Capital", "name": "Partners Capital",
"version": "12.0.1.0.0",
"version": "13.0.1.0.1",
"category": "Customer Relationship Management", "category": "Customer Relationship Management",
"license": "AGPL-3", "license": "AGPL-3",
"author": "Antiun Ingeniería S.L., " "author": "Antiun Ingeniería S.L., "

15
partner_capital/i18n/partner_capital.pot

@ -1,12 +1,12 @@
# Translation of Odoo Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * partner_capital
# * partner_capital
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@ -14,7 +14,7 @@ msgstr ""
"Plural-Forms: \n" "Plural-Forms: \n"
#. module: partner_capital #. module: partner_capital
#: selection:res.partner,company_size:0
#: model:ir.model.fields.selection,name:partner_capital.selection__res_partner__company_size__big
msgid "Big" msgid "Big"
msgstr "" msgstr ""
@ -96,12 +96,12 @@ msgid "Last Updated on"
msgstr "" msgstr ""
#. module: partner_capital #. module: partner_capital
#: selection:res.partner,company_size:0
#: model:ir.model.fields.selection,name:partner_capital.selection__res_partner__company_size__medium
msgid "Medium" msgid "Medium"
msgstr "" msgstr ""
#. module: partner_capital #. module: partner_capital
#: selection:res.partner,company_size:0
#: model:ir.model.fields.selection,name:partner_capital.selection__res_partner__company_size__micro
msgid "Micro" msgid "Micro"
msgstr "" msgstr ""
@ -117,7 +117,7 @@ msgid "Publicly registered capital amount."
msgstr "" msgstr ""
#. module: partner_capital #. module: partner_capital
#: selection:res.partner,company_size:0
#: model:ir.model.fields.selection,name:partner_capital.selection__res_partner__company_size__small
msgid "Small" msgid "Small"
msgstr "" msgstr ""
@ -145,4 +145,3 @@ msgstr ""
#: model_terms:ir.ui.view,arch_db:partner_capital.res_partner_turnover_range_tree_view #: model_terms:ir.ui.view,arch_db:partner_capital.res_partner_turnover_range_tree_view
msgid "Turnover ranges" msgid "Turnover ranges"
msgstr "" msgstr ""

2
partner_capital/models/__init__.py

@ -1,2 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import res_partner_turnover_range from . import res_partner_turnover_range
from . import res_partner from . import res_partner

14
partner_capital/models/res_partner.py

@ -9,17 +9,21 @@ class ResPartner(models.Model):
_inherit = "res.partner" _inherit = "res.partner"
capital_country_id = fields.Many2one( capital_country_id = fields.Many2one(
"res.country",
"Capital country",
comodel_name="res.country",
string="Capital country",
help="Country of origin of this company's capital.", help="Country of origin of this company's capital.",
) )
capital_amount = fields.Monetary( capital_amount = fields.Monetary(
"Capital amount",
string="Capital amount",
currency_field="capital_currency_id", currency_field="capital_currency_id",
help="Publicly registered capital amount.", help="Publicly registered capital amount.",
) )
capital_currency_id = fields.Many2one("res.currency", string="Capital currency")
turnover_range_id = fields.Many2one("res.partner.turnover_range", "Turnover range")
capital_currency_id = fields.Many2one(
comodel_name="res.currency", string="Capital currency"
)
turnover_range_id = fields.Many2one(
comodel_name="res.partner.turnover_range", string="Turnover range"
)
turnover_amount = fields.Float() turnover_amount = fields.Float()
company_size = fields.Selection( company_size = fields.Selection(
string="Company size", string="Company size",

1
partner_capital/readme/CONTRIBUTORS.rst

@ -3,3 +3,4 @@
* Jairo Llopis <jairo.llopis@tecnativa.com> * Jairo Llopis <jairo.llopis@tecnativa.com>
* David Vidal <david.vidal@tecnativa.com> * David Vidal <david.vidal@tecnativa.com>
* Alexandre Díaz <alexandre.diaz@tecnativa.com> * Alexandre Díaz <alexandre.diaz@tecnativa.com>
* Rattapong Chokmasermkul <rattapongc@ecosoft.co.th>

7
partner_capital/static/description/index.html

@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/partner-contact/tree/12.0/partner_capital"><img alt="OCA/partner-contact" src="https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_capital"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/134/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/partner-contact/tree/13.0/partner_capital"><img alt="OCA/partner-contact" src="https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/partner-contact-13-0/partner-contact-13-0-partner_capital"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/134/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of partners to support setting the <p>This module extends the functionality of partners to support setting the
country of origin of capital, registered capital amount and turnover.</p> country of origin of capital, registered capital amount and turnover.</p>
<p>By capital country we mean country of origin of the capital of the company.</p> <p>By capital country we mean country of origin of the capital of the company.</p>
@ -413,7 +413,7 @@ company.</p>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/partner-contact/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/partner-contact/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_capital%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/partner-contact/issues/new?body=module:%20partner_capital%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
@ -433,6 +433,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<li>Jairo Llopis &lt;<a class="reference external" href="mailto:jairo.llopis&#64;tecnativa.com">jairo.llopis&#64;tecnativa.com</a>&gt;</li> <li>Jairo Llopis &lt;<a class="reference external" href="mailto:jairo.llopis&#64;tecnativa.com">jairo.llopis&#64;tecnativa.com</a>&gt;</li>
<li>David Vidal &lt;<a class="reference external" href="mailto:david.vidal&#64;tecnativa.com">david.vidal&#64;tecnativa.com</a>&gt;</li> <li>David Vidal &lt;<a class="reference external" href="mailto:david.vidal&#64;tecnativa.com">david.vidal&#64;tecnativa.com</a>&gt;</li>
<li>Alexandre Díaz &lt;<a class="reference external" href="mailto:alexandre.diaz&#64;tecnativa.com">alexandre.diaz&#64;tecnativa.com</a>&gt;</li> <li>Alexandre Díaz &lt;<a class="reference external" href="mailto:alexandre.diaz&#64;tecnativa.com">alexandre.diaz&#64;tecnativa.com</a>&gt;</li>
<li>Rattapong Chokmasermkul &lt;<a class="reference external" href="mailto:rattapongc&#64;ecosoft.co.th">rattapongc&#64;ecosoft.co.th</a>&gt;</li>
</ul> </ul>
</div> </div>
<div class="section" id="maintainers"> <div class="section" id="maintainers">
@ -442,7 +443,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/partner-contact/tree/12.0/partner_capital">OCA/partner-contact</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/partner-contact/tree/13.0/partner_capital">OCA/partner-contact</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div> </div>
</div> </div>

43
partner_capital/views/res_partner_turnover_range_view.xml

@ -1,26 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<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 id="menu_res_partner_turnover_range"
action="res_partner_turnover_range_action"
parent="contacts.res_partner_menu_config"/>
<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_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
id="menu_res_partner_turnover_range"
action="res_partner_turnover_range_action"
parent="contacts.res_partner_menu_config"
/>
</odoo> </odoo>

81
partner_capital/views/res_partner_view.xml

@ -1,47 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<record model="ir.ui.view" id="view_partner_form_capital">
<field name="name">Partner form with capital info</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='sales_purchases']/group" position="inside">
<group name="capital"
string="Capital"
attrs="{'invisible': [('is_company', '=', False)]}">
<field name="capital_amount"/>
<field name="capital_currency_id"/>
<field name="capital_country_id"/>
<field name="turnover_amount"/>
<field name="turnover_range_id"/>
<field name="company_size"/>
</group>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="view_res_partner_filter_capital">
<field name="name">Partner search with capital</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter"/>
<field name="arch" type="xml">
<filter name="salesperson" position="after">
<filter string="Capital country"
<record id="view_partner_form_capital" model="ir.ui.view">
<field name="name">Partner form with capital info</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<xpath expr="//page[@name='sales_purchases']/group" position="inside">
<group
name="capital"
string="Capital"
attrs="{'invisible': [('is_company', '=', False)]}"
>
<field name="capital_amount" />
<field name="capital_currency_id" />
<field name="capital_country_id" />
<field name="turnover_amount" />
<field name="turnover_range_id" />
<field name="company_size" />
</group>
</xpath>
</field>
</record>
<record id="view_res_partner_filter_capital" model="ir.ui.view">
<field name="name">Partner search with capital</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter" />
<field name="arch" type="xml">
<filter name="salesperson" position="after">
<filter
string="Capital country"
name="capital_country" name="capital_country"
domain="[('is_company', '=', True)]" domain="[('is_company', '=', True)]"
context="{'group_by': 'capital_country_id'}"/>
<filter string="Turnover"
context="{'group_by': 'capital_country_id'}"
/>
<filter
string="Turnover"
name="turnover" name="turnover"
domain="[('is_company', '=', True)]" domain="[('is_company', '=', True)]"
context="{'group_by': 'turnover_range_id'}"/>
<filter string="Company size"
context="{'group_by': 'turnover_range_id'}"
/>
<filter
string="Company size"
name="company_size" name="company_size"
domain="[('is_company', '=', True)]" domain="[('is_company', '=', True)]"
context="{'group_by': 'company_size'}"/>
</filter>
</field>
</record>
context="{'group_by': 'company_size'}"
/>
</filter>
</field>
</record>
</odoo> </odoo>
Loading…
Cancel
Save