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
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": "19.0.1.0.1",
"version": "19.0.1.0.2",
"summary": "Use this module to have notification of requirements of "
"materials and/or external services and keep track of such "
"requirements.",
Expand Down
41 changes: 24 additions & 17 deletions purchase_request/i18n/purchase_request.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,17 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 19.0\n"
"Project-Id-Version: Odoo Server 19.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-06-29 20:25+0000\n"
"PO-Revision-Date: 2026-06-29 20:25+0000\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_request
#. odoo-python
#: code:addons/purchase_request/models/purchase_order.py:0
msgid ""
"<li><b>%(prl_name)s</b>: Ordered quantity %(prl_qty)s %(prl_uom)s, Planned "
"date %(prl_date_planned)s</li>"
msgstr ""

#. module: purchase_request
#. odoo-python
#: code:addons/purchase_request/models/purchase_request_allocation.py:0
msgid ""
"<li><b>%(product_name)s</b>: Received quantity %(product_qty)s "
"%(product_uom)s</li>"
msgstr ""

#. module: purchase_request
#: model_terms:ir.ui.view,arch_db:purchase_request.report_purchase_request
msgid "<strong>Analytic Distribution</strong>"
Expand Down Expand Up @@ -482,7 +468,9 @@ msgstr ""

#. module: purchase_request
#: model:ir.model.fields,help:purchase_request.field_purchase_request__message_has_error
#: model:ir.model.fields,help:purchase_request.field_purchase_request__message_has_sms_error
#: model:ir.model.fields,help:purchase_request.field_purchase_request_line__message_has_error
#: model:ir.model.fields,help:purchase_request.field_purchase_request_line__message_has_sms_error
msgid "If checked, some messages have a delivery error."
msgstr ""

Expand Down Expand Up @@ -662,6 +650,13 @@ msgstr ""
msgid "Order confirmation %(po_name)s for your Request %(pr_name)s"
msgstr ""

#. module: purchase_request
#. odoo-python
#: code:addons/purchase_request/models/purchase_order.py:0
msgid ""
"Ordered quantity %(prl_qty)s %(prl_uom)s, Planned date %(prl_date_planned)s"
msgstr ""

#. module: purchase_request
#: model:ir.model.fields,field_description:purchase_request.field_purchase_request_line__orderpoint_id
msgid "Orderpoint"
Expand Down Expand Up @@ -1014,6 +1009,12 @@ msgstr ""
msgid "Received quantity"
msgstr ""

#. module: purchase_request
#. odoo-python
#: code:addons/purchase_request/models/purchase_request_allocation.py:0
msgid "Received quantity %(product_qty)s %(product_uom)s"
msgstr ""

#. module: purchase_request
#: model_terms:ir.ui.view,arch_db:purchase_request.view_purchase_request_form
msgid "Reject"
Expand Down Expand Up @@ -1124,6 +1125,12 @@ msgstr ""
msgid "Responsible User"
msgstr ""

#. module: purchase_request
#: model:ir.model.fields,field_description:purchase_request.field_purchase_request__message_has_sms_error
#: model:ir.model.fields,field_description:purchase_request.field_purchase_request_line__message_has_sms_error
msgid "SMS Delivery error"
msgstr ""

#. module: purchase_request
#: model_terms:ir.ui.view,arch_db:purchase_request.purchase_order_line_search_sub
msgid "Search Purchase Order Line"
Expand Down
19 changes: 11 additions & 8 deletions purchase_request/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,27 @@ def _purchase_request_confirm_message_content(self, request, request_dict=None):
po_name=self.name,
pr_name=request.name,
)
message = f"<h3>{title}</h3><ul>"
message += self.env._(
intro = self.env._(
"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,
)
message = Markup("<h3>{}</h3>{}<ul>").format(title, intro)

for line in request_dict.values():
message += self.env._(
"<li><b>%(prl_name)s</b>: Ordered quantity %(prl_qty)s %(prl_uom)s, "
"Planned date %(prl_date_planned)s</li>",
prl_name=html_escape(line["name"]),
line_text = self.env._(
"Ordered quantity %(prl_qty)s %(prl_uom)s, "
"Planned date %(prl_date_planned)s",
prl_qty=line["product_qty"],
prl_uom=line["product_uom"],
prl_date_planned=line["date_planned"],
)
message += "</ul>"
message += Markup("<li><b>{}</b>: {}</li>").format(
html_escape(line["name"]),
line_text,
)
message += Markup("</ul>")
return message

def _purchase_request_confirm_message(self):
Expand All @@ -62,7 +65,7 @@ def _purchase_request_confirm_message(self):
request, requests_dict[request_id]
)
request.message_post(
body=Markup(message),
body=message,
subtype_id=self.env.ref(
"purchase_request.mt_request_po_confirmed"
).id,
Expand Down
19 changes: 9 additions & 10 deletions purchase_request/models/purchase_request_allocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,20 @@ def _compute_open_product_qty(self):

@api.model
def _purchase_request_confirm_done_message_content(self, message_data):
message = ""
message += self.env._(
message_body = self.env._(
"From last reception this quantity has been "
"allocated to this purchase request"
)
message += "<ul>"
message += self.env._(
"<li><b>%(product_name)s</b>: "
"Received quantity %(product_qty)s %(product_uom)s</li>",
product_name=html_escape(message_data["product_name"]),
line_text = self.env._(
"Received quantity %(product_qty)s %(product_uom)s",
product_qty=message_data["product_qty"],
product_uom=message_data["product_uom"],
)
message += "</ul>"
return message
product_line = Markup("<ul><li><b>{}</b>: {}</li></ul>").format(
html_escape(message_data["product_name"]),
line_text,
)
return Markup("{}{}").format(message_body, product_line)

def _prepare_message_data(self, po_line, request, allocated_qty):
return {
Expand All @@ -130,6 +129,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=Markup(message),
body=message,
subtype_id=self.env.ref("mail.mt_note").id,
)
Loading