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_request: Migration to 18.0 #2433

Open
wants to merge 173 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
d27758b
[ADD] purchase request modules
JordiBForgeFlow Sep 22, 2015
e57804f
[IMP] Add try me on runbot
JordiBForgeFlow Sep 22, 2015
7d1cb68
[FIX] Various fixes
JordiBForgeFlow Sep 25, 2015
3482e00
[FIX] fixed travis errors
JordiBForgeFlow Sep 25, 2015
c49f9f5
[IMP] Added message notifications on change of the status of the purc…
JordiBForgeFlow Oct 5, 2015
9518a88
[FIX] fixed group by error
JordiBForgeFlow Oct 9, 2015
158e2d4
[IMP] extend purchase request line search
JordiBForgeFlow Oct 9, 2015
f6558b2
[FIX] fixed search filter
JordiBForgeFlow Oct 9, 2015
f2b0a11
[FIX] adjustments to make the purchase request compatible with v8
JordiBForgeFlow Feb 17, 2016
a0aca74
[ENH] purchase_request, PR Line only filtered with non-Draft state
Feb 22, 2016
9c08c61
[ADD] translation files .pot
May 17, 2016
c074882
[CHG] greenify travis
May 27, 2016
7d3094a
[CHG] greenify travis and port ymal tests to python
May 27, 2016
11d1268
[CHG] add dependency on purchase_request_to_rfq
May 31, 2016
27bd751
[FIX] pull189#issuecomment-225476547
AaronHForgeFlow Jun 21, 2016
b177fde
[FIX] pull189 flake8 issues
AaronHForgeFlow Jun 21, 2016
da03e82
[FIX] pull189 discussion_r68006610
AaronHForgeFlow Jun 22, 2016
9a6653e
[UPT] Migrate code to v9
AaronHForgeFlow Aug 11, 2016
e79bb6d
[FIX] Readme
AaronHForgeFlow Aug 11, 2016
05aab5b
[FIX] subscribe assigned to as follower
JordiBForgeFlow Sep 9, 2016
32e72c4
[FIX] add assigned to as follower of purchase request
JordiBForgeFlow Sep 9, 2016
98f1059
[FIX] fixed handling of needaction mixing in v9
JordiBForgeFlow Sep 11, 2016
0b61971
[IMP] add filters for my requests, and requests assigned to me
JordiBForgeFlow Sep 12, 2016
353e2e4
[IMP] Adding rules for manager to see all PR. Remove domain.
AaronHForgeFlow Sep 12, 2016
3766d1a
[IMP] adding domain to analytic_account_id in PR line
AaronHForgeFlow Sep 12, 2016
01c7fde
[FIX] Take the first vendor as preferred supplier
AaronHForgeFlow Sep 12, 2016
562f844
[UPT] Contributors in readme
AaronHForgeFlow Sep 13, 2016
1489a43
[UPT] remove pot file and set demo data to no update
AaronHForgeFlow Sep 13, 2016
b53817e
[IMP] is_editable just depends on state. Added test case
AaronHForgeFlow Sep 13, 2016
3c47c50
[IMP] added test case
AaronHForgeFlow Sep 13, 2016
ffb2156
[FIX] standarize names of security rules
JordiBForgeFlow Sep 16, 2016
0f3737e
[MIG] Make modules uninstallable
pedrobaeza Oct 6, 2016
afc425d
[MIG] Rename manifest files
pedrobaeza Oct 6, 2016
0b16f20
Migration of purchase_request to 10.0
adrienpeiffer Oct 14, 2016
6ce0b7d
[FIX] Fix renamed attribute
Oct 28, 2016
f860658
[FIX][purchase_request] Give access on stock.move for purchase reques…
adrienpeiffer Dec 6, 2016
a52c56e
[FIX] Fix deprecated sequence usage
benwillig Apr 21, 2017
511a4d7
[FIX]purchase_request: s/users/implied_ids
zakiuu Jan 31, 2017
2b9707f
[FIX] purchase_request: avoid to have a loop on UOM change.
adrienpeiffer May 30, 2017
d4b6b6b
[9.0][IMP] purchase_request: add cancelled state to lines.
LoisRForgeFlow Jun 15, 2017
e49dda0
improve tests to cover auto-reject
LoisRForgeFlow Jun 15, 2017
caed9a8
show cancelled in forms and hide in trees
LoisRForgeFlow Jun 21, 2017
85d5f06
[9.0][IMP] purchase_request: add post-migration script.
LoisRForgeFlow Jun 21, 2017
80c4255
[REF] Removed version attribute from form xml node
benwillig Jun 29, 2017
c50ab05
[REF] Removed deprecated data xml node
benwillig Jun 29, 2017
4f39d3f
[ADD] 10.0.1.0.1 migration script
benwillig Jun 29, 2017
d14c5fa
[FIX] external_id product.product_product_14 doesn't exists in 10.0
benwillig Jun 29, 2017
fdce303
[FIX] cancelled field should not be copied on record duplication
benwillig Jun 30, 2017
a485f6d
[10.0][FIX] purchase_request: duplicate lines should be disallowed.
LoisRForgeFlow Aug 28, 2017
9754fed
[ADD][10.0] purchase_request_done_status
gmeficent Apr 27, 2017
59e01b5
[IMP] button methods
MiquelRForgeFlow Aug 16, 2017
862a28e
[FIX]account_type does was removed from analytic_account
AaronHForgeFlow Sep 22, 2017
a8eed69
[IMP] Disallow to request an approval for empty purchase requests
benwillig Oct 13, 2017
8c6bb24
Add purchase request line list from purchase request view
HviorForgeFlow Apr 23, 2018
b15e162
[MIG] purchase_request: Migration to 11.0 merge with purchase_request…
HviorForgeFlow Apr 25, 2018
97796b1
supplier must be a company
HviorForgeFlow Dec 5, 2018
c0b3551
display only purchase request related with supplier id
HviorForgeFlow Dec 5, 2018
7d8a783
supplier_id should be required as PO need reference a partner
HviorForgeFlow Dec 5, 2018
60eb5cc
review changes
HviorForgeFlow Dec 5, 2018
b784776
[purchase_request] fix in procurement
JordiBForgeFlow Dec 28, 2018
43a38b4
[11.0][IMP] purchase_request: Add Estimated cost field
HviorForgeFlow Mar 29, 2019
2f5cf95
purchase_request moigration V11 to V12
554513154 Jan 30, 2019
da52fed
[IMP]Search purchase requests by product. See purchase request lines …
AaronHForgeFlow Feb 5, 2019
93b714e
[FIX]product_id readonly in purchase request
AaronHForgeFlow Feb 6, 2019
9fd8add
[11.0][IMP] purchase_request: Allow change product on make PO
HviorForgeFlow Jun 3, 2019
5a4b552
Remove failing domain
hparfr Jul 26, 2019
2ca90c6
[ENH]purchase_request. Control qty allocation for purchase request lines
AaronHForgeFlow Jul 17, 2019
b216ad9
[ADD] migration analysis
MiquelRForgeFlow Jul 24, 2019
f24ceea
[ADD]purchase_request. Migration scritps
AaronHForgeFlow Jul 25, 2019
55f906f
[FIX] purchase_request: Always use Product Unit Of Measure precision
HviorForgeFlow Aug 27, 2019
5a1fdfb
[ENH]add qty_to_buy field for bettwer filtering
AaronHForgeFlow Sep 13, 2019
d6cf591
[11.0][FIX] purchase_request : ValueError: Expected singleton
Sep 23, 2019
fbe768b
[FIX]allocation creation when min_qty is greater than qty requested
AaronHForgeFlow Oct 1, 2019
7e6b190
[FIX] purchase_request: Don't copy allocation information on duplication
HviorForgeFlow Oct 8, 2019
1d78218
[IMP] purchase_request: store preferred supplier
HviorForgeFlow Oct 9, 2019
5d80ff1
Translated using Weblate (French)
kh-badep Oct 14, 2019
6ebeb7a
[FIX] Fix singleton error
Oct 18, 2019
8171b22
Translated using Weblate (Spanish (Ecuador))
ovnicraft Nov 16, 2019
047adcf
[FIX] purchase_request: allocations
HviorForgeFlow Nov 11, 2019
f44653f
[IMP] purchase_request: add button Create RFQ on purchase request for…
kos94ok-3D Nov 21, 2019
841f0fe
[FIX] purchase_request: fix test test_purchase_request_to_rfq_minimum…
kos94ok-3D Nov 21, 2019
b2ccaf1
[FIX]purchase_request migration to 12.0
AaronHForgeFlow Nov 22, 2019
3eac17d
Translated using Weblate (Portuguese (Brazil))
Nov 24, 2019
1c7b025
[ADD] purchase_request: test for wizard default_get
kos94ok-3D Nov 26, 2019
ff53319
Translated using Weblate (Italian)
Dec 3, 2019
e76e8e7
[IMP]requested by should not be copied when duplicating a purchase re…
AaronHForgeFlow Dec 11, 2019
66cdf6e
[IMP] purchase_request; black, isort
kongrattapong Jan 2, 2020
d887dbc
[MIG] purchase_request: Migration to 13.0
kongrattapong Jan 2, 2020
bfe2988
[FIX] purchase_requset
kongrattapong Jan 14, 2020
33c61e4
[FIX] Proper Run Buy implementation
HviorForgeFlow Jan 31, 2020
fe8dcf3
[IMP] purchase_request - unlinking of a pr or a prl is only possible …
baimont Mar 12, 2020
682e173
pre-commit update
OCA-git-bot Mar 14, 2020
852b976
Translated using Weblate (Chinese (Simplified))
dong-z Mar 23, 2020
252fe85
[12.0][FIX] purchase_request: allow Purchase users to see purchase re…
etobella Mar 4, 2020
2fa807d
Translated using Weblate (Chinese (Simplified))
dong-z Mar 24, 2020
7222a1d
Translated using Weblate (Italian)
alessandro-fiorino May 18, 2020
fb2c1de
[13.0] [FIX] purchase_request: disable creation from form view
sswapnesh Jun 6, 2020
31a468d
[REF] purchase_request: reuse default method code in copy
ThomasBinsfeld Aug 14, 2020
0cd4813
[IMP] Purchase Request: add some missing indexes
ThomasBinsfeld Aug 27, 2020
12fe98c
[FIX] Delete empty " " spaces in same string line
MiquelRForgeFlow Sep 30, 2020
ff9c9eb
[IMP] purchase_request: Speed up stock_move company constraint
moylop260 Sep 23, 2020
4b6e839
[IMP] purchase_request: black, isort, prettier
HviorForgeFlow Oct 15, 2020
0457d12
[MIG] purchase_request: Migration to 14.0
HviorForgeFlow Oct 15, 2020
7f6388b
[13.0][FIX] purchase_request: multi-company rules
LoisRForgeFlow Oct 20, 2020
dbd8c19
[IMP] purchase_request: Make product.template#purchase_request a prop…
hbrunn Oct 22, 2020
3d0962f
Translated using Weblate (Spanish)
extrememicro Jan 5, 2021
d2ad466
[IMP] various: improve code style and performance by improve ``all()`…
tanghulu0608 Jan 11, 2021
f924585
Translated using Weblate (Spanish (Mexico))
alan196 Feb 2, 2021
8155058
[IMP] purchase_request: index on created_purchase_request_line_id (st…
ThomasBinsfeld Feb 18, 2021
12e4593
[14.0][IMP] purchase_request, auto sequence only when saved
kittiu Feb 23, 2021
89c8fe1
[IMP] purchase_request: Add analytic tags and propagate to PO
joao-p-marques Mar 9, 2021
5df159c
[14.0][FIX] purchase_request, action.sudo().read()
kittiu May 20, 2021
d742547
[14.0][IMP] purchase_request, use tracking=True
kittiu Jun 2, 2021
004c671
Update purchase_request_view.xml
Jun 17, 2021
9b62069
[14.0][IMP] Add seperator tag on filter state
newtratip Jun 18, 2021
ab0947f
[14.0][IMP] purchase_request, add total estimated cost on PR head
kittiu Jul 20, 2021
cae4f98
Translated using Weblate (Spanish (Mexico))
alan196 Aug 9, 2021
54d1510
[FIX] Compute preferred supplier in multicompany
astirpe Aug 2, 2021
bde4bd0
[IMP] purchase_request: add test for supplier assignment
StefanRijnhart Aug 10, 2021
208cc20
[14.0][FIX] purchase_request: 'tree_view_ref' requires a fully-qualif…
auroraeosrose Sep 14, 2021
ad7c913
Allow to make partial PO from a PR
alessandro-fiorino Oct 18, 2021
9277d92
[MIG] purchase_request: Migration to 15.0
HviorForgeFlow Oct 26, 2021
c56449a
purchase_request: fix _compute_qty_to_buy
ajaniszewska-dev Mar 29, 2022
4d3f576
[FIX] Fixed unit test case
Nikul-OSI Apr 13, 2022
5fb1894
[FW][FIX]purchase_request: add product_uom_id domain
vib-adhoc Aug 23, 2022
41d00e5
Translated using Weblate (Portuguese (Brazil))
douglascstd Oct 3, 2022
3da32b0
[MIG] purchase_request: Migration to 16.0
StefanRijnhart Nov 25, 2022
303b579
[FIX] purchase_request: increase coverage and fix bugs
StefanRijnhart Nov 30, 2022
d5e2bed
Translated using Weblate (Italian)
francesco-ooops Jan 2, 2023
bd92e0d
Translated using Weblate (Croatian)
badbole Feb 15, 2023
5a10658
purchase_request add new icon with svg file.
youring Mar 16, 2023
f9013d8
Translated using Weblate (Italian)
mymage Mar 23, 2023
bb4f905
Translated using Weblate (Slovenian)
sysadminmatmoz Mar 30, 2023
3bfbcc2
Translated using Weblate (Italian)
francesco-ooops Apr 17, 2023
484002b
Update translation files
weblate May 15, 2023
65bb19d
Translated using Weblate (Portuguese (Brazil))
adrianojprado Jun 11, 2023
d443b03
Translated using Weblate (Spanish)
Ivorra78 Jul 20, 2023
4c4af44
Convert purchase_request readme fragments to markdown
sbidoul Sep 13, 2023
05ad38a
[IMP] purchase_request: pre-commit stuff
HviorForgeFlow Sep 14, 2023
f3b0d5f
[FIX] purchase_request: default payment_terms when create RFQ
Saran440 Sep 4, 2023
42d23ec
Translated using Weblate (Turkish)
tate11 Nov 5, 2023
e50ffa5
[IMP] purchase_request: pre-commit auto fixes
Jan 9, 2024
16f5011
[MIG] purchase_requrest: Migrate to version 17.0
Jan 10, 2024
ff087b3
[UPD] Update purchase_request.pot
Jan 25, 2024
b58d11d
[BOT] post-merge updates
OCA-git-bot Jan 25, 2024
8bdadfb
Update translation files
weblate Feb 3, 2024
3cad781
Translated using Weblate (Spanish)
Ivorra78 Feb 11, 2024
1e00364
Translated using Weblate (Italian)
mymage Feb 13, 2024
a0feee3
Translated using Weblate (Italian)
mymage Feb 14, 2024
c9ad7a9
Purchase Request App Icon adapted to the new milk style imperfectly.
youring Feb 25, 2024
341204d
[BOT] post-merge updates
OCA-git-bot Feb 29, 2024
567d4d1
Translated using Weblate (Italian)
mymage Mar 15, 2024
e13064c
Translated using Weblate (Italian)
mymage Mar 19, 2024
6f679d7
[IMP] purchase_request: add UTC time to scheduled_date
augusto-weiss Apr 10, 2024
bc294b8
Translated using Weblate (Italian)
mymage Apr 15, 2024
161e7ad
[BOT] post-merge updates
OCA-git-bot Apr 17, 2024
74c2a97
[FIX] purchase_request: changes in report layout
ced-adhoc Apr 3, 2024
d02cc9a
Translated using Weblate (Italian)
mymage May 2, 2024
5e5430c
[FIX] purchase*: pre-commit fixes
pedrobaeza May 2, 2024
e5e424c
[BOT] post-merge updates
OCA-git-bot May 2, 2024
ccfd75f
[BOT] post-merge updates
OCA-git-bot May 28, 2024
475d45a
Translated using Weblate (Swedish)
jakobkrabbe Jun 11, 2024
d0b8e27
[UPD] Update purchase_request.pot
Jul 22, 2024
3455242
Update translation files
weblate Jul 22, 2024
244ea71
Translated using Weblate (Italian)
mymage Aug 20, 2024
71c67e8
Translated using Weblate (Italian)
mymage Aug 22, 2024
60cd911
Translated using Weblate (Italian)
mymage Aug 23, 2024
ab84903
[17.0][FIX] purchase_request: remove boolean_toggle on wizard view
FernandoGuzmanA Sep 6, 2024
afc981f
[BOT] post-merge updates
OCA-git-bot Sep 6, 2024
658d286
[FIX] purchase_request: message_post with html fixed
matiasperalta1 May 2, 2024
8788427
[BOT] post-merge updates
OCA-git-bot Oct 9, 2024
6e91ce8
[IMP] purchase_request: pre-commit auto fixes
quoc-pn Oct 12, 2024
8cfffce
[MIG] purchase_request: Migration to 18.0
quoc-pn Oct 18, 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
44 changes: 24 additions & 20 deletions purchase_request/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Purchase Request
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpurchase--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/purchase-workflow/tree/17.0/purchase_request
:target: https://github.com/OCA/purchase-workflow/tree/18.0/purchase_request
: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-17-0/purchase-workflow-17-0-purchase_request
:target: https://translation.odoo-community.org/projects/purchase-workflow-18-0/purchase-workflow-18-0-purchase_request
: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=17.0
: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|
Expand Down Expand Up @@ -85,9 +85,9 @@ To configure the product follow this steps:
Note that MTO route is archived by default, you should unarchive it
first:

- Go to Inventory > Configuration > Routes, in the Search dropdown
menu, click *Archived* to show *Replenish on Order (MTO)* route and
*Unarchive* it.
- Go to Inventory > Configuration > Routes, in the Search dropdown menu,
click *Archived* to show *Replenish on Order (MTO)* route and
*Unarchive* it.

With this configuration, whenever a procurement order is created and the
supply rule selected is 'Buy' the application will create a Purchase
Expand All @@ -110,7 +110,7 @@ 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_request%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/purchase-workflow/issues/new?body=module:%20purchase_request%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.

Expand All @@ -125,27 +125,31 @@ Authors
Contributors
------------

- Jordi Ballester Alomar <[email protected]>
- Jordi Ballester Alomar <[email protected]>

- Jonathan Nemry <[email protected]>
- Jonathan Nemry <[email protected]>

- Aaron Henriquez <[email protected]>
- Aaron Henriquez <[email protected]>

- Adrien Peiffer <[email protected]>
- Adrien Peiffer <[email protected]>

- Lois Rilo <[email protected]>
- Lois Rilo <[email protected]>

- Héctor Villarreal <[email protected]>
- Héctor Villarreal <[email protected]>

- Ben Cai <[email protected]>
- Ben Cai <[email protected]>

- Rattapong Chokmasermkul <[email protected]>
- Rattapong Chokmasermkul <[email protected]>

- Stefan Rijnhart <[email protected]>
- Stefan Rijnhart <[email protected]>

- ``Trobz <https://trobz.com>``\ \_:
- ``Trobz <https://trobz.com>``\ \_:

- Son Ho [email protected]
- Son Ho [email protected]

- `Komit Company Limited <https://komit-consulting.com/>`__:

