Skip to content

Commit

Permalink
MIGR 14.0 animal_owner
Browse files Browse the repository at this point in the history
  • Loading branch information
bealdav committed Dec 7, 2021
1 parent 8c76547 commit 889fcd4
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 32 deletions.
8 changes: 4 additions & 4 deletions animal_owner/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Animal Owner
: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/animal_owner
:target: https://github.com/OCA/partner-contact/tree/14.0/animal_owner
: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-animal_owner
: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
:target: https://runbot.odoo-community.org/runbot/134/14.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -45,7 +45,7 @@ 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:%20animal_owner%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:%20animal_owner%0Aversion:%2014.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.

Expand Down Expand Up @@ -85,6 +85,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-max3903|

This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/12.0/animal_owner>`_ project on GitHub.
This module is part of the `OCA/partner-contact <https://github.com/OCA/partner-contact/tree/14.0/animal_owner>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 0 additions & 2 deletions animal_owner/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# Copyright (C) 2020 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models
5 changes: 2 additions & 3 deletions animal_owner/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Copyright (C) 2020 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Animal Owner",
"version": "12.0.1.0.0",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"summary": "Add owner to the animal",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"maintainer": "Open Source Integrators",
"website": "https://github.com/OCA/partner-contact",
"depends": ["animal"],
"data": ["views/animal.xml", "views/res_partner.xml"],
"application": False,
"development_status": "Beta",
"maintainers": ["max3903"],
}
2 changes: 1 addition & 1 deletion animal_owner/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Copyright (C) 2020 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import animal, res_partner
2 changes: 1 addition & 1 deletion animal_owner/models/animal.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (C) 2020 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models


Expand Down
3 changes: 1 addition & 2 deletions animal_owner/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (C) 2020 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, fields, models


Expand All @@ -16,7 +16,6 @@ def _compute_animal_count(self):
compute=_compute_animal_count, string="Number of Animals", store=True
)

@api.multi
def action_view_animals(self):
action = self.env.ref("animal.action_animal").read()[0]
if self.animal_count > 1:
Expand Down
26 changes: 15 additions & 11 deletions animal_owner/views/animal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<record id="view_animal_owner_tree" model="ir.ui.view">
<field name="name">view.animal.owner.tree</field>
<field name="model">animal</field>
<field name="inherit_id" ref="animal.view_animal_tree"/>
<field name="inherit_id" ref="animal.view_animal_tree" />
<field name="arch" type="xml">
<field name="color_id" position="after">
<field name="partner_id"/>
<field name="partner_id" />
</field>
</field>
</record>
Expand All @@ -16,10 +16,10 @@
<record id="view_animal_owner_form" model="ir.ui.view">
<field name="name">view.animal.owner.form</field>
<field name="model">animal</field>
<field name="inherit_id" ref="animal.view_animal_form"/>
<field name="inherit_id" ref="animal.view_animal_form" />
<field name="arch" type="xml">
<field name="birth_date" position="after">
<field name="partner_id"/>
<field name="partner_id" />
</field>
</field>
</record>
Expand All @@ -28,13 +28,13 @@
<record id="view_animal_owner_kanban" model="ir.ui.view">
<field name="name">view.animal.owner.kanban</field>
<field name="model">animal</field>
<field name="inherit_id" ref="animal.view_animal_kanban"/>
<field name="inherit_id" ref="animal.view_animal_kanban" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="partner_id"/>
<field name="partner_id" />
</field>
<xpath expr="//div[hasclass('oe_kanban_details')]/ul" position="inside">
<li t-if="record.partner_id.raw_value"><field name="partner_id"/></li>
<li t-if="record.partner_id.raw_value"><field name="partner_id" /></li>
</xpath>
</field>
</record>
Expand All @@ -43,14 +43,18 @@
<record id="view_animal_owner_search" model="ir.ui.view">
<field name="name">view.animal.owner.search</field>
<field name="model">animal</field>
<field name="inherit_id" ref="animal.view_animal_search"/>
<field name="inherit_id" ref="animal.view_animal_search" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="partner_id"/>
<field name="partner_id" />
</field>
<filter name="gender" position="before">
<filter name="partner_id" string="Owner" domain=""
context="{'group_by': 'partner_id'}"/>
<filter
name="partner_id"
string="Owner"
domain=""
context="{'group_by': 'partner_id'}"
/>
</filter>
</field>
</record>
Expand Down
19 changes: 11 additions & 8 deletions animal_owner/views/res_partner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@

<!-- Partner Form View -->
<record id="view_partner_animal_owner_form" model="ir.ui.view">
<field name="name">view.partner.animal.owner.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<button name="toggle_active" position="before">
<button class="oe_stat_button" type="object"
name="action_view_animals" icon="fa-pencil-square-o"
context="{'default_partner_id': id}">
<div name="button_box" position="inside">
<button
class="oe_stat_button"
type="object"
name="action_view_animals"
icon="fa-pencil-square-o"
context="{'default_partner_id': id}"
>
<div class="o_stat_info">
<field name="animal_count" class="o_stat_value"/>
<field name="animal_count" class="o_stat_value" />
<span class="o_stat_text"> Animals</span>
</div>
</button>
</button>
</div>
</field>
</record>

Expand Down
1 change: 1 addition & 0 deletions setup/animal_owner/odoo/addons/animal_owner
6 changes: 6 additions & 0 deletions setup/animal_owner/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 889fcd4

Please sign in to comment.