-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wms_connector: ADD wms_connector_exported and is_wms_exportable fields
This allows to display the export to wms contextually and display wms_connector export state in tree view
- Loading branch information
1 parent
6923c08
commit 0f2e0a9
Showing
2 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
# Copyright 2023 Akretion | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models | ||
from odoo import api, fields, models | ||
|
||
|
||
class StockPicking(models.Model): | ||
_inherit = ["synchronize.exportable.mixin", "stock.picking"] | ||
_name = "stock.picking" | ||
|
||
wms_connector_exported = fields.Boolean(String="Exported to WMS", compute="_compute_wms_exported", readonly=True, store=True) | ||
is_wms_exportable = fields.Boolean(compute="_compute_is_wms_exportable", readonly=True, store=True) | ||
|
||
@api.depends("wms_export_attachment") | ||
def _compute_wms_exported(self): | ||
for rec in self: | ||
rec.wms_connector_exported = bool(rec.wms_export_attachment) | ||
|
||
@api.depends("picking_type_id.warehouse_id.active_wms_sync") | ||
def _compute_is_wms_exportable(self): | ||
for rec in self: | ||
rec.is_wms_exportable = rec.picking_type_id.warehouse_id.active_wms_sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters