添加功能
This commit is contained in:
@@ -8,7 +8,7 @@ class IssueApproval(models.Model):
|
||||
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
|
||||
_rec_name = 'name'
|
||||
|
||||
name = fields.Text(string='标题', required=True)
|
||||
name = fields.Char(string='标题', required=True)
|
||||
code = fields.Char(string='编号', required=True, copy=False,
|
||||
default=lambda self: self.env['ir.sequence'].next_by_code('issue_approval_code'))
|
||||
create_time = fields.Date(string='创建日期', default=lambda self: fields.Date.today())
|
||||
@@ -21,7 +21,7 @@ class IssueApproval(models.Model):
|
||||
is_attend = fields.Boolean(string="是否上会", default=True)
|
||||
work_end = fields.Boolean(string="结束")
|
||||
issues_result = fields.Html(string="会议结果")
|
||||
issue_text = fields.Html(string="正文")
|
||||
issue_text = fields.Text(string="正文")
|
||||
documents_ids = fields.Many2many('ir.attachment', string='议题附件')
|
||||
issue_approval_ids = fields.One2many('issue.approval.line', 'issue_approval_id', string="关联议题", store=True)
|
||||
issue_display = fields.Text(string="议题事项")
|
||||
|
||||
@@ -6,8 +6,8 @@ class PropertyIntentionInformation(models.Model):
|
||||
_description = '意向客户列表'
|
||||
|
||||
name = fields.Char(string='姓名')
|
||||
card_id = fields.Many2one('documents.document', string="身份证")
|
||||
license_id = fields.Many2one('documents.document',string='营业执照')
|
||||
card_id = fields.Many2one('ir.attachment', string="身份证")
|
||||
license_id = fields.Many2one('ir.attachment',string='营业执照')
|
||||
entity_type = fields.Selection([('person', '个人'), ('company', '企业')], string='实体类型')
|
||||
phone = fields.Char(string='联系人')
|
||||
phone_number = fields.Char(string='联系电话')
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
<field name="entity_type"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="license_id"/>
|
||||
<field name="license_id" widget="preview_many2one"/>
|
||||
<field name="phone_number"/>
|
||||
<field name="industry_id"/>
|
||||
<field name="industry_id" widget="preview_many2one"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
|
||||
@@ -40,17 +40,4 @@
|
||||
<field name="numbercall">-1</field>
|
||||
<field eval="False" name="doall"/>
|
||||
</record>
|
||||
<record forcecreate="True" id="update_property_contract_receivable" model="ir.cron">
|
||||
<field name="name">定时任务:更新合同违约金</field>
|
||||
<field name="model_id" ref="model_property_bank_statements"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">model.contract_penalty()</field>
|
||||
<field eval="True" name="active"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="interval_number">1</field>
|
||||
<field name="interval_type">days</field>
|
||||
<field name="nextcall" eval="(DateTime.now()).strftime('%Y-%m-%d 00:00:00')"/>
|
||||
<field name="numbercall">-1</field>
|
||||
<field eval="False" name="doall"/>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -345,34 +345,6 @@ class PropertyBankStatements(models.Model):
|
||||
lines_to_delete.unlink()
|
||||
statement.contract_ids = [(5,)]
|
||||
|
||||
def contract_penalty(self):
|
||||
statements_ids = self.env['property.bank.statements'].search([('is_put', '=', True)])
|
||||
for record in statements_ids:
|
||||
self._handle_contract_penalty(record)
|
||||
|
||||
# 违约金计算
|
||||
def _handle_contract_penalty(self, record):
|
||||
'''
|
||||
处理合同违约金
|
||||
:param record: property.bank.statements 记录
|
||||
:return:
|
||||
'''
|
||||
for contract_id in record.contract_ids:
|
||||
receivable_id = self.env['property.accounts.receivable'].search([('contract_id', '=', contract_id.id)])
|
||||
if receivable_id:
|
||||
dt = datetime.strptime(str(record.start_time), '%Y-%m-%d %H:%M:%S').date() # 流水交易时间
|
||||
due = datetime.strptime(str(receivable_id.due_date), '%Y-%m-%d').date() + relativedelta(months=1, day=1) # 应收日期
|
||||
# 判断是否违约
|
||||
if receivable_id.submitted and not receivable_id.is_reconciliation or not receivable_id.is_suspend:
|
||||
original_amount = (due - dt).days * (receivable_id.original_amount - record.original_amount) * int(receivable_id.percentage_liquidated_damages.name)
|
||||
self.env['property.penalty.list'].create({
|
||||
'contract_id': contract_id.id,
|
||||
'property_id': contract_id.lease_ids[0].address_id.id,
|
||||
'lessee_id': contract_id.lessee_id.id,
|
||||
'original_amount': original_amount
|
||||
})
|
||||
receivable_id.is_reconciliation = True
|
||||
|
||||
def _get_reconciliation_vals(self, record, contract_ids, is_equity=False):
|
||||
if record.name:
|
||||
collection_type_map = {
|
||||
|
||||
@@ -15,7 +15,7 @@ class PropertyEligibility(models.Model):
|
||||
default=lambda self: self.env['ir.sequence'].next_by_code('property_eligibility_code'))
|
||||
property_documents_ids = fields.Many2many('documents.document', string="承租资格文件")
|
||||
eligibility_ids = fields.One2many('property.eligibility.line', 'eligibility_id', string="意向客户明细")
|
||||
sincerity_gold = fields.Float(string="诚意金")
|
||||
sincerity_gold = fields.Float(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="部门")
|
||||
is_issues = fields.Boolean(string='是否上会')
|
||||
@@ -39,6 +39,8 @@ class PropertyEligibilityLine(models.Model):
|
||||
_description = '承租方明细行'
|
||||
|
||||
eligibility_id = fields.Many2one('property.eligibility', string="关联承租资格审批")
|
||||
prospective_customers = fields.Char(string="意向客户")
|
||||
id_card_id = fields.Many2one('documents.document',string='身份证')
|
||||
license_id = fields.Many2one('documents.document',string='营业执照')
|
||||
prospective_customers_id = fields.Many2one('property.intention.information', string="意向客户")
|
||||
card_id = fields.Many2one(related='prospective_customers_id.card_id', string='身份证')
|
||||
license_id = fields.Many2one(related='prospective_customers_id.license_id', string='营业执照')
|
||||
entity_type = fields.Selection(related='prospective_customers_id.entity_type',string='实体类型')
|
||||
phone_number = fields.Char(related='prospective_customers_id.phone_number', string="联系电话")
|
||||
@@ -56,9 +56,11 @@
|
||||
<field name="eligibility_ids">
|
||||
<tree editable="bottom">
|
||||
<field name="eligibility_id" column_invisible="1"/>
|
||||
<field name="prospective_customers"/>
|
||||
<field name="id_card_id"/>
|
||||
<field name="license_id"/>
|
||||
<field name="prospective_customers_id"/>
|
||||
<field name="entity_type"/>
|
||||
<field name="phone_number"/>
|
||||
<field name="card_id" widget="preview_many2one"/>
|
||||
<field name="license_id" widget="preview_many2one"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
<field name="name_account" readonly="1"/>
|
||||
</group>
|
||||
<group/>
|
||||
<group/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="bank_id" invisible="1"/>
|
||||
|
||||
Reference in New Issue
Block a user