diff --git a/animal_owner/README.rst b/animal_owner/README.rst new file mode 100644 index 00000000000..229967d8bd3 --- /dev/null +++ b/animal_owner/README.rst @@ -0,0 +1,93 @@ +============ +Animal Owner +============ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:8dd9b5b375fb54fb9018aa815aeaf6c46c0aabacdf4519abe58f98c5c4ad2427 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |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/16.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-16-0/partner-contact-16-0-animal_owner + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/partner-contact&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows you to store the owner of a pet. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +* Go to Animals +* Create or select an animal +* Select his owner + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Open Source Integrators + +Contributors +~~~~~~~~~~~~ + +* Open Source Integrators + + * Maxime Chambreuil + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +.. |maintainer-max3903| image:: https://github.com/max3903.png?size=40px + :target: https://github.com/max3903 + :alt: max3903 + +Current `maintainer `__: + +|maintainer-max3903| + +This module is part of the `OCA/partner-contact `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/animal_owner/__init__.py b/animal_owner/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/animal_owner/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/animal_owner/__manifest__.py b/animal_owner/__manifest__.py new file mode 100644 index 00000000000..0395f26b0b3 --- /dev/null +++ b/animal_owner/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright (C) 2020 Open Source Integrators +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Animal Owner", + "version": "16.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"], + "development_status": "Beta", + "maintainers": ["max3903"], +} diff --git a/animal_owner/i18n/animal_owner.pot b/animal_owner/i18n/animal_owner.pot new file mode 100644 index 00000000000..48c8081207f --- /dev/null +++ b/animal_owner/i18n/animal_owner.pot @@ -0,0 +1,65 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * animal_owner +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \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: animal_owner +#: model_terms:ir.ui.view,arch_db:animal_owner.view_partner_animal_owner_form +msgid " Animals" +msgstr "" + +#. module: animal_owner +#: model:ir.model,name:animal_owner.model_animal +msgid "Animal" +msgstr "" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__animal_ids +#: model:ir.model.fields,field_description:animal_owner.field_res_users__animal_ids +msgid "Animals" +msgstr "" + +#. module: animal_owner +#: model:ir.model,name:animal_owner.model_res_partner +msgid "Contact" +msgstr "" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal__display_name +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__display_name +msgid "Display Name" +msgstr "" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal__id +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__id +msgid "ID" +msgstr "" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal____last_update +#: model:ir.model.fields,field_description:animal_owner.field_res_partner____last_update +msgid "Last Modified on" +msgstr "" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__animal_count +#: model:ir.model.fields,field_description:animal_owner.field_res_users__animal_count +msgid "Number of Animals" +msgstr "" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal__partner_id +#: model_terms:ir.ui.view,arch_db:animal_owner.view_animal_owner_search +msgid "Owner" +msgstr "" diff --git a/animal_owner/i18n/es.po b/animal_owner/i18n/es.po new file mode 100644 index 00000000000..073d5b0b9a1 --- /dev/null +++ b/animal_owner/i18n/es.po @@ -0,0 +1,68 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * animal_owner +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-01-13 18:33+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: animal_owner +#: model_terms:ir.ui.view,arch_db:animal_owner.view_partner_animal_owner_form +msgid " Animals" +msgstr " Animales" + +#. module: animal_owner +#: model:ir.model,name:animal_owner.model_animal +msgid "Animal" +msgstr "Animal" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__animal_ids +#: model:ir.model.fields,field_description:animal_owner.field_res_users__animal_ids +msgid "Animals" +msgstr "Animales" + +#. module: animal_owner +#: model:ir.model,name:animal_owner.model_res_partner +msgid "Contact" +msgstr "Contacto" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal__display_name +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__display_name +msgid "Display Name" +msgstr "Mostrar Nombre" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal__id +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__id +msgid "ID" +msgstr "ID" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal____last_update +#: model:ir.model.fields,field_description:animal_owner.field_res_partner____last_update +msgid "Last Modified on" +msgstr "Última Modificación el" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__animal_count +#: model:ir.model.fields,field_description:animal_owner.field_res_users__animal_count +msgid "Number of Animals" +msgstr "Numero de animales" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal__partner_id +#: model_terms:ir.ui.view,arch_db:animal_owner.view_animal_owner_search +msgid "Owner" +msgstr "Dueño" diff --git a/animal_owner/i18n/fr.po b/animal_owner/i18n/fr.po new file mode 100644 index 00000000000..ebb7b67eaf7 --- /dev/null +++ b/animal_owner/i18n/fr.po @@ -0,0 +1,68 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * animal_owner +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-01-18 18:47+0000\n" +"Last-Translator: LESTRAT21 \n" +"Language-Team: none\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: animal_owner +#: model_terms:ir.ui.view,arch_db:animal_owner.view_partner_animal_owner_form +msgid " Animals" +msgstr "" + +#. module: animal_owner +#: model:ir.model,name:animal_owner.model_animal +msgid "Animal" +msgstr "" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__animal_ids +#: model:ir.model.fields,field_description:animal_owner.field_res_users__animal_ids +msgid "Animals" +msgstr "Animaux" + +#. module: animal_owner +#: model:ir.model,name:animal_owner.model_res_partner +msgid "Contact" +msgstr "" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal__display_name +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__display_name +msgid "Display Name" +msgstr "" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal__id +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__id +msgid "ID" +msgstr "" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal____last_update +#: model:ir.model.fields,field_description:animal_owner.field_res_partner____last_update +msgid "Last Modified on" +msgstr "" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__animal_count +#: model:ir.model.fields,field_description:animal_owner.field_res_users__animal_count +msgid "Number of Animals" +msgstr "Nombre d'animaux" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal__partner_id +#: model_terms:ir.ui.view,arch_db:animal_owner.view_animal_owner_search +msgid "Owner" +msgstr "Propriétaire" diff --git a/animal_owner/i18n/it.po b/animal_owner/i18n/it.po new file mode 100644 index 00000000000..f6db98f454e --- /dev/null +++ b/animal_owner/i18n/it.po @@ -0,0 +1,68 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * animal_owner +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-07-23 17:25+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.10.4\n" + +#. module: animal_owner +#: model_terms:ir.ui.view,arch_db:animal_owner.view_partner_animal_owner_form +msgid " Animals" +msgstr " Animali" + +#. module: animal_owner +#: model:ir.model,name:animal_owner.model_animal +msgid "Animal" +msgstr "Animale" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__animal_ids +#: model:ir.model.fields,field_description:animal_owner.field_res_users__animal_ids +msgid "Animals" +msgstr "Animali" + +#. module: animal_owner +#: model:ir.model,name:animal_owner.model_res_partner +msgid "Contact" +msgstr "Contatto" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal__display_name +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal__id +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__id +msgid "ID" +msgstr "ID" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal____last_update +#: model:ir.model.fields,field_description:animal_owner.field_res_partner____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_res_partner__animal_count +#: model:ir.model.fields,field_description:animal_owner.field_res_users__animal_count +msgid "Number of Animals" +msgstr "Numero di animali" + +#. module: animal_owner +#: model:ir.model.fields,field_description:animal_owner.field_animal__partner_id +#: model_terms:ir.ui.view,arch_db:animal_owner.view_animal_owner_search +msgid "Owner" +msgstr "Proprietario" diff --git a/animal_owner/models/__init__.py b/animal_owner/models/__init__.py new file mode 100644 index 00000000000..e84a5c2353f --- /dev/null +++ b/animal_owner/models/__init__.py @@ -0,0 +1,3 @@ +# Copyright (C) 2020 Open Source Integrators +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from . import animal, res_partner diff --git a/animal_owner/models/animal.py b/animal_owner/models/animal.py new file mode 100644 index 00000000000..9d436b23e34 --- /dev/null +++ b/animal_owner/models/animal.py @@ -0,0 +1,11 @@ +# Copyright (C) 2020 Open Source Integrators +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class Animal(models.Model): + _inherit = "animal" + + partner_id = fields.Many2one( + "res.partner", string="Owner", index=True, tracking=True + ) diff --git a/animal_owner/models/res_partner.py b/animal_owner/models/res_partner.py new file mode 100644 index 00000000000..9444176cad1 --- /dev/null +++ b/animal_owner/models/res_partner.py @@ -0,0 +1,27 @@ +# Copyright (C) 2020 Open Source Integrators +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import api, fields, models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + @api.depends("animal_ids") + def _compute_animal_count(self): + for rec in self: + rec.animal_count = len(rec.animal_ids) + + animal_ids = fields.One2many("animal", "partner_id", string="Animals") + animal_count = fields.Integer( + compute=_compute_animal_count, string="Number of Animals", store=True + ) + + def action_view_animals(self): + xmlid = "animal.action_animal" + action = self.env["ir.actions.act_window"]._for_xml_id(xmlid) + if self.animal_count > 1: + action["domain"] = [("id", "in", self.animal_ids.ids)] + else: + action["views"] = [(self.env.ref("animal.view_animal_form").id, "form")] + action["res_id"] = self.animal_ids and self.animal_ids.ids[0] or False + return action diff --git a/animal_owner/readme/CONTRIBUTORS.rst b/animal_owner/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..cddff22dc36 --- /dev/null +++ b/animal_owner/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Open Source Integrators + + * Maxime Chambreuil diff --git a/animal_owner/readme/DESCRIPTION.rst b/animal_owner/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..539fc224c38 --- /dev/null +++ b/animal_owner/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows you to store the owner of a pet. diff --git a/animal_owner/readme/USAGE.rst b/animal_owner/readme/USAGE.rst new file mode 100644 index 00000000000..dbb34ff8ca7 --- /dev/null +++ b/animal_owner/readme/USAGE.rst @@ -0,0 +1,3 @@ +* Go to Animals +* Create or select an animal +* Select his owner diff --git a/animal_owner/static/description/icon.png b/animal_owner/static/description/icon.png new file mode 100644 index 00000000000..85d01763f36 Binary files /dev/null and b/animal_owner/static/description/icon.png differ diff --git a/animal_owner/static/description/index.html b/animal_owner/static/description/index.html new file mode 100644 index 00000000000..95be01fcd42 --- /dev/null +++ b/animal_owner/static/description/index.html @@ -0,0 +1,437 @@ + + + + + +Animal Owner + + + +
+

Animal Owner

+ + +

Beta License: AGPL-3 OCA/partner-contact Translate me on Weblate Try me on Runboat

+

This module allows you to store the owner of a pet.

+

Table of contents

+ +
+

Usage

+
    +
  • Go to Animals
  • +
  • Create or select an animal
  • +
  • Select his owner
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Open Source Integrators
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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.

+

Current maintainer:

+

max3903

+

This module is part of the OCA/partner-contact project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/animal_owner/views/animal.xml b/animal_owner/views/animal.xml new file mode 100644 index 00000000000..80cf3befd07 --- /dev/null +++ b/animal_owner/views/animal.xml @@ -0,0 +1,62 @@ + + + + + view.animal.owner.tree + animal + + + + + + + + + + + view.animal.owner.form + animal + + + + + + + + + + + view.animal.owner.kanban + animal + + + + + + +
  • +
    +
    +
    + + + + view.animal.owner.search + animal + + + + + + + + + + + +
    diff --git a/animal_owner/views/res_partner.xml b/animal_owner/views/res_partner.xml new file mode 100644 index 00000000000..9ed3492f8a9 --- /dev/null +++ b/animal_owner/views/res_partner.xml @@ -0,0 +1,25 @@ + + + + + res.partner + + +
    + +
    +
    +
    + +
    diff --git a/setup/animal_owner/odoo/addons/animal_owner b/setup/animal_owner/odoo/addons/animal_owner new file mode 120000 index 00000000000..8c6ac1a74b1 --- /dev/null +++ b/setup/animal_owner/odoo/addons/animal_owner @@ -0,0 +1 @@ +../../../../animal_owner \ No newline at end of file diff --git a/setup/animal_owner/setup.py b/setup/animal_owner/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/animal_owner/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)