Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] purchase_reception_notify: Migration to 18.0 #2494

Open
wants to merge 28 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7af0432
[ADD]purchase_reception_notify
AaronHForgeFlow Jul 2, 2019
b946ca6
add post init hook to update followers of existing POs
JordiBForgeFlow Jul 4, 2019
c441b03
[FIX] Sudo on message_post due to Inventory Users couldn't have Purch…
HviorForgeFlow Aug 28, 2019
bff2160
[MIG] purchase_reception_notify: Migration to 12.0
HviorForgeFlow Sep 23, 2019
1f75aa5
[IMP] purchase_reception_notify: black, isort
HviorForgeFlow Dec 23, 2019
71425ee
[MIG] purchase_reception_notify: Migration to 13.0
HviorForgeFlow Dec 23, 2019
c22d5e1
Added translation using Weblate (Chinese (Simplified))
dong-z Mar 23, 2020
4cadce1
[FIX] Delete empty " " spaces in same string line
MiquelRForgeFlow Sep 30, 2020
579682b
Added translation using Weblate (Italian)
alessandro-fiorino Nov 20, 2020
fa538cb
[IMP] purchase_reception_notify: black, isort, prettier
daylinglez Apr 19, 2021
52f9dd5
[MIG] purchase_reception_notify: Migration to 14.0
daylinglez May 10, 2021
8c7b58c
[UPD] Update purchase_reception_notify.pot
oca-travis May 20, 2021
5a9a1d5
[UPD] README.rst
OCA-git-bot May 20, 2021
3cda91e
[MIG] purchase_reception_notify: Migration to 15.0
BernatPForgeFlow Dec 21, 2021
b29d6ae
[UPD] Update purchase_reception_notify.pot
Dec 29, 2021
2043a64
[UPD] README.rst
OCA-git-bot Dec 29, 2021
868d34e
[UPD] README.rst
OCA-git-bot Sep 3, 2023
3492cf5
Update translation files
weblate Oct 9, 2023
8a43ac3
Added translation using Weblate (Spanish)
Ivorra78 Nov 15, 2023
7f17a49
Translated using Weblate (Spanish)
Ivorra78 Nov 15, 2023
47669d9
[IMP] purchase_reception_notify: pre-commit auto fixes
AnaisLForgeFlow Apr 22, 2024
502c20c
[MIG] purchase_reception_notify: Migration to 17.0
AnaisLForgeFlow Apr 25, 2024
ac8417f
[UPD] Update purchase_reception_notify.pot
May 7, 2024
7d8ed54
[BOT] post-merge updates
OCA-git-bot May 7, 2024
a8447e7
Translated using Weblate (Italian)
mymage May 8, 2024
0b30b2e
[FIX] purchase_reception_notify: use markup when posting HTML message
StefanRijnhart Aug 5, 2024
12d6d31
[BOT] post-merge updates
OCA-git-bot Aug 20, 2024
c7f79e8
[MIG] purchase_reception_notify: Migration to 18.0
HeliconiaSolutions Dec 19, 2024
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
96 changes: 96 additions & 0 deletions purchase_reception_notify/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
=========================
Purchase Reception Notify
=========================

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

.. |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/18.0/purchase_reception_notify
: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-18-0/purchase-workflow-18-0-purchase_reception_notify
: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=18.0
:alt: Try me on Runboat

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

This module automatically notifies the employees following a purchase
order as soon as the associated products have been received into stock.

It also introduces a new message subtype specifically created for those
notifications. This subtype is set to internal by default when
subscribing. The old purchase orders will be updated to assign this new
subtype to the existing followers, as long as they are still active
employees.

**Table of contents**

.. contents::
:local:

Usage
=====

Integrated in the normal flow.

Create a Purchase Order with at least one product with a specified
quantity and confirm th purchase order to generate the corresponding
incoming shipment. Once the purchase order is confirmed, go to Inventory
-> Operations -> Receipts. Open the generated receipt and click on
"Validate". The message will be automatically generated.

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_reception_notify%0Aversion:%2018.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
-------

* ForgeFlow

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

- Aaron Henriquez <[email protected]>
- Jordi Ballester <[email protected]>
- ``Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>``\ \_

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.

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions purchase_reception_notify/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .hooks import post_init_hook
15 changes: 15 additions & 0 deletions purchase_reception_notify/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2019-2024 ForgeFlow S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).

{
"name": "Purchase Reception Notify",
"version": "18.0.1.0.1",
"category": "Purchase Management",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/purchase-workflow",
"license": "AGPL-3",
"depends": ["purchase_stock"],
"data": ["data/mail_data.xml"],
"installable": True,
"post_init_hook": "post_init_hook",
}
9 changes: 9 additions & 0 deletions purchase_reception_notify/data/mail_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="mt_purchase_reception" model="mail.message.subtype">
<field name="name">Purchase Receptions</field>
<field name="res_model">purchase.order</field>
<field name="default" eval="True" />
<field name="internal" eval="True" />
</record>
</odoo>
32 changes: 32 additions & 0 deletions purchase_reception_notify/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2019-2024 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import logging

_logger = logging.getLogger(__name__)


def post_init_hook(env):
"""Existing employees should be subscribed to the new subtype for all
existing purchase orders.
"""
_logger.info(
"Starting task to update internal followers for "
"existing purchase orders to assign the new subtype "
"Purchase Receptions."
)
users = env["res.users"].search([])
followers = env["mail.followers"].search(
[
("res_model", "=", "purchase.order"),
("partner_id", "in", users.mapped("partner_id").ids),
]
)
for follower in followers:
follower.subtype_ids += env.ref(
"purchase_reception_notify.mt_purchase_reception"
)
_logger.info(
"Finalized task to update internal followers for "
"existing purchase orders to assign the new subtype "
"Purchase Receptions."
)
47 changes: 47 additions & 0 deletions purchase_reception_notify/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_reception_notify
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-15 21:38+0000\n"
"Last-Translator: Ivorra78 <[email protected]>\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: purchase_reception_notify
#: code:addons/purchase_reception_notify/models/stock_picking.py:0
#, python-format
msgid ""
"<li><b>%(display_name)s</b>: Received quantity %(product_qty)s %(uom)s</li>"
msgstr ""
"<li><b>%(display_name)s</b>: Cantidad recibida %(product_qty)s %(uom)s</li>"

#. module: purchase_reception_notify
#: model:mail.message.subtype,name:purchase_reception_notify.mt_purchase_reception
msgid "Purchase Receptions"
msgstr "Recepción de Compras"

#. module: purchase_reception_notify
#: code:addons/purchase_reception_notify/models/stock_picking.py:0
#, python-format
msgid "Receipt confirmation %s"
msgstr "Confirmación de recepción %s"

#. module: purchase_reception_notify
#: code:addons/purchase_reception_notify/models/stock_picking.py:0
#, python-format
msgid "The following items have now been received in Incoming Shipment %s:"
msgstr "Los siguientes artículos ya se han recibido en %s de envío entrante:"

#. module: purchase_reception_notify
#: model:ir.model,name:purchase_reception_notify.model_stock_picking
msgid "Transfer"
msgstr "Transferencia"
52 changes: 52 additions & 0 deletions purchase_reception_notify/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_reception_notify
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-05-08 08:34+0000\n"
"Last-Translator: mymage <[email protected]>\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.17\n"

#. module: purchase_reception_notify
#: code:addons/purchase_reception_notify/models/stock_picking.py:0
#, python-format
msgid ""
"<li><b>%(display_name)s</b>: Received quantity %(product_qty)s %(uom)s</li>"
msgstr ""
"<li><b>%(display_name)s</b>: quantità ricevuta %(product_qty)s %(uom)s</li>"

#. module: purchase_reception_notify
#: model:mail.message.subtype,name:purchase_reception_notify.mt_purchase_reception
msgid "Purchase Receptions"
msgstr "Ricezioni Acquisti"

#. module: purchase_reception_notify
#: code:addons/purchase_reception_notify/models/stock_picking.py:0
#, python-format
msgid "Receipt confirmation %s"
msgstr "Conferma di ricezione %s"

#. module: purchase_reception_notify
#: code:addons/purchase_reception_notify/models/stock_picking.py:0
#, python-format
msgid "The following items have now been received in Incoming Shipment %s:"
msgstr ""
"I seguenti oggetti sono stati ricevuti nella spedizioni in ingresso %s:"

#. module: purchase_reception_notify
#: model:ir.model,name:purchase_reception_notify.model_stock_picking
msgid "Transfer"
msgstr "Trasferimento"

#, python-format
#~ msgid "<li><b>%s</b>: Received quantity %s %s</li>"
#~ msgstr "<li><b>%s</b>: Quantità ricevuta %s %s</li>"
46 changes: 46 additions & 0 deletions purchase_reception_notify/i18n/purchase_reception_notify.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_reception_notify
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.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_reception_notify
#. odoo-python
#: code:addons/purchase_reception_notify/models/stock_picking.py:0
#, python-format
msgid ""
"<li><b>%(display_name)s</b>: Received quantity %(product_qty)s %(uom)s</li>"
msgstr ""

#. module: purchase_reception_notify
#: model:mail.message.subtype,name:purchase_reception_notify.mt_purchase_reception
msgid "Purchase Receptions"
msgstr ""

#. module: purchase_reception_notify
#. odoo-python
#: code:addons/purchase_reception_notify/models/stock_picking.py:0
#, python-format
msgid "Receipt confirmation %s"
msgstr ""

#. module: purchase_reception_notify
#. odoo-python
#: code:addons/purchase_reception_notify/models/stock_picking.py:0
#, python-format
msgid "The following items have now been received in Incoming Shipment %s:"
msgstr ""

#. module: purchase_reception_notify
#: model:ir.model,name:purchase_reception_notify.model_stock_picking
msgid "Transfer"
msgstr ""
50 changes: 50 additions & 0 deletions purchase_reception_notify/i18n/zh_CN.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * purchase_reception_notify
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-03-23 13:13+0000\n"
"Last-Translator: Dong <[email protected]>\n"
"Language-Team: none\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 3.10\n"

#. module: purchase_reception_notify
#: code:addons/purchase_reception_notify/models/stock_picking.py:0
#, python-format
msgid ""
"<li><b>%(display_name)s</b>: Received quantity %(product_qty)s %(uom)s</li>"
msgstr ""

#. module: purchase_reception_notify
#: model:mail.message.subtype,name:purchase_reception_notify.mt_purchase_reception
msgid "Purchase Receptions"
msgstr "采购收货"

#. module: purchase_reception_notify
#: code:addons/purchase_reception_notify/models/stock_picking.py:0
#, python-format
msgid "Receipt confirmation %s"
msgstr "收货确认 %s"

#. module: purchase_reception_notify
#: code:addons/purchase_reception_notify/models/stock_picking.py:0
#, python-format
msgid "The following items have now been received in Incoming Shipment %s:"
msgstr "已在收货单 %s 中收到下列产品:"

#. module: purchase_reception_notify
#: model:ir.model,name:purchase_reception_notify.model_stock_picking
msgid "Transfer"
msgstr "调拨"

#, python-format
#~ msgid "<li><b>%s</b>: Received quantity %s %s</li>"
#~ msgstr "<li><b>%s</b>:已收货数量 %s %s</li>"
1 change: 1 addition & 0 deletions purchase_reception_notify/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_picking
Loading
Loading