Skip to content

Commit

Permalink
Merge branch '12.0-imp-product_bom_revision-name-get' of git+ssh://gi…
Browse files Browse the repository at this point in the history
…thub.com/efatto/product-attribute into 12.0
  • Loading branch information
Pretecno committed Sep 24, 2024
2 parents cf111e3 + 3e670da commit 884000f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion product_bom_revision/models/mrp.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# Copyright 2019 C2i Change 2 improve - Eduardo Magdalena <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models
from odoo import _, api, fields, models


class MrpBom(models.Model):
_inherit = 'mrp.bom'

bom_revision = fields.Char(string="Revision")

@api.multi
def name_get(self):
result = []
for bom in self:
rec_name = "%s %s" % (
_("[Rev. %s]") % bom.bom_revision if bom.bom_revision else '',
bom.product_tmpl_id.name,
)
result.append((bom.id, rec_name))
return result

0 comments on commit 884000f

Please sign in to comment.