Browse Source

[MIG] partner_affiliate: Migration to 12.0

[IMP] partner_affiliate: Readme

[IMP] Small readability improvements

[FIX] Remove copyright from init files
pull/647/head
tarteo 6 years ago
parent
commit
a1f463b29f
  1. 78
      partner_affiliate/README.rst
  2. 3
      partner_affiliate/__init__.py
  3. 9
      partner_affiliate/__manifest__.py
  4. 2
      partner_affiliate/models/__init__.py
  5. 15
      partner_affiliate/models/res_partner.py
  6. 5
      partner_affiliate/readme/CONTRIBUTORS.rst
  7. 4
      partner_affiliate/readme/CREDITS.rst
  8. 5
      partner_affiliate/readme/DESCRIPTION.rst
  9. 1
      partner_affiliate/readme/USAGE.rst
  10. 25
      partner_affiliate/views/res_partner_view.xml

78
partner_affiliate/README.rst

@ -1,14 +1,38 @@
.. 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 Affiliates
==================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |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_affiliate
:alt: OCA/partner-contact
.. |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_affiliate
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/134/12.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
This module allows to use parent_id in company partner to refer to a parent
company, plus will show a tab in parent company of affiliated companies.
**Table of contents**
.. contents::
:local:
Usage
=====
@ -16,45 +40,57 @@ New tab 'Affiliates' are available on the contact form if partner is company.
In tab 'Contact & Addresses' only are shown those contacts that are not
companies.
.. 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/11.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 smashing it by providing a detailed and welcomed feedback.
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:%20partner_affiliate%0Aversion:%2012.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.
Credits
=======
Images
------
Authors
~~~~~~~
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
* Camptocamp
* Tecnativa
* brain-tec AG
* Onestein
Contributors
------------
~~~~~~~~~~~~
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
* Vicent Cubells <vicent.cubells@tecnativa.com>
* Raul Martin <raul.martin@braintec-group.com>
* Dave Lasley <dave@laslabs.com>
* Dennis Sluijk <d.sluijk@onestein.nl>
Other credits
~~~~~~~~~~~~~
Images
------
Maintainer
----------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. 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.
This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/12.0/partner_affiliate>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

3
partner_affiliate/__init__.py

@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2012 Camptocamp SA - Yannick Vaucher
# Copyright 2018 brain-tec AG - Raul Martin
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models

9
partner_affiliate/__manifest__.py

@ -1,17 +1,17 @@
# -*- coding: utf-8 -*-
# Copyright 2012 Camptocamp SA - Yannick Vaucher
# Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2018 brain-tec AG - Raul Martin
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Partner Affiliates',
'version': '11.0.1.0.0',
'version': '12.0.1.0.0',
'author': "Camptocamp, "
"Tecnativa, "
"brain-tec AG, "
"Onestein, "
"Odoo Community Association (OCA)",
'website': 'http://www.camptocamp.com',
'category': 'CRM',
'website': 'https://github.com/OCA/partner-contact',
'category': 'Customer Relationship Management',
'license': 'AGPL-3',
'installable': True,
'depends': [
@ -20,4 +20,5 @@
'data': [
'views/res_partner_view.xml',
],
'development_status': 'Production/Stable',
}

2
partner_affiliate/models/__init__.py

@ -1,5 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2012 Camptocamp SA - Yannick Vaucher
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import res_partner

15
partner_affiliate/models/res_partner.py

@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2012 Camptocamp SA - Yannick Vaucher
# Copyright 2018 brain-tec AG - Raul Martin
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@ -11,13 +10,13 @@ class ResPartner(models.Model):
_inherit = "res.partner"
# force "active_test" domain to bypass _search() override
child_ids = fields.One2many('res.partner', 'parent_id',
string='Contacts',
domain=[('active', '=', True),
('is_company', '=', False)])
child_ids = fields.One2many(
domain=[('active', '=', True), ('is_company', '=', False)]
)
# force "active_test" domain to bypass _search() override
affiliate_ids = fields.One2many('res.partner', 'parent_id',
affiliate_ids = fields.One2many(
'res.partner', 'parent_id',
string='Affiliates',
domain=[('active', '=', True),
('is_company', '=', True)])
domain=[('active', '=', True), ('is_company', '=', True)]
)

5
partner_affiliate/readme/CONTRIBUTORS.rst

@ -0,0 +1,5 @@
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
* Vicent Cubells <vicent.cubells@tecnativa.com>
* Raul Martin <raul.martin@braintec-group.com>
* Dave Lasley <dave@laslabs.com>
* Dennis Sluijk <d.sluijk@onestein.nl>

4
partner_affiliate/readme/CREDITS.rst

@ -0,0 +1,4 @@
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

5
partner_affiliate/readme/DESCRIPTION.rst

@ -0,0 +1,5 @@
The field 'Contacts & Addresses' is focused on storing contact information about the company's employees and the
company it self.
This module adds a new field 'Affiliates' on the partner form and changes 'Contacts & Addresses'
to only show individuals. This new field is in contrast to 'Contacts & Addresses' focussed on
storing information about holding companies and other company structures.

1
partner_affiliate/readme/USAGE.rst

@ -0,0 +1 @@
You can find the new field on the partner (contact, customer, etc) form.

25
partner_affiliate/views/res_partner_view.xml

@ -3,7 +3,6 @@
<!-- Show always parent_id plus add affiliates -->
<record id="view_partner_form_add_affiliate" model="ir.ui.view">
<field name="name">res.partner.form</field>
<field name="model">res.partner</field>
<field eval="1" name="priority"/>
<field name="inherit_id" ref="base.view_partner_form"/>
@ -15,7 +14,8 @@
<page string="Affiliates" attrs="{'invisible': [('is_company','=',False)]}">
<field name="affiliate_ids"
context="{'default_parent_id': active_id, 'default_is_company': True, 'default_type':'other'}" mode="kanban">
<kanban>
<kanban on_create="base.view_partner_form">
<field name="id"/>
<field name="color"/>
<field name="name"/>
<field name="title"/>
@ -32,28 +32,33 @@
<field name="country_id"/>
<field name="mobile"/>
<field name="state_id"/>
<field name="image"/>
<field name="image_small"/>
<field name="lang"/>
<!-- fields in form x2many view to diminish requests -->
<field name="comment"/>
<field name="customer"/>
<field name="display_name"/>
<field name="supplier"/>
<templates>
<t t-name="kanban-box">
<t t-set="color" t-value="kanban_color(record.color.raw_value)"/>
<div t-att-class="color + (record.title.raw_value == 1 ? ' oe_kanban_color_alert' : '') + ' oe_kanban_global_click'">
<a t-if="!read_only_mode" type="delete" class="fa fa-times pull-right"/>
<div class="o_kanban_image">
<img t-if="record.image.raw_value" t-att-src="'data:image/png;base64,'+record.image.raw_value"/>
<t t-if="!record.image.raw_value">
<img t-if="record.type.raw_value === 'delivery'" t-att-src='_s + "/base/static/src/img/truck.png"'/>
<img t-if="record.type.raw_value === 'invoice'" t-att-src='_s + "/base/static/src/img/money.png"'/>
<img alt="" t-if="record.image_small.raw_value" t-att-src="kanban_image('res.partner', 'image_small', record.id.raw_value)"/>
<t t-if="!record.image_small.raw_value">
<img alt="Delivery" t-if="record.type.raw_value === 'delivery'" t-att-src='_s + "/base/static/img/truck.png"'/>
<img alt="Invoice" t-if="record.type.raw_value === 'invoice'" t-att-src='_s + "/base/static/img/money.png"'/>
<t t-if="record.type.raw_value !== 'invoice' &amp;&amp; record.type.raw_value !== 'delivery'">
<img t-if="record.is_company.raw_value === true" t-att-src='_s + "/base/static/src/img/company_image.png"'/>
<img t-if="record.is_company.raw_value === false" t-att-src='_s + "/base/static/src/img/avatar.png"'/>
<img alt="Logo" t-if="record.is_company.raw_value === true" t-att-src='_s + "/base/static/img/company_image.png"'/>
<img alt="Avatar" t-if="record.is_company.raw_value === false" t-att-src='_s + "/base/static/img/avatar.png"'/>
</t>
</t>
</div>
<div class="oe_kanban_details">
<field name="name"/>
<div t-if="record.function.raw_value"><field name="function"/></div>
<div t-if="record.email.raw_value"><field name="email"/></div>
<div t-if="record.email.raw_value"><field name="email" widget="email"/></div>
<div t-if="record.type.raw_value != 'contact'">
<div>
<field name="zip"/>

Loading…
Cancel
Save