Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit 0b4e991

Browse files
thomaspaulbntsirintanis
authored andcommitted
[IMP] use _notify_picking_problem also for returns
1 parent 2ce6cd5 commit 0b4e991

1 file changed

Lines changed: 5 additions & 23 deletions

File tree

purchase_sale_inter_company/wizard/stock_return_picking.py

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logging
22

3-
from odoo import SUPERUSER_ID, _, fields, models
3+
from odoo import _, models
44
from odoo.exceptions import UserError
55

66
_logger = logging.getLogger(__name__)
@@ -34,17 +34,8 @@ def create_returns(self):
3434
"counterpart in company {}: {}. This could not be automatically returned; "
3535
"please take care to do this manually."
3636
).format(ic_pick.company_id.name, ic_pick.name, pick.name)
37-
_logger.warning(note)
38-
pick.activity_schedule(
39-
"mail.mail_activity_data_todo",
40-
fields.Date.today(),
41-
note=note,
42-
# Try to notify someone relevant
43-
user_id=(
44-
pick.sale_id.user_id.id
45-
or pick.sale_id.team_id.user_id.id
46-
or SUPERUSER_ID,
47-
),
37+
self._notify_picking_problem(
38+
pick.sale_id.auto_purchase_order_id, additional_note=note
4839
)
4940
return res
5041

@@ -71,17 +62,8 @@ def create_returns(self):
7162
"counterpart in company {}: {}. This could not be automatically returned; "
7263
"please take care to do this manually."
7364
).format(ic_pick.company_id.name, ic_pick.name, pick.name)
74-
_logger.warning(note)
75-
pick.activity_schedule(
76-
"mail.mail_activity_data_todo",
77-
fields.Date.today(),
78-
note=note,
79-
# Try to notify someone relevant
80-
user_id=(
81-
pick.sale_id.user_id.id
82-
or pick.sale_id.team_id.user_id.id
83-
or SUPERUSER_ID,
84-
),
65+
self._notify_picking_problem(
66+
pick.sale_id.auto_purchase_order_id, additional_note=note
8567
)
8668
return res
8769

0 commit comments

Comments
 (0)