58 lines
3.4 KiB
Python
58 lines
3.4 KiB
Python
from odoo import models, fields, api
|
||
|
||
|
||
class PropertyRentalConditions(models.Model):
|
||
_name = 'property.rental.conditions'
|
||
_description = '出租调整表'
|
||
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
|
||
|
||
property_id = fields.Many2one('yuthon.property',string='物业名称')
|
||
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
|
||
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
|
||
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].
|
||
next_by_code('property_rental_conditions_code'))
|
||
registered_id = fields.Many2one(related='property_id.registered_id',string='证载用途')
|
||
evaluation_area = fields.Float(related='property_id.rent_area',string='出租面积(m²)')
|
||
lease_expiration_date = fields.Date(string='租赁到期日')
|
||
now_rent_price = fields.Float(related='property_id.current_rent',string='现租价(元/m² •月)')
|
||
appraisal_price = fields.Float(string='评估价(元/m² •月)')
|
||
now_rental_conditions_line_ids = fields.One2many('now.rental.conditions.line', 'property_rental_conditions_id', string='关联目前出租条件')
|
||
rental_adjustment_line_ids = fields.One2many('rental.adjustment.line', 'property_rental_conditions_id', string='关联出租调整')
|
||
is_issues = fields.Boolean(string='是否上会')
|
||
issues_result = fields.Html(string="会议结果")
|
||
related_issues_id = fields.Many2one('issue.library', string="关联议题")
|
||
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
|
||
default='normal')
|
||
active = fields.Boolean('Active', default=True, tracking=True)
|
||
work_end = fields.Boolean(string="结束")
|
||
|
||
def _get_default_name_title(self):
|
||
return self._description if self._description else self._name
|
||
|
||
name_title = fields.Char(default=_get_default_name_title)
|
||
self_users_ids = fields.Many2many('res.users', string="当前经办人", default=lambda self: [(6, 0, [self.env.user.id])])
|
||
|
||
class NowRentalConditionsLine(models.Model):
|
||
_name = 'now.rental.conditions.line'
|
||
_description = '目前出租条件'
|
||
|
||
property_rental_conditions_id = fields.Many2one('property.rental.conditions', string='关联出租调整表')
|
||
rental_price = fields.Float(string='租金底价(元/m²)')
|
||
rental_price_month = fields.Float(string='租金底价(/m²)')
|
||
lease_period = fields.Integer(string='租聘期限(<=)')
|
||
increment_rate = fields.Char(string='每年递增率(%)')
|
||
rental_use = fields.Many2one('yuthon.rental.purpose',string='出租用途')
|
||
other = fields.Char(string='其他')
|
||
|
||
|
||
class RentalConditionsLine(models.Model):
|
||
_name = 'rental.adjustment.line'
|
||
_description = '出租条件调整'
|
||
|
||
property_rental_conditions_id = fields.Many2one('property.rental.conditions', string='关联出租调整表')
|
||
new_rental_price = fields.Float(string='租金底价(元/m²)')
|
||
new_rental_price_month = fields.Float(string='租金底价(/m²)')
|
||
new_rental_year = fields.Integer(string='租聘期限(<=)')
|
||
new_increment_rate = fields.Char(string='每年递增率(%)')
|
||
new_rental_use = fields.Many2one('yuthon.rental.purpose', string='出租用途')
|
||
new_other = fields.Char(string='其他') |