- Quoc Pham Ngoc <[email protected]>

Other credits
-------------
Expand All @@ -157,7 +161,7 @@ The development of this module has been financially supported by:
Images
~~~~~~

- Enric Tobella (logo)
- Enric Tobella (logo)

.. |Aleph Objects, Inc| image:: https://upload.wikimedia.org/wikipedia/en/3/3b/Aleph_Objects_Logo.png
:target: https://www.alephobjects.com
Expand All @@ -175,6 +179,6 @@ 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/17.0/purchase_request>`_ project on GitHub.
This module is part of the `OCA/purchase-workflow <https://github.com/OCA/purchase-workflow/tree/18.0/purchase_request>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion purchase_request/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Purchase Request",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"version": "17.0.1.2.2",
"version": "18.0.1.0.0",
"summary": "Use this module to have notification of requirements of "
"materials and/or external services and keep track of such "
"requirements.",
Expand Down
45 changes: 21 additions & 24 deletions purchase_request/models/purchase_order.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright 2018-2019 ForgeFlow, S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)

from markupsafe import Markup

from odoo import _, api, exceptions, fields, models


Expand All @@ -15,14 +17,13 @@ def _purchase_request_confirm_message_content(self, request, request_dict=None):
"po_name": self.name,
"pr_name": request.name,
}
message = "<h3>%s</h3><ul>" % title
message = f"<h3>{title}</h3><ul>"
message += _(
"The following requested items from Purchase Request %(pr_name)s "
"have now been confirmed in Purchase Order %(po_name)s:"
) % {
"po_name": self.name,
"pr_name": request.name,
}
"have now been confirmed in Purchase Order %(po_name)s:",
po_name=self.name,
pr_name=request.name,
)

