diff --git a/plm/__manifest__.py b/plm/__manifest__.py index f298e3ae..6706df0e 100644 --- a/plm/__manifest__.py +++ b/plm/__manifest__.py @@ -20,7 +20,7 @@ ############################################################################## { "name": "Product Lifecycle Management", - "version": "16.0.13", + "version": "16.0.14", "author": "OmniaSolutions", "website": "https://odooplm.omniasolutions.website", "category": "Manufacturing/Product Lifecycle Management (PLM)", diff --git a/plm/models/ir_attachment.py b/plm/models/ir_attachment.py index d1a377b7..f8c982ab 100755 --- a/plm/models/ir_attachment.py +++ b/plm/models/ir_attachment.py @@ -107,7 +107,7 @@ class IrAttachment(models.Model): is_library = fields.Boolean("Is Library file", default=False) library_path = fields.Char("File library path") - + def getPrintoutUrl(self): self.ensure_one() base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url') @@ -928,6 +928,8 @@ def create(self, vals): return super(IrAttachment, self).create(vals) to_create_vals=[] for vals_dict in vals: + if 'engineering_state' not in vals: + vals_dict['engineering_state']=START_STATUS vals_dict['is_plm'] = True vals_dict.update(self.checkMany2oneClient(vals_dict)) vals_dict = self.plm_sanitize(vals_dict) @@ -1878,7 +1880,7 @@ def canCheckOut(self, showError=False): if showError: raise UserError(msg) return False, msg - if docBrws.engineering_state != START_STATUS: + if docBrws.engineering_state not in [START_STATUS, False]: msg = _("Unable to check-Out a document that is in state %r" % docBrws.engineering_state) if showError: raise UserError(msg) diff --git a/plm/models/product_template.py b/plm/models/product_template.py index c4df5335..900ac8fa 100755 --- a/plm/models/product_template.py +++ b/plm/models/product_template.py @@ -208,11 +208,11 @@ def init(self): def getSequenceFrom(self, prefix, digit, start_number= 0): plm_prefix = "PLM_SEQUENCE_%s" % prefix sequence=None - for sequence in self.env['ir.sequence'].search([('code','=', plm_prefix)]): + 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'].create({ + sequence = self.env['ir.sequence'].sudo().create({ 'name': "Plm Autocreate sequence %s " % prefix, 'code': plm_prefix, 'number_increment':1, diff --git a/plm/report/bom_document.xml b/plm/report/bom_document.xml index ea5ce85b..d187aabd 100644 --- a/plm/report/bom_document.xml +++ b/plm/report/bom_document.xml @@ -4,16 +4,6 @@