-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] mrp_production_batch: new improvements and implementations.
- Loading branch information
Showing
22 changed files
with
701 additions
and
158 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,5 +1,7 @@ | ||
from . import mrp_production | ||
from . import mrp_production_batch | ||
|
||
# from . import stock_move | ||
from . import stock_picking_type | ||
from . import res_config_settings | ||
from . import mrp_bom_line | ||
from . import stock_production_lot | ||
from . import res_company |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright NuoBiT Solutions - Frank Cespedes <fcespedes@nuobit.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
from odoo import _, api, fields, models | ||
from odoo.exceptions import ValidationError | ||
|
||
|
||
class MrpBomLine(models.Model): | ||
_inherit = "mrp.bom.line" | ||
|
||
use_in_batch = fields.Boolean() | ||
|
||
@api.constrains("use_in_batch") | ||
def _check_use_in_batch(self): | ||
for rec in self: | ||
if len(rec.bom_id.bom_line_ids.filtered(lambda x: x.use_in_batch)) > 1: | ||
raise ValidationError( | ||
_("You can't set more than one component to be used in a batch.") | ||
) |
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
Oops, something went wrong.