mirror of
https://github.com/bringout/oca-ocb-mrp.git
synced 2026-04-24 22:32:03 +02:00
19.0 vanilla
This commit is contained in:
parent
accf5918df
commit
6e65e8c877
688 changed files with 225434 additions and 199401 deletions
23
odoo-bringout-oca-ocb-mrp/mrp/models/product_document.py
Normal file
23
odoo-bringout-oca-ocb-mrp/mrp/models/product_document.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ProductDocument(models.Model):
|
||||
_inherit = 'product.document'
|
||||
|
||||
def _default_attached_on_mrp(self):
|
||||
return "bom" if self.env.context.get('attached_on_bom') else "hidden"
|
||||
|
||||
attached_on_mrp = fields.Selection(
|
||||
selection=[
|
||||
('hidden', "Hidden"),
|
||||
('bom', "Bill of Materials")
|
||||
],
|
||||
required=True,
|
||||
string="MRP : Visible at",
|
||||
help="Leave hidden if document only accessible on product form.\n"
|
||||
"Select Bill of Materials to visualise this document as a product attachment when this product is in a bill of material.",
|
||||
default=lambda self: self._default_attached_on_mrp(),
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue