diff --git a/yuthon_maintain/models/property_device_repair.py b/yuthon_maintain/models/property_device_repair.py index f61101e7f..ba1d9a99a 100644 --- a/yuthon_maintain/models/property_device_repair.py +++ b/yuthon_maintain/models/property_device_repair.py @@ -17,8 +17,7 @@ class PropertyDeviceRelief(models.Model): company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司") software_processing_id = fields.Many2one('software.issues.processing', string="设备类型") problem_description = fields.Text(string="问题描述") - start_date = fields.Date(string="开始日期") - remake = fields.Text(string="备注") + remake = fields.Text(string="问题描述") report_state = fields.Selection([('to', '待处理'), ('done', '已处理')], string='状态', default='to') create_time = fields.Date(string="创建日期", default=fields.Datetime.now) urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度', @@ -26,6 +25,7 @@ class PropertyDeviceRelief(models.Model): documents_ids = fields.Many2many('ir.attachment', string="附件") active = fields.Boolean('Active', default=True, tracking=True) work_end = fields.Boolean(string="结束") + processing_order_id = fields.Many2one('processing.order.approval', string="处理单流程") self_users_ids = fields.Many2many('res.users', string="当前经办人", default=lambda self: [(6, 0, [self.env.user.id])]) def _get_default_name_title(self): @@ -41,16 +41,28 @@ class PropertyDeviceRelief(models.Model): def pull_order(self): + soong_workflow_line_list = [] self.report_state = 'done' + order_id = self.env['processing.order.approval'].create({ + 'device_id': self.id, + }) + workflow_record_id = self.env['soong.workflow.record'].search([ + ('code', '=', self.code), + ]) + soong_workflow_line_list.append((0, 0, { + 'model': 'processing.order.approval', + 'res_id': order_id.id, + 'workflow_record_id': workflow_record_id.id + })) + order_id.soong_record_ids = soong_workflow_line_list + self.processing_order_id = order_id.id return { 'name': '报事报修', 'view_mode': 'form', 'res_model': 'processing.order.approval', - 'type': 'ir.actions.act_window', - 'context': {'default_device_id': self.id}, + 'res_id': order_id.id, } - class PropertyDeviceLine(models.Model): _name = 'property.device.line' _description = '设备信息' diff --git a/yuthon_maintain/models/property_report_repair.py b/yuthon_maintain/models/property_report_repair.py index 4a01f4ac4..4b56cb76a 100644 --- a/yuthon_maintain/models/property_report_repair.py +++ b/yuthon_maintain/models/property_report_repair.py @@ -32,6 +32,7 @@ class PropertyRentRelief(models.Model): self_users_ids = fields.Many2many('res.users', string="当前经办人", default=lambda self: [(6, 0, [self.env.user.id])]) create_time = fields.Date(string="创建日期", default=fields.Datetime.now) + processing_order_id = fields.Many2one('processing.order.approval', string="处理单流程") def _get_default_name_title(self): return self._description if self._description else self._name @@ -65,14 +66,27 @@ class PropertyRentRelief(models.Model): def pull_order(self): self.report_state = 'done' + soong_workflow_line_list = [] + order_id = self.env['processing.order.approval'].create({ + 'repair_id': self.id, + }) + workflow_record_id = self.env['soong.workflow.record'].search([ + ('code', '=', self.code), + ]) + soong_workflow_line_list.append((0, 0, { + 'model': 'processing.order.approval', + 'res_id': order_id.id, + 'workflow_record_id': workflow_record_id.id + })) + self.processing_order_id = order_id.id return { 'name': '报事报修', 'view_mode': 'form', 'res_model': 'processing.order.approval', - 'type': 'ir.actions.act_window', - 'context': {'default_repair_id': self.id}, + 'res_id': order_id.id, } + class PropertyDeviceLine(models.Model): _name = 'property.device.line' _description = '设备信息' diff --git a/yuthon_maintain/views/processing_order_approval_views.xml b/yuthon_maintain/views/processing_order_approval_views.xml index 122e02fdb..1d298162d 100644 --- a/yuthon_maintain/views/processing_order_approval_views.xml +++ b/yuthon_maintain/views/processing_order_approval_views.xml @@ -29,7 +29,7 @@ invisible="urgency_level != 'emergency'"/> - + diff --git a/yuthon_maintain/views/property_device_repair_views.xml b/yuthon_maintain/views/property_device_repair_views.xml index 44d779156..618f7082c 100644 --- a/yuthon_maintain/views/property_device_repair_views.xml +++ b/yuthon_maintain/views/property_device_repair_views.xml @@ -48,13 +48,14 @@ + - + diff --git a/yuthon_maintain/views/property_report_repair.xml b/yuthon_maintain/views/property_report_repair.xml index c5f31386a..d8034e1fc 100644 --- a/yuthon_maintain/views/property_report_repair.xml +++ b/yuthon_maintain/views/property_report_repair.xml @@ -50,6 +50,7 @@ + diff --git a/yuthon_property/models/property_accounts_receivable.py b/yuthon_property/models/property_accounts_receivable.py index 0b2de349e..faa678630 100644 --- a/yuthon_property/models/property_accounts_receivable.py +++ b/yuthon_property/models/property_accounts_receivable.py @@ -28,7 +28,6 @@ class PropertyAccountsReceivable(models.Model): red_date = fields.Date(string='红冲日期') is_suspend = fields.Boolean(string='是否挂起') create_time = fields.Datetime(string='创建时间', default=fields.Datetime.now) - is_billing = fields.Boolean(string='开票') is_reconciliation = fields.Boolean(string='对账') difference_amount = fields.Float(string='差额') delivered1 = fields.Float(string='已交') @@ -56,7 +55,7 @@ class PropertyAccountsReceivable(models.Model): @api.onchange('is_invalid') def _onchange_is_invalid(self): if self.is_invalid: - self.void_date = fields.Date.today() + self.void_date = fields.Date.today()- timedelta(hours=8), else: self.void_date = False @@ -64,7 +63,7 @@ class PropertyAccountsReceivable(models.Model): def _onchange_discount_amount(self): for record in self: if record.discount_amount: - record.discount_date = fields.Date.today() + record.discount_date = fields.Date.today() - timedelta(hours=8), else: record.discount_date = False diff --git a/yuthon_property/views/property_accounts_receivable_views.xml b/yuthon_property/views/property_accounts_receivable_views.xml index 8cd806c8a..8fa8548fe 100644 --- a/yuthon_property/views/property_accounts_receivable_views.xml +++ b/yuthon_property/views/property_accounts_receivable_views.xml @@ -21,7 +21,6 @@ - diff --git a/yuthon_property_approval/models/property_payment_notice.py b/yuthon_property_approval/models/property_payment_notice.py index 430bc2c91..c7d6a1091 100644 --- a/yuthon_property_approval/models/property_payment_notice.py +++ b/yuthon_property_approval/models/property_payment_notice.py @@ -13,4 +13,9 @@ class PropertyPaymentNotice(models.Model): print_date = fields.Date(string='打印日期') document_id = fields.Many2one('ir.attachment', string="附件") is_print = fields.Boolean(string='是否打印') + is_voicing = fields.Boolean(string='是否开票') + invoice_date = fields.Date(string='开票日期') + invoicing_type = fields.Selection([('spot', '专票'), ('cape', '普票')], string="开票类型") + invoicing_id = fields.Many2one('ir.attachment', string="开票附件") + diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml index bb6022412..da9dde145 100644 --- a/yuthon_property_approval/views/property_lease_contract.xml +++ b/yuthon_property_approval/views/property_lease_contract.xml @@ -885,9 +885,13 @@ + - + + + + diff --git a/yuthon_property_approval/views/property_payment_notice_views.xml b/yuthon_property_approval/views/property_payment_notice_views.xml index 0cfca9423..6c57ad783 100644 --- a/yuthon_property_approval/views/property_payment_notice_views.xml +++ b/yuthon_property_approval/views/property_payment_notice_views.xml @@ -7,9 +7,13 @@ + - + + + +