Skip to content

Commit

Permalink
Merge pull request #1379 from OCA/16.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/purchase-workflow (16.0)
  • Loading branch information
bt-admin authored Feb 29, 2024
2 parents f1e4a36 + aa94cba commit 66e2e4b
Show file tree
Hide file tree
Showing 21 changed files with 741 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ addon | version | maintainers | summary
[purchase_order_line_menu](purchase_order_line_menu/) | 16.0.2.1.0 | | Adds Purchase Order Lines Menu
[purchase_order_no_zero_price](purchase_order_no_zero_price/) | 16.0.1.0.1 | | Prevent zero price lines on Purchase Orders
[purchase_order_owner](purchase_order_owner/) | 16.0.1.0.0 | | Purchase Order Owner
[purchase_order_product_attachment_mgmt](purchase_order_product_attachment_mgmt/) | 16.0.1.0.0 | [![victoralmau](https://github.com/victoralmau.png?size=30px)](https://github.com/victoralmau) | Purchase Order Product Attachment Mgmt
[purchase_order_product_recommendation](purchase_order_product_recommendation/) | 16.0.1.1.0 | | Recommend products to buy to supplier based on history
[purchase_order_purchase_manager](purchase_order_purchase_manager/) | 16.0.1.0.1 | [![EmilioPascual](https://github.com/EmilioPascual.png?size=30px)](https://github.com/EmilioPascual) | Purchase Manager from Supplier in Purchase Order
[purchase_order_supplierinfo_update](purchase_order_supplierinfo_update/) | 16.0.1.0.1 | [![ernestotejeda](https://github.com/ernestotejeda.png?size=30px)](https://github.com/ernestotejeda) | Update product supplierinfo with the last purchase price
Expand Down
93 changes: 93 additions & 0 deletions purchase_order_product_attachment_mgmt/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
======================================
Purchase Order Product Attachment Mgmt
======================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3b99953fa3e56e77c59c9651ee8563722114f897992de016c9af80e3672e2c1e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/16.0/purchase_order_product_attachment_mgmt
: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-16-0/purchase-workflow-16-0-purchase_order_product_attachment_mgmt
: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=16.0
:alt: Try me on Runboat

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

This module allows to get all attachments from all products of a purchase on a view.

**Table of contents**

.. contents::
:local:

Usage
=====

#. Go to *Purchase -> Orders > Purchase Orders* and create or edit some record.
#. The smart-button "Attachments" display the attachments of the product lines.

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:%20purchase_order_product_attachment_mgmt%0Aversion:%2016.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/16.0/purchase_order_product_attachment_mgmt>`_ 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 purchase_order_product_attachment_mgmt/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions purchase_order_product_attachment_mgmt/__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": "Purchase Order Product Attachment Mgmt",
"version": "16.0.1.0.0",
"category": "Purchases",
"website": "https://github.com/OCA/purchase-workflow",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["purchase"],
"installable": True,
"data": [
"views/purchase_order_view.xml",
],
"maintainers": ["victoralmau"],
}
38 changes: 38 additions & 0 deletions purchase_order_product_attachment_mgmt/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_product_attachment_mgmt
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-03-14 16:21+0000\n"
"PO-Revision-Date: 2022-03-14 17:23+0100\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: purchase_order_product_attachment_mgmt
#: model:ir.actions.server,name:purchase_order_product_attachment_mgmt.action_see_purchase_order_attachments
#: model_terms:ir.ui.view,arch_db:purchase_order_product_attachment_mgmt.purchase_order_form
msgid "Attachments"
msgstr "Adjuntos"

#. module: purchase_order_product_attachment_mgmt
#: model:ir.model,name:purchase_order_product_attachment_mgmt.model_purchase_order
msgid "Purchase Order"
msgstr "Pedido de compra"

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

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

#~ msgid "Last Modified on"
#~ msgstr "Última modificación el"
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_order_product_attachment_mgmt
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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: purchase_order_product_attachment_mgmt
#: model:ir.actions.server,name:purchase_order_product_attachment_mgmt.action_see_purchase_order_attachments
#: model_terms:ir.ui.view,arch_db:purchase_order_product_attachment_mgmt.purchase_order_form
msgid "Attachments"
msgstr ""

#. module: purchase_order_product_attachment_mgmt
#: model:ir.model,name:purchase_order_product_attachment_mgmt.model_purchase_order
msgid "Purchase Order"
msgstr ""
1 change: 1 addition & 0 deletions purchase_order_product_attachment_mgmt/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import purchase_order
27 changes: 27 additions & 0 deletions purchase_order_product_attachment_mgmt/models/purchase_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2022 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models


class PurchaseOrder(models.Model):
_inherit = "purchase.order"

def _action_see_purchase_order_attachments(self, products):
domain = [
"|",
"&",
("res_model", "=", "product.product"),
("res_id", "in", products.ids),
"&",
("res_model", "=", "product.template"),
("res_id", "in", products.mapped("product_tmpl_id").ids),
]
res = self.env["ir.actions.act_window"]._for_xml_id("base.action_attachment")
ctx = {"create": False, "edit": False}
res.update({"domain": domain, "context": ctx})
return res

def action_see_purchase_order_attachments(self):
return self._action_see_purchase_order_attachments(
self.mapped("order_line.product_id")
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* `Tecnativa <https://www.tecnativa.com>`_:

* Víctor Martínez
* Pedro M. Baeza
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module allows to get all attachments from all products of a purchase on a view.
2 changes: 2 additions & 0 deletions purchase_order_product_attachment_mgmt/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#. Go to *Purchase -> Orders > Purchase Orders* and create or edit some record.
#. The smart-button "Attachments" display the attachments of the product lines.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 66e2e4b

Please sign in to comment.