Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions partner_supplierinfo_smartbutton/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

========================================
Access supplied products from the vendor
========================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:75dcd83cf0adc314018d19dba373aef5483edb5c0a26e74730073512e12de932
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-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%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/19.0/partner_supplierinfo_smartbutton
:alt: OCA/purchase-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/purchase-workflow-19-0/purchase-workflow-19-0-partner_supplierinfo_smartbutton
: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/purchase-workflow&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This addon adds a smart-button in the vendors with the supplied
products.

**Table of contents**

.. contents::
:local:

Configuration
=============

1. Go to *Purchase > Products > Products*.
2. Access one of them clicking on it.
3. Go to "Purchase" tab and add some vendors (Azure Interior for
example).

Usage
=====

1. Go to *Contacts* or *Purchase > Orders > Vendors*.
2. Access one of them clicking on it.
3. If it has supplier products, you will see an smart-button in the top
part called "Products Supplied".
4. Clicking on it, you will be see all products supplied.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/purchase-workflow/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 <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20partner_supplierinfo_smartbutton%0Aversion:%2019.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
=======

Authors
-------

* Tecnativa

Contributors
------------

- `Tecnativa <https://www.tecnativa.com>`__:

- Víctor Martínez
- Pedro M. Baeza

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-victoralmau| image:: https://github.com/victoralmau.png?size=40px
:target: https://github.com/victoralmau
:alt: victoralmau

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-victoralmau|

This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/19.0/partner_supplierinfo_smartbutton>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions partner_supplierinfo_smartbutton/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions partner_supplierinfo_smartbutton/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2022 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Access supplied products from the vendor",
"version": "19.0.1.0.0",
"category": "Purchase Management",
"website": "https://github.com/OCA/purchase-workflow",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["product"],
"installable": True,
"data": [
"views/res_partner_view.xml",
],
"maintainers": ["victoralmau"],
}
43 changes: 43 additions & 0 deletions partner_supplierinfo_smartbutton/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_supplierinfo_smartbutton
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-04-29 13:03+0000\n"
"PO-Revision-Date: 2022-04-29 16:03+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 2.3\n"

#. module: partner_supplierinfo_smartbutton
#: model:ir.model,name:partner_supplierinfo_smartbutton.model_res_partner
msgid "Contact"
msgstr "Contacto"

#. module: partner_supplierinfo_smartbutton
#: model:ir.model.fields,field_description:partner_supplierinfo_smartbutton.field_res_partner__product_supplied_count
#: model:ir.model.fields,field_description:partner_supplierinfo_smartbutton.field_res_users__product_supplied_count
msgid "Product Supplied Count"
msgstr "Total productos suministrados"

#. module: partner_supplierinfo_smartbutton
#: model_terms:ir.ui.view,arch_db:partner_supplierinfo_smartbutton.view_partner_form
msgid "Products Supplied"
msgstr "Productos suministrados"

#~ msgid "Display Name"
#~ msgstr "Nombre mostrado"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Última modificación el"
31 changes: 31 additions & 0 deletions partner_supplierinfo_smartbutton/i18n/es_419.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_supplierinfo_smartbutton
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: es_419\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"

#. module: partner_supplierinfo_smartbutton
#: model:ir.model,name:partner_supplierinfo_smartbutton.model_res_partner
msgid "Contact"
msgstr ""

#. module: partner_supplierinfo_smartbutton
#: model:ir.model.fields,field_description:partner_supplierinfo_smartbutton.field_res_partner__product_supplied_count
#: model:ir.model.fields,field_description:partner_supplierinfo_smartbutton.field_res_users__product_supplied_count
msgid "Product Supplied Count"
msgstr ""

#. module: partner_supplierinfo_smartbutton
#: model_terms:ir.ui.view,arch_db:partner_supplierinfo_smartbutton.view_partner_form
msgid "Products Supplied"
msgstr ""
42 changes: 42 additions & 0 deletions partner_supplierinfo_smartbutton/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_supplierinfo_smartbutton
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-01-02 15:44+0000\n"
"Last-Translator: Paul_Goubert <paul.goubert@akretion.com>\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.14.1\n"

#. module: partner_supplierinfo_smartbutton
#: model:ir.model,name:partner_supplierinfo_smartbutton.model_res_partner
msgid "Contact"
msgstr "Contact"

#. module: partner_supplierinfo_smartbutton
#: model:ir.model.fields,field_description:partner_supplierinfo_smartbutton.field_res_partner__product_supplied_count
#: model:ir.model.fields,field_description:partner_supplierinfo_smartbutton.field_res_users__product_supplied_count
msgid "Product Supplied Count"
msgstr "Articles fournis somme"

