Skip to content

Commit

Permalink
[IMP] res_partner_building_use_section: pre-commit stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
oihane committed Jun 25, 2024
1 parent 4bbe8c0 commit 4459961
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 71 deletions.
19 changes: 7 additions & 12 deletions res_partner_building_use_section/models/building_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,34 @@ class BuildingSection(models.Model):
_description = "Building Section/Area"

name = fields.Char(
"Description",
string="Description",
required=True,
copy=False,
)
partner_id = fields.Many2one(
"res.partner",
"Contact",
comodel_name="res.partner",
string="Contact",
required=True,
copy=False,
)
section_use = fields.Many2one(
"building.use",
"Section Use",
comodel_name="building.use",
)
risk = fields.Char(
"Risk",
copy=False,
)
area = fields.Float(
"Surface",
string="Surface",
default=0.0,
copy=False,
)
evacuation_height = fields.Float(
"Evacuation Height",
)
evacuation_height = fields.Float()
configuration = fields.Selection(
[
selection=[
("A", "A"),
("B", "B"),
("C", "C"),
("D", "D"),
("E", "E"),
],
"Configuration",
)
93 changes: 34 additions & 59 deletions res_partner_building_use_section/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,130 +7,105 @@ class ResPartner(models.Model):
_inherit = "res.partner"

building_use_id = fields.Many2one(
"building.use",
"Building use",
comodel_name="building.use",
string="Building use",
)
building_section_ids = fields.One2many(
"building.section",
"partner_id",
"Building Section/Area",
)
service_start_date = fields.Date(
"Service Start Date",
)
service_end_date = fields.Date(
"Service End Date",
comodel_name="building.section",
inverse_name="partner_id",
string="Building Section/Area",
)
service_start_date = fields.Date()
service_end_date = fields.Date()
alternative_text = fields.Char(
"Alternative Text",
copy=False,
)
number_of_floors = fields.Char(
"Number of Plants",
)
number_of_floors = fields.Char()
risk = fields.Char(
"Risk",
copy=False,
)
area = fields.Float(
"Surface",
string="Surface",
default=0.0,
copy=False,
)
evacuation_height = fields.Float(
"Evacuation Height",
)
evacuation_height = fields.Float()
configuration = fields.Selection(
[
selection=[
("A", "A"),
("B", "B"),
("C", "C"),
("D", "D"),
("E", "E"),
],
"Configuration",
)
file_number = fields.Char(
"File Number",
)
installation_number = fields.Char(
"Installation Number",
)
certification_text = fields.Text(
"Certification Text",
)
file_number = fields.Char()
installation_number = fields.Char()
certification_text = fields.Text()
degree_title = fields.Char(
"Degree Title",
domain="[('is_company','=',False)]",
help="Degree Title of the individual contact.",
)
membership_number = fields.Char(
"Membership Number",
domain="[('is_company','=',False)]",
help="Membership number of the individual contact.",
)
emi = fields.Char(
"EMI",
string="EMI",
)
epi = fields.Char(
"EPI",
string="EPI",
)
# Maintainer
maintainer_id = fields.Many2one(
"res.partner",
"Maintainer",
comodel_name="res.partner",
string="Maintainer",
)
maintainer_emi = fields.Char(
"Maintainer EMI",
string="Maintainer EMI",
related="maintainer_id.emi",
)
installer_id = fields.Many2one(
"res.partner",
"Installer",
comodel_name="res.partner",
string="Installer",
)
installer_epi = fields.Char(
"Installer EPI",
string="Installer EPI",
related="installer_id.epi",
)
certification_date = fields.Date(
"Date of Certificate from Installation Company",
string="Date of Certificate from Installation Company",
)
administrator_id = fields.Many2one(
"res.partner",
"Administrator",
comodel_name="res.partner",
string="Administrator",
)
normativas_ids = fields.Many2many(
"survey.question.normative",
"Normativas",
comodel_name="survey.question.normative",
string="Normativas",
compute="_compute_normativas_ids",
)
dof_author_degree = fields.Char(
"Director of Works Author Degree",
string="Director of Works Author Degree",
related="inspected_building_id.dof_author_degree",
)
# Project
project_title = fields.Char(
"Project Title",
)
project_title = fields.Char()
project_author_id = fields.Many2one(
"res.partner",
"Project Author",
comodel_name="res.partner",
string="Project Author",
)
project_author_degree = fields.Char(
"Project Author Degree",
related="project_author_id.degree_title",
)
project_author_license = fields.Char(
"Project Author License",
related="project_author_id.membership_number",
)
project_approved_date = fields.Date(
"Project Approved Date",
)
project_approved_date = fields.Date()
# Certificate of Final Work Direction
dof_author_id = fields.Many2one(
"res.partner",
"Director of Works Author",
comodel_name="res.partner",
string="Director of Works Author",
)
dof_author_degree = fields.Char(
"Director of Works Author Degree",
Expand Down

0 comments on commit 4459961

Please sign in to comment.