modifications on units

This commit is contained in:
esraa 2024-10-22 15:40:29 +03:00
parent 78f28fff9a
commit e4e17f6733
8 changed files with 494 additions and 164 deletions

File diff suppressed because it is too large Load Diff

View File

@ -445,6 +445,7 @@ class Property(models.Model):
self.write({'unlock':False}) self.write({'unlock':False})
else: else:
self.write({'unlock':True}) self.write({'unlock':True})
class PropertyUnitDetails(models.Model): class PropertyUnitDetails(models.Model):
_name = 'floor.unit.details' _name = 'floor.unit.details'
_description = 'Floor Unit Details' _description = 'Floor Unit Details'
@ -462,3 +463,15 @@ class PropertyUnitDetails(models.Model):
for record in self: for record in self:
record.total = record.no_of_house + record.no_of_shop + record.no_of_other_unit record.total = record.no_of_house + record.no_of_shop + record.no_of_other_unit
class PropertyContentDetails(models.Model):
_name = 'property.content.details'
_description = 'Property Unit Details'
property_id = fields.Many2one('internal.property', string='Property', required=True, ondelete='cascade')
content_id = fields.Many2one('property.contents','Property Content')
qty = fields.Integer('QTY')
desc = fields.Char('Description')
attachment = fields.Binary(string="Property Docs")

View File

@ -27,6 +27,7 @@ class Unit(models.Model):
('commercial', 'Commercial'), ('commercial', 'Commercial'),
('lands', 'Lands') ], string="Unit Category") ('lands', 'Lands') ], string="Unit Category")
attach_nbr = fields.Integer(compute='get_attachments') attach_nbr = fields.Integer(compute='get_attachments')
content_ids= fields.One2many(comodel_name='property.content.details', inverse_name='property_id',string='')
active = fields.Boolean(default=True) active = fields.Boolean(default=True)
role_id = fields.Many2one('property.role', string='Role') role_id = fields.Many2one('property.role', string='Role')
unlock = fields.Boolean(default=True, string="Unlock") unlock = fields.Boolean(default=True, string="Unlock")
@ -230,3 +231,16 @@ class Unit(models.Model):
else: else:
self.write({'unlock': True}) self.write({'unlock': True})
class PropertyContentDetails(models.Model):
_name = 'property.content.details'
_description = 'Property Unit Details'
property_id = fields.Many2one('internal.property', string='Property', required=True, ondelete='cascade')
content_id = fields.Many2one('property.contents','Property Content')
qty = fields.Integer('QTY')
desc = fields.Char('Description')
attachment = fields.Binary(string="Property Docs")

View File

@ -22,6 +22,14 @@ class sketchs(models.Model):
class PropertyContent(models.Model):
_name = "property.contents"
_description = "Contents Property"
_rec_name = 'content_name'
content_name = fields.Char(string='Content name', required=True)
class PropertyType(models.Model): class PropertyType(models.Model):
_name = 'internal.property.type' _name = 'internal.property.type'
_description = 'Property Type' _description = 'Property Type'

View File

@ -8,4 +8,6 @@ access_realestate_re_unit,re.unit,model_re_unit,real_estate.group_real_estate_us
access_realestate_configuration_property_sketchs,sketchs.sketchs,model_sketchs_sketchs,real_estate.group_real_estate_user,1,1,1,1 access_realestate_configuration_property_sketchs,sketchs.sketchs,model_sketchs_sketchs,real_estate.group_real_estate_user,1,1,1,1
access_realestate_role_property,role.property,model_property_role,,1,1,1,1 access_realestate_role_property,role.property,model_property_role,,1,1,1,1
access_realestate_floor_property,floor.property,model_floor_unit_details,,1,1,1,1 access_realestate_floor_property,floor.property,model_floor_unit_details,,1,1,1,1
access_property_contents,property.contents,model_property_contents,,1,1,1,1
access_property_content_details,property.content.details,model_property_content_details,,1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
8 access_realestate_configuration_property_sketchs sketchs.sketchs model_sketchs_sketchs real_estate.group_real_estate_user 1 1 1 1
9 access_realestate_role_property role.property model_property_role 1 1 1 1
10 access_realestate_floor_property floor.property model_floor_unit_details 1 1 1 1
11 access_property_contents property.contents model_property_contents 1 1 1 1
12 access_property_content_details property.content.details model_property_content_details 1 1 1 1
13

