-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wms_connector: fix export, review product sync
- Loading branch information
1 parent
f196b4c
commit 233b3f5
Showing
5 changed files
with
33 additions
and
15 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
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
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,19 +1,32 @@ | ||
# Copyright 2023 Akretion | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
from odoo import api, fields, models | ||
|
||
|
||
class WmsProductSync(models.Model): | ||
_inherit = ["synchronize.exportable.mixin"] | ||
_name = "wms.product.sync" | ||
_description = "Wms Product Sync" | ||
|
||
name = fields.Char(related="product_id.name") | ||
product_id = fields.Many2one("product.product", required=True) | ||
warehouse_id = fields.Many2one("stock.warehouse", required=True) | ||
name = fields.Char( | ||
related="product_id.name", | ||
) | ||
product_id = fields.Many2one("product.product", required=True, readonly=True) | ||
warehouse_id = fields.Many2one("stock.warehouse", required=True, readonly=True) | ||
active = fields.Boolean(default=True) | ||
|
||
to_export = fields.Boolean(compute="_compute_to_export", store=True, readonly=False) | ||
|
||
@api.depends("product_id.name", "active") | ||
def _compute_to_export(self): | ||
for record in self: | ||
record.to_export = True | ||
|
||
def _schedule_export(self, warehouse, domain=False): | ||
warehouse.refresh_wms_products() | ||
return super()._schedule_export(warehouse, domain) | ||
|
||
def track_export(self, attachment): | ||
super().track_export(attachment) | ||
self.to_export = False |
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
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