Skip to content

Commit

Permalink
delete commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
janikvonrotz committed Jul 19, 2021
1 parent 113f583 commit 3f9f0e4
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 73 deletions.
2 changes: 1 addition & 1 deletion __manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'website': "https://www.mint-system.ch",

'category': 'Operations',
'version': '13.0.2.2.0',
'version': '13.0.2.2.1',
'license': 'AGPL-3',

# any module necessary for this one to work correctly
Expand Down
6 changes: 0 additions & 6 deletions models/aircraft_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@ class AircraftType(models.Model):

# fields
name = fields.Char(required=True, string="Title")
#certificate_ids = fields.One2many("certificate_planer.certificate", "aircraft_type_id", string="Certificates")

# constraints
_sql_constraints = [
('name_unique', 'unique (name)', "Aircraft Type with this Title already exists."),
]

# def unlink(self):
# if len(self.certificate_ids) != 0:
# raise UserError(_('You cannot delete a Aircraft Type as long it is referenced by a Certificate.'))
# return super(AircraftType, self).unlink()
2 changes: 1 addition & 1 deletion models/bom.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Bom(models.Model):

# fields
part_id = fields.Many2one("certificate_planer.part", string="Part")
part_ids = fields.Many2many("certificate_planer.part", string="Child Parts")
part_ids = fields.Many2many("certificate_planer.part", string="Child Parts", ondelete="restrict")

# constraints
_sql_constraints = [
Expand Down
14 changes: 0 additions & 14 deletions models/change.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,10 @@ class Change(models.Model):
part_ids = fields.Many2many("certificate_planer.part", string="Parts", ondelete="restrict")

revision_ids = fields.One2many("certificate_planer.document_revision", "change_id", string="Document Revisions")
# document_ids = fields.One2many("certificate_planer.document", "change_id", string="Documents")
item_ids = fields.One2many("certificate_planer.post_certification_item", "change_id", string="Post Certification Items")

# defaults
# def unlink(self):
# if len(self.document_ids) != 0:
# raise UserError(_('You cannot delete an Change as long it is referenced by a Document.'))
# if len(self.revision_ids) != 0:
# raise UserError(_('You cannot delete an Change as long it is referenced by a Document Revision.'))
# return super(Change, self).unlink()

def name_get(self):
res = []
for rec in self:
res.append((rec.id, _('%s (%s)') % (rec.change_id_id.name, rec.certificate_id.part_id.name)))
return res

# @api.model
# def _read_group_status_ids(self, statuses, domain, order):
# statuse_ids = statuses._search([], order=order)
# return statuses.browse(statuse_ids)
8 changes: 0 additions & 8 deletions models/change_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,7 @@ class ChangeID(models.Model):
name = fields.Char(required=True, string="Title")
sequence = fields.Integer()

# change_ids = fields.One2many("certificate_planer.change", "change_id_id", string="Changes")

# constraints
_sql_constraints = [
('name_unique', 'unique (name)', "Change ID with this Title already exists."),
]

# defaults
# def unlink(self):
# if len(self.change_ids) != 0:
# raise UserError(_('You cannot delete an Change ID as long it is referenced by a Change.'))
# return super(ChangeID, self).unlink()
9 changes: 1 addition & 8 deletions models/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,8 @@ class Document(models.Model):
_sql_constraints = [
('name_unique', 'unique (name)', "Document with this Document ID already exists."),
]

# defaults
# def unlink(self):
# if len(self.part_ids) != 0:
# raise UserError(_('You cannot delete a Document as long it is referenced by a Part.'))
# if len(self.revision_ids) != 0:
# raise UserError(_('You cannot delete a Document as long it is referenced by a Document Revision.'))
# return super(Document, self).unlink()

# compute
def _compute_revision_count(self):
for record in self:
record.revision_count = self.env['certificate_planer.document_revision'].search_count([('document_id', '=', self.id)])
Expand Down
7 changes: 0 additions & 7 deletions models/document_revision_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,12 @@ class DocumentRevisionState(models.Model):
name = fields.Char(required=True, string="Title")
active = fields.Boolean(default=True)

# revision_ids = fields.One2many("certificate_planer.document_revision", "state_id", string="Document Revisions")

# constraints
_sql_constraints = [
('name_unique', 'unique (name)', "Document Revision State with this Title already exists."),
]

# defaults
# def unlink(self):
# if len(self.revision_ids) != 0:
# raise UserError(_('You cannot delete a Document Revision State as long it is referenced by a Document Revision.'))
# return super(DocumentRevisionState, self).unlink()

@api.model
def name_search(self, name, args=None, operator="ilike", limit=100):
args = args or []
Expand Down
14 changes: 0 additions & 14 deletions models/document_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,7 @@ class DocumentType(models.Model):
identification = fields.Char(required=True)
description = fields.Char(help="Document ID Assignment")

# document_ids = fields.One2many("certificate_planer.document", "type_id", string="Documents")

# constraints
_sql_constraints = [
('name_unique', 'unique (name)', "Document Type with this Title already exists."),
]

# defaults
# def unlink(self):
# if len(self.document_ids) != 0:
# raise UserError(_('You cannot delete a Document Type as long it is referenced by a Document.'))
# return super(DocumentType, self).unlink()

# def name_get(self):
# res = []
# for rec in self:
# res.append((rec.id, _('%s (%s)') % (rec.identification, rec.name)))
# return res
8 changes: 0 additions & 8 deletions models/part.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ class Part(models.Model):
('name_unique', 'unique (name)', "Part with this Partnumber already exists."),
]

# defaults
# def unlink(self):
# if len(self.bom_ids) != 0:
# raise UserError(_('You cannot delete a BoM/Part as long it is referenced by a parent BoM.'))
# if len(self.document_ids) != 0:
# raise UserError(_('You cannot delete a BoM/Part as long it is referenced by a document.'))
# return super(Part, self).unlink()

def name_get(self):
res = []
for rec in self:
Expand Down
6 changes: 0 additions & 6 deletions models/specification.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,8 @@ class Specification(models.Model):

# fields
name = fields.Char(required=True, string="Title")
# certificate_ids = fields.One2many("certificate_planer.certificate", "specification_id", string="Certificates")

# constraints
_sql_constraints = [
('name_unique', 'unique (name)', "Specification with this Title already exists."),
]

# def unlink(self):
# if len(self.certificate_ids) != 0:
# raise UserError(_('You cannot delete a Specification as long it is referenced by a Certificate.'))
# return super(Specification, self).unlink()

0 comments on commit 3f9f0e4

Please sign in to comment.