Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from . import stock_release_channel
from . import toursolver_task
from . import shipment_advice
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2025 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class ShipmentAdvice(models.Model):

_inherit = "shipment.advice"

def create_toursolver_task(self):
self.ensure_one()
res = super().create_toursolver_task()
task = self.toursolver_task_id
rc = self.release_channel_id
task.release_channel_id = rc

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbejaoui Is the release_channel_id field defined on the job and not previously filled in?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

task.name = f"{task.name} {rc.name}"
return res

Check warning on line 18 in stock_release_channel_shipment_advice_toursolver/models/shipment_advice.py

View check run for this annotation

Codecov / codecov/patch

stock_release_channel_shipment_advice_toursolver/models/shipment_advice.py#L12-L18

Added lines #L12 - L18 were not covered by tests
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ def test_plan_shipment_toursolver(self):
)
self.assertTrue(self.channel.shipment_advice_ids)
self.assertEqual(self.channel.shipment_advice_ids, task.shipment_advice_ids)
self.assertEqual(task.release_channel_id, self.channel)