View File

@ -461,9 +461,9 @@
help="Confirmed Property"/> help="Confirmed Property"/>
<filter domain="[('state', '=', 'approve')]" string="Approved" name="approve" <filter domain="[('state', '=', 'approve')]" string="Approved" name="approve"
help="Approved Property"/> help="Approved Property"/>
<filter domain="[('state', '=', 'reserve')]" string="Reserved" name="Reserved" <filter domain="[('state', '=', 'reserved')]" string="Reserved" name="Reserved"
help="Reserved Property"/> help="Reserved Property"/>
<filter domain="[('state', '=', 'rent')]" string="Rented" name="rent"/> <filter domain="[('state', '=', 'rented')]" string="Rented" name="rent"/>
<separator/> <separator/>
<group expand="0" string="Group By"> <group expand="0" string="Group By">
<filter string="Status" name="state" domain="[]" context="{'group_by': 'state'}"/> <filter string="Status" name="state" domain="[]" context="{'group_by': 'state'}"/>

View File

@ -121,35 +121,47 @@
<field name="stamping"/> <field name="stamping"/>
<field name="stamping_date"/> <field name="stamping_date"/>
<field name="stamping_attach"/> <field name="stamping_attach"/>
<!-- <field name="stamping_state"/>--> <!-- <field name="stamping_state"/>-->
</group> </group>
<group string="Second Stamping" <group string="Second Stamping"
attrs="{'invisible':['|',('stamping_count','=','1'),('stamping_count','=',False)]}"> attrs="{'invisible':['|',('stamping_count','=','1'),('stamping_count','=',False)]}">
<field name="stamping_2" <field name="stamping_2"
readonly="1"/> readonly="1"/>
<field name="stamping_date_2" <field name="stamping_date_2"
readonly="1"/> readonly="1"/>
<field name="stamping_attach_2" <field name="stamping_attach_2"
readonly="1"/> readonly="1"/>
<field name="stamping_state_2" <field name="stamping_state_2"
readonly="1"/> readonly="1"/>
</group> </group>
<group string="Third stamping" <group string="Third stamping"
attrs="{'invisible':['|','|',('stamping_count','=','1'),('stamping_count','=','2'),('stamping_count','=',False)]}" attrs="{'invisible':['|','|',('stamping_count','=','1'),('stamping_count','=','2'),('stamping_count','=',False)]}"
> >
<field name="stamping_3" <field name="stamping_3"
readonly="1"/> readonly="1"/>
<field name="stamping_date_3" <field name="stamping_date_3"
readonly="1"/> readonly="1"/>
<field name="stamping_attach_3" <field name="stamping_attach_3"
readonly="1"/> readonly="1"/>
<field name="stamping_state_3" <field name="stamping_state_3"
readonly="1"/> readonly="1"/>
</group> </group>
</group> </group>
</page> </page>
<page attrs="{'readonly':[('state','=','approve')]}" name="contents"
string="Property Contents">
<field attrs="{'readonly':[('state','=','approve')]}" name="content_ids">
<tree editable="bottom">
<field name="content_id"/>
<field name="qty"/>
<field name="desc"/>
<field name="attachment"/>
</tree>
</field>
</page>
</notebook> </notebook>
</sheet> </sheet>
<div class="oe_chatter"> <div class="oe_chatter">
@ -257,9 +269,9 @@
<filter domain="[('state', '=', 'draft')]" string="Draft" name="draft" help="Unit in Draft"/> <filter domain="[('state', '=', 'draft')]" string="Draft" name="draft" help="Unit in Draft"/>
<filter domain="[('state', '=', 'available')]" string="Available" name="available" <filter domain="[('state', '=', 'available')]" string="Available" name="available"
help="Confirmed Unit"/> help="Confirmed Unit"/>
<filter domain="[('state', '=', 'reserve')]" string="Reserved" name="Reserved" <filter domain="[('state', '=', 'reserved')]" string="Reserved" name="Reserved"
help="Reserved Unit"/> help="Reserved Unit"/>
<filter domain="[('state', '=', 'rent')]" string="Rented" name="rent" <filter domain="[('state', '=', 'rented')]" string="Rented" name="rent"
help="Rented Unit"/> help="Rented Unit"/>
<separator/> <separator/>
<group expand="0" string="Group By"> <group expand="0" string="Group By">

View File

@ -9,7 +9,7 @@
<form> <form>
<sheet> <sheet>
<group col="4" colspan="2"> <group col="4" colspan="2">
<field name="name" required="1"/> <field name="name" required="1"/>
<field name="notes" required="1"/> <field name="notes" required="1"/>
<field name="company_id" groups="base.group_multi_company"/> <field name="company_id" groups="base.group_multi_company"/>
</group> </group>
@ -18,8 +18,31 @@
</field> </field>
</record> </record>
<record id="property_contents_form_view" model="ir.ui.view">
<field name="name">Property Contents</field>
<field name="model">property.contents</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<field name="content_name" required="1"/>
</group>
</sheet>
</form>
<record id="property_sketchs_action" model="ir.actions.act_window"> </field>
</record>
<record id="property_contents_tree_view" model="ir.ui.view">
<field name="name">Property sketchs</field>
<field name="model">property.contents</field>
<field name="arch" type="xml">
<tree>
<field name="content_name" required="1"/>
</tree>
</field>
</record>
<record id="property_sketchs_action" model="ir.actions.act_window">
<field name="name">Property sketchs</field> <field name="name">Property sketchs</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
<field name="res_model">sketchs.sketchs</field> <field name="res_model">sketchs.sketchs</field>
@ -33,7 +56,7 @@
<form> <form>
<sheet> <sheet>
<div class="oe_button_box" name="button_box"> <div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive"> <button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
<field name="active" widget="toggle_button"/> <field name="active" widget="toggle_button"/>
<span class="o_stat_text" attrs="{'invisible': [('active', '=', False)]}">Restore</span> <span class="o_stat_text" attrs="{'invisible': [('active', '=', False)]}">Restore</span>
<span class="o_stat_text" attrs="{'invisible': [('active', '=', True)]}">Archive</span> <span class="o_stat_text" attrs="{'invisible': [('active', '=', True)]}">Archive</span>
@ -41,9 +64,9 @@
</div> </div>
<group col="4" colspan="2"> <group col="4" colspan="2">
<field name="market_type" invisible="1" required="0"/> <field name="market_type" invisible="1" required="0"/>
<field name="name" required="1"/> <field name="name" required="1"/>
<field name="is_land" invisible="1"/> <field name="is_land" invisible="1"/>
<field name="company_id" groups="base.group_multi_company"/> <field name="company_id" groups="base.group_multi_company"/>
</group> </group>
</sheet> </sheet>
@ -133,7 +156,6 @@
</record> </record>
<record id="property_type_action" model="ir.actions.act_window"> <record id="property_type_action" model="ir.actions.act_window">
<field name="name">Property Type</field> <field name="name">Property Type</field>
<field name="type">ir.actions.act_window</field> <field name="type">ir.actions.act_window</field>
@ -163,6 +185,13 @@
<field name="view_mode">tree,form</field> <field name="view_mode">tree,form</field>
</record> </record>
<record id="property_contents_action" model="ir.actions.act_window">
<field name="name">Property Contents</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">property.contents</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem name="Property State" id="property_state_menu" parent="configuration_main_menu" <menuitem name="Property State" id="property_state_menu" parent="configuration_main_menu"
action="property_state_action" sequence="1"/> action="property_state_action" sequence="1"/>
@ -173,6 +202,9 @@
<menuitem name="Property Sketchs" id="property_sketchs_menu" parent="configuration_main_menu" <menuitem name="Property Sketchs" id="property_sketchs_menu" parent="configuration_main_menu"
action="property_sketchs_action" sequence="9"/> action="property_sketchs_action" sequence="9"/>
<menuitem name="Property Contents" id="property_contents_menu" parent="configuration_main_menu"
action="property_contents_action" sequence="9"/>
<menuitem name="Property Face" id="property_face_menu" parent="configuration_main_menu" <menuitem name="Property Face" id="property_face_menu" parent="configuration_main_menu"
action="property_face_action" sequence="3"/> action="property_face_action" sequence="3"/>