for line in request_dict.values():
message += _(
Expand All @@ -46,7 +47,7 @@ def _purchase_request_confirm_message(self):
request_id = request_line.request_id.id
if request_id not in requests_dict:
requests_dict[request_id] = {}
date_planned = "%s" % line.date_planned
date_planned = line.date_planned
data = {
"name": request_line.name,
"product_qty": line.product_qty,
Expand All @@ -60,9 +61,8 @@ def _purchase_request_confirm_message(self):
request, requests_dict[request_id]
)
request.message_post(
body=message,
body=Markup(message),
subtype_id=self.env.ref("mail.mt_comment").id,
body_is_html=True,
)
return True

Expand Down Expand Up @@ -132,7 +132,7 @@ def action_open_request_line_tree_view(self):
"name": _("Purchase Request Lines"),
"type": "ir.actions.act_window",
"res_model": "purchase.request.line",
"view_mode": "tree,form",
"view_mode": "list,form",
"domain": domain,
}

Expand Down Expand Up @@ -182,9 +182,8 @@ def update_service_allocations(self, prev_qty_received):
message_data
)
alloc.purchase_request_line_id.request_id.message_post(
body=message,
body=Markup(message),
subtype_id=self.env.ref("mail.mt_comment").id,
body_is_html=True,
)

alloc.purchase_request_line_id._compute_qty()
Expand All @@ -195,24 +194,22 @@ def _purchase_request_confirm_done_message_content(self, message_data):
title = (
_("Service confirmation for Request %s") % (message_data["request_name"])
)
message = "<h3>%s</h3>" % title
message = f"<h3>{title}</h3>"
message += _(
"The following requested services from Purchase"
" Request %(request_name)s requested by %(requestor)s "
"have now been received:"
) % {
"request_name": message_data["request_name"],
"requestor": message_data["requestor"],
}
"have now been received:",
request_name=message_data["request_name"],
requestor=message_data["requestor"],
)
message += "<ul>"
message += _(
"<li><b>%(product_name)s</b>: "
"Received quantity %(product_qty)s %(product_uom)s</li>"
) % {
"product_name": message_data["product_name"],
"product_qty": message_data["product_qty"],
"product_uom": message_data["product_uom"],
}
"Received quantity %(product_qty)s %(product_uom)s</li>",
product_name=message_data["product_name"],
product_qty=message_data["product_qty"],
product_uom=message_data["product_uom"],
)
message += "</ul>"
return message

Expand Down
5 changes: 3 additions & 2 deletions purchase_request/models/purchase_request_allocation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright 2019 ForgeFlow, S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)

from markupsafe import Markup

from odoo import _, api, fields, models


Expand Down Expand Up @@ -128,7 +130,6 @@ def _notify_allocation(self, allocated_qty):
message_data = self._prepare_message_data(po_line, request, allocated_qty)
message = self._purchase_request_confirm_done_message_content(message_data)
request.message_post(
body=message,
body=Markup(message),
subtype_id=self.env.ref("mail.mt_comment").id,
body_is_html=True,
)
70 changes: 33 additions & 37 deletions purchase_request/models/stock_move_line.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright 2017 ForgeFlow, S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0)

from markupsafe import Markup

from odoo import _, api, models


Expand All @@ -10,57 +12,53 @@ class StockMoveLine(models.Model):
@api.model
def _purchase_request_confirm_done_message_content(self, message_data):
title = _(
"Receipt confirmation %(picking_name)s for your Request %(request_name)s"
) % {
"picking_name": message_data["picking_name"],
"request_name": message_data["request_name"],
}
message = "<h3>%s</h3>" % title
"Receipt confirmation %(picking_name)s for your Request %(request_name)s",
picking_name=message_data["picking_name"],
request_name=message_data["request_name"],
)
message = f"<h3>{title}</h3>"
message += _(
"The following requested items from Purchase Request %(request_name)s "
"have now been received in %(location_name)s using Picking "
"%(picking_name)s:"
) % {
"request_name": message_data["request_name"],
"location_name": message_data["location_name"],
"picking_name": message_data["picking_name"],
}
"%(picking_name)s:",
request_name=message_data["request_name"],
location_name=message_data["location_name"],
picking_name=message_data["picking_name"],
)
message += "<ul>"
message += _(
"<li><b>%(product_name)s</b>: "
"Transferred quantity %(product_qty)s %(product_uom)s</li>"
) % {
"product_name": message_data["product_name"],
"product_qty": message_data["product_qty"],
"product_uom": message_data["product_uom"],
}
"Transferred quantity %(product_qty)s %(product_uom)s</li>",
product_name=message_data["product_name"],
product_qty=message_data["product_qty"],
product_uom=message_data["product_uom"],
)
message += "</ul>"
return message

@api.model
def _picking_confirm_done_message_content(self, message_data):
title = (
_("Receipt confirmation for Request %s") % (message_data["request_name"])
title = _(
"Receipt confirmation for Request %(name)s",
name=message_data["request_name"],
)
message = "<h3>%s</h3>" % title
message = f"<h3>{title}</h3>"
message += _(
"The following requested items from Purchase Request %(request_name)s "
"requested by %(requestor)s "
"have now been received in %(location_name)s:"
) % {
"request_name": message_data["request_name"],
"requestor": message_data["requestor"],
"location_name": message_data["location_name"],
}
"have now been received in %(location_name)s:",
request_name=message_data["request_name"],
requestor=message_data["requestor"],
location_name=message_data["location_name"],
)
message += "<ul>"
message += _(
"<li><b>%(product_name)s</b>: "
"Transferred quantity %(product_qty)s %(product_uom)s</li>"
) % {
"product_name": message_data["product_name"],
"product_qty": message_data["product_qty"],
"product_uom": message_data["product_uom"],
}
"Transferred quantity %(product_qty)s %(product_uom)s</li>",
product_name=message_data["product_name"],
product_qty=message_data["product_qty"],
product_uom=message_data["product_uom"],
)
message += "</ul>"
return message

Expand Down Expand Up @@ -107,18 +105,16 @@ def allocate(self):
message_data
)
request.message_post(
body=message,
body=Markup(message),
subtype_id=self.env.ref("mail.mt_comment").id,
body_is_html=True,
)

picking_message = self._picking_confirm_done_message_content(
message_data
)
ml.move_id.picking_id.message_post(
body=picking_message,
body=Markup(picking_message),
subtype_id=self.env.ref("mail.mt_comment").id,
body_is_html=True,
)

allocation._compute_open_product_qty()
Expand Down
2 changes: 2 additions & 0 deletions purchase_request/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
- `Trobz <https://trobz.com>`_:

* Son Ho <[email protected]>
- [Komit Company Limited](https://komit-consulting.com/):
- Quoc Pham Ngoc \<<[email protected]>\>
4 changes: 2 additions & 2 deletions purchase_request/reports/report_purchase_request.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<t t-foreach="docs" t-as="o">
<t t-call="web.external_layout">
<div class="page">
<div class="oe_structure" />
<div id="oe_structure_report_request_1" class="oe_structure" />
<h2>
Purchase Request
<span t-field="o.name" />
Expand Down Expand Up @@ -115,7 +115,7 @@
</tbody>
</table>
</t>
<div class="oe_structure" />
<div id="oe_structure_report_request_2" class="oe_structure" />
</div>
</t>
</t>
Expand Down
Loading
Loading