Skip to content

Commit

Permalink
[12.0][IMP] add revision to name get of bom
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiocorato committed May 10, 2022
1 parent 980a6c3 commit 3e670da
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 3e670da

Please sign in to comment.