#. module: partner_supplierinfo_smartbutton
#: model_terms:ir.ui.view,arch_db:partner_supplierinfo_smartbutton.view_partner_form
msgid "Products Supplied"
msgstr "Articles fournis"

#~ msgid "Display Name"
#~ msgstr "Nom affiché"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Dernière modification le"
42 changes: 42 additions & 0 deletions partner_supplierinfo_smartbutton/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_supplierinfo_smartbutton
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-01-20 13:45+0000\n"
"Last-Translator: Francesco Foresti <francesco.foresti@ooops404.com>\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 4.14.1\n"

#. module: partner_supplierinfo_smartbutton
#: model:ir.model,name:partner_supplierinfo_smartbutton.model_res_partner
msgid "Contact"
msgstr "Contatto"

#. module: partner_supplierinfo_smartbutton
#: model:ir.model.fields,field_description:partner_supplierinfo_smartbutton.field_res_partner__product_supplied_count
#: model:ir.model.fields,field_description:partner_supplierinfo_smartbutton.field_res_users__product_supplied_count
msgid "Product Supplied Count"
msgstr "Conteggio prodotti forniti"

#. module: partner_supplierinfo_smartbutton
#: model_terms:ir.ui.view,arch_db:partner_supplierinfo_smartbutton.view_partner_form
msgid "Products Supplied"
msgstr "Prodotti forniti"

#~ msgid "Display Name"
#~ msgstr "Nome visualizzato"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Ultima modifica il"
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * partner_supplierinfo_smartbutton
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.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: partner_supplierinfo_smartbutton
#: model:ir.model,name:partner_supplierinfo_smartbutton.model_res_partner
msgid "Contact"
msgstr ""

#. module: partner_supplierinfo_smartbutton
#: model:ir.model.fields,field_description:partner_supplierinfo_smartbutton.field_res_partner__product_supplied_count
#: model:ir.model.fields,field_description:partner_supplierinfo_smartbutton.field_res_users__product_supplied_count
msgid "Product Supplied Count"
msgstr ""

#. module: partner_supplierinfo_smartbutton
#: model_terms:ir.ui.view,arch_db:partner_supplierinfo_smartbutton.view_partner_form
msgid "Products Supplied"
msgstr ""
1 change: 1 addition & 0 deletions partner_supplierinfo_smartbutton/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import res_partner
34 changes: 34 additions & 0 deletions partner_supplierinfo_smartbutton/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2022 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from odoo import fields, models


class ResPartner(models.Model):
_inherit = "res.partner"

product_supplied_count = fields.Integer(compute="_compute_product_supplied_count")

def _compute_product_supplied_count(self):
data = self.env["product.supplierinfo"]._read_group(
[("partner_id", "in", self.ids)], ["partner_id"], ["__count"]
)
mapping = {partner.id: count for partner, count in data}
for item in self:
item.product_supplied_count = mapping.get(item.id, 0)

def action_see_products_by_seller(self):
domain = [("partner_id", "=", self.id)]
action = self.env["ir.actions.act_window"]._for_xml_id(
"product.product_supplierinfo_type_action"
)
ctx = dict(self.env.context)
ctx.update(
{
"default_partner_id": self.id,
"search_default_partner_id": self.id,
"visible_product_tmpl_id": False,
}
)
action.update({"domain": domain, "context": ctx})
return action
3 changes: 3 additions & 0 deletions partner_supplierinfo_smartbutton/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
4 changes: 4 additions & 0 deletions partner_supplierinfo_smartbutton/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1. Go to *Purchase \> Products \> Products*.
2. Access one of them clicking on it.
3. Go to "Purchase" tab and add some vendors (Azure Interior for
example).
3 changes: 3 additions & 0 deletions partner_supplierinfo_smartbutton/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [Tecnativa](https://www.tecnativa.com):
- Víctor Martínez
- Pedro M. Baeza
2 changes: 2 additions & 0 deletions partner_supplierinfo_smartbutton/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This addon adds a smart-button in the vendors with the supplied
products.
5 changes: 5 additions & 0 deletions partner_supplierinfo_smartbutton/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
1. Go to *Contacts* or *Purchase \> Orders \> Vendors*.
2. Access one of them clicking on it.
3. If it has supplier products, you will see an smart-button in the top
part called "Products Supplied".
4. Clicking on it, you will be see all products supplied.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading