50 lines
3.0 KiB
Python
50 lines
3.0 KiB
Python
from odoo import models, fields, api
|
|
|
|
|
|
class PropertyRentalForm(models.Model):
|
|
_name = 'property.rental.form'
|
|
_description = '挂牌申报表'
|
|
_rec_name = 'name'
|
|
_inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
|
|
|
|
name = fields.Char(string="名称", required=True)
|
|
reason = fields.Text(string="正文")
|
|
documents_ids = fields.Many2many('ir.attachment', string="附件")
|
|
listing_method = fields.Selection([('enterprise', '企业自挂牌'), ('makeup', '广交所挂牌')], 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="部门")
|
|
property_rental_form_line_ids = fields.One2many('property.rental.form.line', 'property_rental_form_id', string="关联挂牌申报表明细行")
|
|
is_issues = fields.Boolean(string='是否上会')
|
|
issues_result = fields.Html(string="会议结果")
|
|
related_issues_id = fields.Many2one('issue.library', string="关联议题")
|
|
code = fields.Char(string="编号",
|
|
default=lambda self: self.env['ir.sequence'].next_by_code('property_rental_form_code'))
|
|
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 PropertyRentalFormLine(models.Model):
|
|
_name = 'property.rental.form.line'
|
|
_description = '挂牌申报表明细行'
|
|
|
|
property_rental_form_id = fields.Many2one('property.rental.form', string="关联挂牌申报表")
|
|
property_id = fields.Many2one('yuthon.property', string='物业名称', required=True)
|
|
registered_id = fields.Many2one(related='property_id.registered_id', string='证载用途')
|
|
evaluation_area = fields.Float(related='property_id.evaluation_area', string='出租面积(m²)')
|
|
current_status = fields.Date(related='property_id.current_status', string='租聘到期日')
|
|
now_rent_price = fields.Float(related='property_id.rental_unit_price',string='现租价(元/m² •月)')
|
|
evaluate_rent_price = fields.Float(string='评估租(元/m² •月)')
|
|
upset_square = fields.Float(string='底价(元/m² •月)')
|
|
upset = fields.Float(string='底价(元/月)')
|
|
lease_period = fields.Char(string='租凭年限')
|
|
increment_rate = fields.Float(string='递增率')
|
|
rental_use = fields.Many2one('yuthon.rental.purpose',string='出租用途')
|
|
other = fields.Char(string='其他')
|
|
remarks = fields.Text(string='备注') |