Skip to content

Commit

Permalink
[IMP] use _notify_picking_problem also for returns
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaspaulb committed Sep 19, 2024
1 parent 6db845e commit 96ba1c2
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions purchase_sale_inter_company/wizard/stock_return_picking.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from odoo import SUPERUSER_ID, _, fields, models
from odoo import _, models
from odoo.exceptions import UserError

_logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -34,17 +34,8 @@ def create_returns(self):
"counterpart in company {}: {}. This could not be automatically returned; "
"please take care to do this manually."
).format(ic_pick.company_id.name, ic_pick.name, pick.name)
_logger.warning(note)
pick.activity_schedule(
"mail.mail_activity_data_todo",
fields.Date.today(),
note=note,
# Try to notify someone relevant
user_id=(
pick.sale_id.user_id.id
or pick.sale_id.team_id.user_id.id
or SUPERUSER_ID,
),
self._notify_picking_problem(
pick.sale_id.auto_purchase_order_id, additional_note=note
)
return res

Expand All @@ -71,17 +62,8 @@ def create_returns(self):
"counterpart in company {}: {}. This could not be automatically returned; "
"please take care to do this manually."
).format(ic_pick.company_id.name, ic_pick.name, pick.name)
_logger.warning(note)
pick.activity_schedule(
"mail.mail_activity_data_todo",
fields.Date.today(),
note=note,
# Try to notify someone relevant
user_id=(
pick.sale_id.user_id.id
or pick.sale_id.team_id.user_id.id
or SUPERUSER_ID,
),
self._notify_picking_problem(
pick.sale_id.auto_purchase_order_id, additional_note=note
)
return res

Expand Down

0 comments on commit 96ba1c2

Please sign in to comment.