diff --git a/plm/__manifest__.py b/plm/__manifest__.py index e959ec57..1192758d 100644 --- a/plm/__manifest__.py +++ b/plm/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################## { "name": "Product Lifecycle Management", - "version": "18.0.2.0.0", + "version": "18.0.3.0.0", "author": "OmniaSolutions", "website": "https://odooplm.omniasolutions.website", "category": "Manufacturing/Product Lifecycle Management (PLM)", diff --git a/plm/models/mrp_bom_line.py b/plm/models/mrp_bom_line.py index bad86580..031ef590 100755 --- a/plm/models/mrp_bom_line.py +++ b/plm/models/mrp_bom_line.py @@ -146,7 +146,7 @@ def openRelatedBoms(self): domain.append(('type', 'in', ['normal','subcontract', 'phantom'])) out_act_dict['view_ids'] = [ (5, 0, 0), - (0, 0, {'view_mode': 'list', 'view_id': self.env.ref('plm.plm_bom_tree_view').id}), + (0, 0, {'view_mode': 'list', 'view_id': self.env.ref('plm.plm_bom_list_view').id}), (0, 0, {'view_mode': 'form', 'view_id': self.env.ref('plm.plm_bom_form_view').id}) ] elif line_brws.type == 'spbom': @@ -222,8 +222,6 @@ def _related_doc_ids(self): product_tag_ids = fields.Many2many(related='product_tmpl_id.product_tag_ids') - product_tumbnail = fields.Image(related="product_id.product_tmpl_id.image_1920") - def go_to_product(self): return {'name': _('Product'), 'res_model': 'product.product', diff --git a/plm/models/plm_client.py b/plm/models/plm_client.py index 5945a5ea..b3625e7d 100644 --- a/plm/models/plm_client.py +++ b/plm/models/plm_client.py @@ -176,5 +176,5 @@ def attachmentCheckOut(self, return brwItem.checkout(hostName=hostName, hostPws=hostPws, showError=showError) - return True, '' + return True, '' \ No newline at end of file diff --git a/plm/models/product_template.py b/plm/models/product_template.py index 3aa1e2e7..02037445 100755 --- a/plm/models/product_template.py +++ b/plm/models/product_template.py @@ -73,7 +73,12 @@ class ProductTemplate(models.Model): compute=lambda self: self._compute_eng_code_editable() ) kit_bom = fields.Boolean(_('KIT Bom Type')) + + linkeddocuments = fields.Many2many(related="product_variant_id.linkeddocuments") + def action_open_linked_field(self, related_field): + return self.product_variant_id.action_open_linked_field(related_field) + def unlinkCheckBomRelations(self): def print_where_struct(self, where_struct): @@ -207,15 +212,16 @@ def init(self): """) def getSequenceFrom(self, prefix, digit, start_number= 0): - plm_prefix = "PLM_SEQUENCE_%s" % prefix + plm_prefix = f"PLM_SEQUENCE_{prefix}" sequence=None for sequence in self.env['ir.sequence'].sudo().search([('code','=', plm_prefix)]): break return sequence.next_by_id() if not sequence: sequence = self.env['ir.sequence'].sudo().create({ - 'name': "Plm Autocreate sequence %s " % prefix, + 'name': f"Plm Autocreate sequence {prefix} ", 'code': plm_prefix, + 'prefix':prefix, 'number_increment':1, 'number_next_actual':start_number, 'padding': digit diff --git a/plm/static/src/js/many2one_widget/many2one_widget.js b/plm/static/src/js/many2one_widget/many2one_widget.js index 8d36ccd8..8f2523f3 100644 --- a/plm/static/src/js/many2one_widget/many2one_widget.js +++ b/plm/static/src/js/many2one_widget/many2one_widget.js @@ -38,7 +38,7 @@ export class PlmMany2oneWidget extends Many2OneField { }); if (this.props && this.props.record && this.props.record.data && this.props.record.data[this.props.name] && this.props.record.data[this.props.name].length != 0) { - + let imageData = await this.env.model.orm.call(this.relation, "search_read", [], { domain: [["id", "=", this.props.record.data[this.props.name][0]]], fields: [this.props.options.image_field], diff --git a/plm/views/mrp_extension.xml b/plm/views/mrp_extension.xml index 4eacfac0..62b5afe2 100755 --- a/plm/views/mrp_extension.xml +++ b/plm/views/mrp_extension.xml @@ -7,8 +7,9 @@ mrp.bom.line - - + -