添加功能
This commit is contained in:
@@ -33,7 +33,7 @@ class HrAttendance(models.Model):
|
||||
raise ("请同步{}的企业微信".format(self.name))
|
||||
url = "https://oa.thtzjt.com/mail/view?model={}&res_id={}".format(self.hr_attendance, self.employee_id.id)
|
||||
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='attendance', user_id=self.wecom_userid,
|
||||
title="打卡异常提醒", description="您有一条打卡异常请及时查看",
|
||||
title="打卡异常提醒", description="测试消息请忽略",
|
||||
url=url, btntxt="详细信息")
|
||||
|
||||
@api.depends('is_no_card', 'is_early_card', 'is_late_card')
|
||||
|
||||
@@ -44,3 +44,10 @@ class YuthonRecruitmentApproval(models.Model):
|
||||
for recruitment in record.recruitment_ids:
|
||||
recruitment.website_published = True
|
||||
|
||||
@api.onchange('recruitment_ids')
|
||||
def _onchange_recruitment_ids(self):
|
||||
name_list = []
|
||||
if self.recruitment_ids:
|
||||
for record in self.recruitment_ids:
|
||||
name_list.append(record.name)
|
||||
self.name = self.department_id.name +', '.join(name_list)+'的招聘需求申请表'
|
||||
@@ -25,8 +25,6 @@
|
||||
'views/property_meter_water_views.xml',
|
||||
'views/property_tenant_information_views.xml',
|
||||
'views/property_intention_information.xml',
|
||||
'views/property_prospective_customers.xml',
|
||||
'views/yuthon_property_lessee_views.xml',
|
||||
'views/menuitem.xml',
|
||||
],
|
||||
'demo': [],
|
||||
|
||||
@@ -11,8 +11,7 @@ from . import yuthon_property_evaluation
|
||||
from . import property_transaction_confirmed
|
||||
from . import property_meter_archives
|
||||
from . import property_meter_water
|
||||
from . import property_prospective_customers
|
||||
from . import yuthon_property_lessee
|
||||
from . import property_assess
|
||||
from . import property_tenant_information
|
||||
from . import property_intention_information
|
||||
from . import yuthon_property_lessee
|
||||
@@ -6,6 +6,9 @@ class PropertyIntentionInformation(models.Model):
|
||||
_description = '意向客户列表'
|
||||
|
||||
name = fields.Char(string='姓名')
|
||||
sincerity_gold = fields.Float(string='诚意金')
|
||||
card_id = fields.Many2one('documents.document', string="身份证")
|
||||
license_id = fields.Many2one('documents.document',string='营业执照')
|
||||
license_id = fields.Many2one('documents.document',string='营业执照')
|
||||
entity_type = fields.Selection([('person', '个人'), ('company', '企业')], string='实体类型')
|
||||
phone = fields.Char(string='联系人')
|
||||
phone_number = fields.Char(string='联系电话')
|
||||
industry = fields.Char(string='行业')
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
from odoo import models, fields, api
|
||||
|
||||
|
||||
class PropertyProspectiveCustomers(models.Model):
|
||||
_name = 'property.prospective.customers'
|
||||
_description = '意向客户列表'
|
||||
|
||||
name = fields.Char(string='标题')
|
||||
customer_name = fields.Char(string='意向客户名称')
|
||||
entity_type = fields.Selection([('person', '个人'), ('company', '企业')],string='实体类型')
|
||||
phone = fields.Char(string='联系人')
|
||||
phone_number = fields.Char(string='联系电话')
|
||||
industry = fields.Char(string='行业')
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ class PropertyTenantInformation(models.Model):
|
||||
|
||||
name = fields.Char(string='姓名')
|
||||
guarantor = fields.Char(string='担保人')
|
||||
entity_type = fields.Selection([('person', '个人'), ('company', '企业')], string='实体类型')
|
||||
contact = fields.Char(string='联系人')
|
||||
phone = fields.Char(string='联系电话')
|
||||
email = fields.Char(string='电子邮箱')
|
||||
@@ -15,4 +16,4 @@ class PropertyTenantInformation(models.Model):
|
||||
rental_purposes = fields.Many2one('yuthon.rental.purpose', string="出租用途")
|
||||
invoicing_begins = fields.Char(string="开票抬头")
|
||||
tax_number = fields.Char(string="税号")
|
||||
industry = fields.Char(string="行业")
|
||||
industry = fields.Char(string="行业")
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
from odoo import models, fields, api
|
||||
|
||||
|
||||
class YuthonPropertyLessee(models.Model):
|
||||
class PropertyLessee(models.Model):
|
||||
_name = 'yuthon.property.lessee'
|
||||
_description = '承租方列表'
|
||||
|
||||
name = fields.Char(string='标题')
|
||||
customer_name = fields.Char(string='承租方名称')
|
||||
entity_type = fields.Selection([('person', '个人'), ('company', '企业')], string='实体类型')
|
||||
phone = fields.Char(string='联系人')
|
||||
phone_number = fields.Char(string='联系电话')
|
||||
industry = fields.Char(string='行业')
|
||||
invoicing_type = fields.Char(string='开票类型')
|
||||
_description = 'Property Lessee'
|
||||
|
||||
name = fields.Char(string='Lessee Name', required=True)
|
||||
|
||||
@@ -17,8 +17,6 @@ access_yuthon_resource_billing_type,yuthon_resource_billing_type,model_yuthon_re
|
||||
access_property_transaction_confirmed,property_transaction_confirmed,model_property_transaction_confirmed,base.group_user,1,1,1,1
|
||||
access_property_meter_archives,property_meter_archives,model_property_meter_archives,base.group_user,1,1,1,1
|
||||
access_property_meter_water,property_meter_water,model_property_meter_water,base.group_user,1,1,1,1
|
||||
access_yuthon_property_lessee,yuthon_property_lessee,model_yuthon_property_lessee,base.group_user,1,1,1,1
|
||||
access_property_prospective_customers,property_prospective_customers,model_property_prospective_customers,base.group_user,1,1,1,1
|
||||
access_title_information_line,title_information_line,model_title_information_line,base.group_user,1,1,1,1
|
||||
access_manage_information_line,manage_information_line,model_manage_information_line,base.group_user,1,1,1,1
|
||||
access_disassembly_information_line,disassembly_information_line,model_disassembly_information_line,base.group_user,1,1,1,1
|
||||
|
||||
|
@@ -64,17 +64,16 @@
|
||||
sequence="8"
|
||||
name="客户管理"
|
||||
parent="yuthon_property_menu_root"/>
|
||||
<menuitem id="yuthon_property_intent_customer_management"
|
||||
sequence="1"
|
||||
<menuitem id="property_intention_information_menu"
|
||||
parent="yuthon_customer_management_menu"
|
||||
name="意向客户管理"
|
||||
action="property_intention_information_action"
|
||||
sequence="1"/>
|
||||
<menuitem id="property_tenant_information_menu"
|
||||
parent="yuthon_customer_management_menu"
|
||||
action="action_property_prospective_customers"/>
|
||||
<menuitem id="yuthon_property_customer_management"
|
||||
sequence="3"
|
||||
name="承租方管理"
|
||||
parent="yuthon_customer_management_menu"
|
||||
action="action_yuthon_property_lessee"/>
|
||||
|
||||
action="property_tenant_information_action"
|
||||
sequence="3"/>
|
||||
<menuitem id="yuthon_property_estate_menu"
|
||||
sequence="9"
|
||||
name="合同"
|
||||
@@ -292,24 +291,6 @@
|
||||
name="物业信息"
|
||||
sequence="1"
|
||||
action="yuthon_property_action"/>
|
||||
|
||||
<menuitem
|
||||
id="property_customer_information_menu"
|
||||
parent="resource_management_menu"
|
||||
name="客户信息"
|
||||
sequence="2"/>
|
||||
<menuitem
|
||||
id="property_intention_information_menu"
|
||||
parent="property_customer_information_menu"
|
||||
name="意向客户信息"
|
||||
action="property_intention_information_action"
|
||||
sequence="1"/>
|
||||
<menuitem
|
||||
id="property_tenant_information_menu"
|
||||
parent="property_customer_information_menu"
|
||||
name="承租方信息"
|
||||
action="property_tenant_information_action"
|
||||
sequence="3"/>
|
||||
<menuitem
|
||||
id="property_disassembly_management_menu"
|
||||
parent="resource_management_menu"
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="意向客户信息">
|
||||
<field name="name"/>
|
||||
<field name="sincerity_gold"/>
|
||||
<field name="entity_type"/>
|
||||
<field name="license_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -19,16 +20,19 @@
|
||||
<div class="oe_title">
|
||||
<label for="name"/>
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
<field name="name" required="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group col="2">
|
||||
<group>
|
||||
<field name="sincerity_gold"/>
|
||||
<field name="card_id"/>
|
||||
<field name="phone"/>
|
||||
<field name="entity_type"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="license_id"/>
|
||||
<field name="phone_number"/>
|
||||
<field name="industry"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="view_property_prospective_customers_tree" model="ir.ui.view">
|
||||
<field name="name">property.prospective.customers.tree</field>
|
||||
<field name="model">property.prospective.customers</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="意向客户列表">
|
||||
<field name="name"/>
|
||||
<field name="customer_name"/>
|
||||
<field name="entity_type"/>
|
||||
<field name="phone"/>
|
||||
<field name="phone_number"/>
|
||||
<field name="industry"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_property_prospective_customers_form" model="ir.ui.view">
|
||||
<field name="name">property.prospective.customers.form</field>
|
||||
<field name="model">property.prospective.customers</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="意向客户">
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<label for="name"/>
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group col="3">
|
||||
<group>
|
||||
<field name="customer_name"/>
|
||||
<field name="phone_number"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="entity_type"/>
|
||||
<field name="industry"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="phone"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_property_prospective_customers" model="ir.actions.act_window">
|
||||
<field name="name">意向客户列表</field>
|
||||
<field name="res_model">property.prospective.customers</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -27,6 +27,7 @@
|
||||
<group col="2">
|
||||
<group>
|
||||
<field name="guarantor"/>
|
||||
<field name="invoicing_type"/>
|
||||
<field name="contact"/>
|
||||
<field name="phone"/>
|
||||
<field name="email"/>
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id='yuthon_property_lessee_tree_view' model='ir.ui.view'>
|
||||
<field name='name'>yuthon.property.lessee.tree</field>
|
||||
<field name='model'>yuthon.property.lessee</field>
|
||||
<field name='arch' type='xml'>
|
||||
<tree string="承租方信息">
|
||||
<field name="name"/>
|
||||
<field name="customer_name"/>
|
||||
<field name="entity_type"/>
|
||||
<field name="phone"/>
|
||||
<field name="phone_number"/>
|
||||
<field name="industry"/>
|
||||
<field name="invoicing_type"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id='yuthon_property_lessee_form_view' model='ir.ui.view'>
|
||||
<field name='name'>yuthon.property.lessee.form</field>
|
||||
<field name='model'>yuthon.property.lessee</field>
|
||||
<field name='arch' type='xml'>
|
||||
<form string="承租方信息">
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<label for="name"/>
|
||||
<h1>
|
||||
<field name="name"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group col="3">
|
||||
<group>
|
||||
<field name="customer_name"/>
|
||||
<field name="phone_number"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="entity_type"/>
|
||||
<field name="industry"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="phone"/>
|
||||
<field name="invoicing_type"/>
|
||||
</group>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_yuthon_property_lessee" model="ir.actions.act_window">
|
||||
<field name="name">承租方信息</field>
|
||||
<field name="res_model">yuthon.property.lessee</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
||||
@@ -64,14 +64,6 @@
|
||||
name="续租审批审批"
|
||||
action="property_lease_alter_action"
|
||||
sequence="29"/>
|
||||
|
||||
<menuitem
|
||||
id="property_lease_contract_menu"
|
||||
parent="yuthon_property.property_approval_menu"
|
||||
name="租赁合同审批"
|
||||
action="property_lease_contract_action"
|
||||
sequence="30"/>
|
||||
|
||||
<menuitem
|
||||
id="property_lease_extension_menu"
|
||||
parent="yuthon_property.property_approval_menu"
|
||||
@@ -173,12 +165,6 @@
|
||||
name="物业移交审批"
|
||||
action="property_handover_action"
|
||||
sequence="7"/>
|
||||
<menuitem
|
||||
id="property_transfer_approval_menu"
|
||||
parent="yuthon_property.resource_management_menu"
|
||||
name="物业交接审批"
|
||||
action="view_property_transfer_action"
|
||||
sequence="8"/>
|
||||
<menuitem
|
||||
id="property_merge_approval_views_menu"
|
||||
parent="yuthon_property.resource_management_menu"
|
||||
@@ -257,4 +243,16 @@
|
||||
name="承租方资格审批"
|
||||
parent="yuthon_property_customer_process_management"
|
||||
action="property_eligibility_action"/>
|
||||
<!-- 合同 -->
|
||||
<menuitem id="property_transfer_approval_menu"
|
||||
parent="yuthon_property.yuthon_property_estate_menu"
|
||||
name="物业交接审批"
|
||||
action="view_property_transfer_action"
|
||||
sequence="3"/>
|
||||
<menuitem id="property_lease_contract_menu"
|
||||
parent="yuthon_property.yuthon_property_estate_menu"
|
||||
name="租赁合同审批"
|
||||
action="property_lease_contract_action"
|
||||
sequence="5"/>
|
||||
|
||||
</odoo>
|
||||
@@ -29,6 +29,11 @@
|
||||
<field name="is_issues"/>
|
||||
<field name="related_issues_id" invisible="not is_issues"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="审批事项">
|
||||
<field name="name" required="1"/>
|
||||
<field name="reason"/>
|
||||
<field name="notice_documents_ids" widget="preview_many2many"/>
|
||||
</group>
|
||||
<group string="物业信息">
|
||||
<group>
|
||||
@@ -99,11 +104,6 @@
|
||||
<field name="transfer_remark"/>
|
||||
</group>
|
||||
</notebook>
|
||||
<group string="审批事项">
|
||||
<field name="name" required="1"/>
|
||||
<field name="reason"/>
|
||||
<field name="notice_documents_ids" widget="preview_many2many"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
'version': '0.1',
|
||||
'license': 'LGPL-3',
|
||||
'data': [
|
||||
'data/will_task_time_data.xml',
|
||||
'security/yuthon_will_task_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/task_type_setting_views.xml',
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<record forcecreate="True" id="will_task_time_data" model="ir.cron">
|
||||
<field name="name">定时任务:待办任务提醒</field>
|
||||
<field name="model_id" ref="model_yuthon_will_task"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">model.will_task_time()</field>
|
||||
<field eval="False" name="active"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="interval_number">2</field>
|
||||
<field name="interval_type">minutes</field>
|
||||
<field name="nextcall" eval="(DateTime.now() + timedelta(minutes=2)).strftime('%Y-%m-%d %H:%M:%S')"/>
|
||||
<field name="numbercall">-1</field>
|
||||
<field eval="False" name="doall"/>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -1,5 +1,6 @@
|
||||
from odoo import api, fields, models, modules
|
||||
import datetime
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
|
||||
class YuthonWillTask(models.Model):
|
||||
@@ -18,3 +19,28 @@ class YuthonWillTask(models.Model):
|
||||
('two_hour', '提醒-2小时'), ('one_day', '提醒-1天')], string='提醒')
|
||||
start_time = fields.Datetime(string='开始时间')
|
||||
end_time = fields.Datetime(string='结束时间')
|
||||
|
||||
remind_mapping = {
|
||||
'fifteen': timedelta(minutes=15),
|
||||
'thirty': timedelta(minutes=30),
|
||||
'one_hour': timedelta(hours=1),
|
||||
'two_hour': timedelta(hours=2),
|
||||
'one_day': timedelta(days=1),
|
||||
}
|
||||
|
||||
def will_task_time(self):
|
||||
for task in self.env['yuthon.will.task'].search([]):
|
||||
time_difference = task.end_time - datetime.now()
|
||||
for remind, duration in self.remind_mapping.items():
|
||||
if task.remind == remind and time_difference <= duration:
|
||||
task.add_comment()
|
||||
|
||||
def add_comment(self):
|
||||
self.ensure_one()
|
||||
if not self.wecom_userid:
|
||||
raise ("请同步{}的企业微信".format(self.name))
|
||||
for employee_id in self.employee_ids:
|
||||
url = "https://oa.thtzjt.com/mail/view?model={}&res_id={}".format(self.yuthon_will_task,employee_id.id)
|
||||
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='attendance', user_id=self.wecom_userid,
|
||||
title="待办事项", description="测试消息请忽略",
|
||||
url=url, btntxt="详细信息")
|
||||
Reference in New Issue
Block a user