Files
manufacture/mrp_request_workcenter_cycle/models/request_workcenter.py
2020-12-09 21:36:28 +01:00

33 lines
1.1 KiB
Python
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Copyright 2020 David BEAL @ Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class MrpRequestWorkcenter(models.Model):
_name = "mrp.request.workcenter"
_description = "Workcenters attached to Production Request"
request_id = fields.Many2one(
comodel_name="mrp.production.request", string="Production Request"
)
workcenter_id = fields.Many2one(
comodel_name="mrp.workcenter", string="Workcenter", required=True
)
workcenter_cycle_no = fields.Float(
string="Cycles",
default="1",
help="A cycle is complete ended process for the machine.\n"
"Multiple cycles are several machines of the same kind in parallel "
"or the same machine used several times.",
)
product_qty = fields.Float(string="Products by cycle")
_sql_constraints = [
(
"request_workcenter_unique",
"UNIQUE(workcenter_id,request_id)",
"Workcenter field must be unique by manufacturing request",
)
]