添加功能

This commit is contained in:
zhou
2025-05-23 20:31:38 +08:00
parent 4697f4aa56
commit 1657b27c68
6 changed files with 60 additions and 19 deletions
@@ -1392,3 +1392,17 @@ class KsDashboardNinjaBoard(models.Model):
rec.ks_domain_field_id.name]['selection']
}
return data
def action_ks_dashboard(self):
ks_ids = self.env["ks_dashboard_ninja.board"].browse(
self._context.get('active_ids', self._context.get('active_id')))
for rec in ks_ids:
action_id = self.env['ir.actions.actions'].search([('name', '=', rec.name)])
for group in rec.ks_dashboard_group_access:
for user in group.users:
res = self.env['res.users'].search([('id', '=', user.id)])
res.write({
'action_id':action_id.id})
@@ -92,6 +92,9 @@
<field name="model">ks_dashboard_ninja.board</field>
<field name="arch" type="xml">
<tree import="0" string="My Dashboard">
<header>
<button name="action_ks_dashboard" string="更新员工页面首页" type="object" class="btn btn-primary"/>
</header>
<field name="ks_dashboard_state" column_invisible="True"/>
<!-- invisible="1" nolabel="1"/>-->
<field name="id" column_invisible="True"/>
+1 -1
View File
@@ -41,7 +41,7 @@ class Room(models.Model):
meet_equipment = fields.Char(string="会议室设备")
office_address = fields.Char(string="会议室地址", required=True)
company_id = fields.Many2one("hr.department", string="公司", required=True)
company_id = fields.Many2one("res.company", string="公司", required=True)
meeting_type_template = fields.Selection([('template1', '默认模板')], string='会议室模板')
meet_document_id = fields.Many2one('documents.document', string="布局图片")
meet_capacity = fields.Integer(string="容纳人数", required=True)
+1 -1
View File
@@ -365,7 +365,7 @@ class HolidaysRequestBatch(models.Model):
@api.depends("users_id")
def _compute_details(self):
for record in self:
holiday_id = record.env['yuthon.holiday.setting'].search([('department_ids', 'in', record.users_id.employee_id.department_id.id)])
holiday_id = record.env['yuthon.holiday.setting'].search([('department_ids', 'in', record.users_id.employee_id.department_id.id)], limit=1)
if holiday_id:
record.details = holiday_id.name
else:
@@ -71,6 +71,7 @@ class PropertyLeaseContract(models.Model):
lease_term_year = fields.Integer(string="租期(年)")
lease_term_month = fields.Integer(string="租期(月)")
lease_term_day = fields.Integer(string="租期(日)")
is_less_than_2 = fields.Boolean(string="是否小于2年", compute="_compute_is_less_than_2", store=True)
term_start_time = fields.Date(string="合约开始时间", default=fields.Datetime.now)
term_end_time = fields.Date(string="合约结束时间")
actual_start_time = fields.Date(string="实际开始时间")
@@ -148,12 +149,13 @@ class PropertyLeaseContract(models.Model):
property_state = fields.Selection([('to', '待评估'), ('done', '已评估'), ('ing', '评估中')], string="状态", default=None)
# 附件
license_id = fields.Many2one('ir.attachment', string="营业执照")
card_id = fields.Many2one('ir.attachment', string="经办人身份证")
legal_entity_id = fields.Many2one('ir.attachment', string="法人身份证")
power_attorney_id = fields.Many2one('ir.attachment', string="授权委托书")
handle_cards_id = fields.Many2one('ir.attachment', string="经办人身份证")
asset_valuation_id = fields.Many2one('ir.attachment', string="资产评估结果明细表")
lease_contract = fields.Many2one('ir.attachment', string="租赁合同(住宅)")
confirmation_transaction_id = fields.Many2one('ir.attachment', string="成交确认书")
responsibility_book_id = fields.Many2one('ir.attachment', string="安全生产责任书")
responsibility_book_id = fields.Many2one('ir.attachment', string="安全生产责任书(住宅)")
other_id = fields.Many2one('ir.attachment', string="其他")
handover_time = fields.Date(string="交接日期")
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
@@ -164,6 +166,22 @@ class PropertyLeaseContract(models.Model):
name_title = fields.Char(default=_get_default_name_title)
def action_done(self):
contract_ids = self.env["property.lease.contract"].browse(
self._context.get('active_ids', self._context.get('active_id')))
for contract in contract_ids:
if contract.lease_term_year < 2:
contract.is_less_than_2 = True
else:
contract.is_less_than_2 = False
@api.depends('lease_term_year')
def _compute_is_less_than_2(self):
if self.lease_term_year < 2:
self.is_less_than_2 = True
else:
self.is_less_than_2 = False
def update_property(self):
contract_ids = self.env["property.lease.contract"].browse(
self._context.get('active_ids', self._context.get('active_id')))
@@ -5,6 +5,9 @@
<field name="model">property.lease.contract</field>
<field name="arch" type="xml">
<tree string="合同审批" limit="20">
<header>
<button name="action_done" string="更新" type="object" class="btn btn-primary"/>
</header>
<field name="code"/>
<field name="contract_code"/>
<field name="lessee_id"/>
@@ -94,15 +97,15 @@
<group col="2">
<group>
<field name="license_id" widget="preview_many2one"/>
<field name="card_id" widget="preview_many2one"/>
<field name="legal_entity_id" widget="preview_many2one"/>
<field name="confirmation_transaction_id" widget="preview_many2one"/>
<field name="handover_time" widget="preview_many2one"/>
<field name="lease_contract" widget="preview_many2one"/>
</group>
<group>
<field name="power_attorney_id" widget="preview_many2one"/>
<field name="handle_cards_id" widget="preview_many2one"/>
<field name="confirmation_transaction_id" widget="preview_many2one"/>
<field name="asset_valuation_id" widget="preview_many2one"/>
<field name="other_id" widget="preview_many2one"/>
</group>
</group>
</page>
@@ -176,12 +179,13 @@
日
</div>
<field name="expected_reminders"/>
<field name="is_less_than_2" invisible="1"/>
</group>
</group>
<group col="2" string="收费详细">
<group>
<label for="rent_free_period_month"/>
<div class="d-inline-flex w-100">
<label for="rent_free_period_month" invisible="is_less_than_2"/>
<div class="d-inline-flex w-100" invisible="is_less_than_2">
<field name="rent_free_period_month" required="1" class="me-2"/>
月
<field name="rent_free_period_days" required="1" class="me-2"/>
@@ -192,8 +196,8 @@
<field name="is_electricity" invisible="1"/>
<field name="is_mange" invisible="1"/>
<field name="performance_bonds_write" invisible="1"/>
<label for="first_years_begin"/>
<div class="d-inline-flex w-100">
<label for="first_years_begin" invisible="is_less_than_2"/>
<div class="d-inline-flex w-100" invisible="is_less_than_2">
<field name="first_years_begin" string="自第" class="me-2"
style="max-width: 3rem !important;"/>年开始,每
<field name="increments_every_few_years" class="me-2"
@@ -331,6 +335,7 @@
<field name="arch" type="xml">
<tree create="false" string="物业合同管理" limit="20" >
<header>
<button name="action_done" string="更新" type="object" class="btn btn-primary"/>
<!-- <button name="all_put_evaluation_plan" string="评估推送" type="object" class="btn btn-primary"/>-->
<button name="button_lease_extension" type="object" class="btn-primary" string="续租"/>
<button name="button_lease_return" type="object" class="btn-primary" string="退租"/>
@@ -452,15 +457,15 @@
<group col="2">
<group>
<field name="license_id" widget="preview_many2one"/>
<field name="card_id" widget="preview_many2one"/>
<field name="legal_entity_id" widget="preview_many2one"/>
<field name="confirmation_transaction_id" widget="preview_many2one"/>
<field name="handover_time" widget="preview_many2one"/>
<field name="lease_contract" widget="preview_many2one"/>
</group>
<group>
<field name="power_attorney_id" widget="preview_many2one"/>
<field name="handle_cards_id" widget="preview_many2one"/>
<field name="asset_valuation_id" widget="preview_many2one"/>
<field name="confirmation_transaction_id" widget="preview_many2one"/>
<field name="other_id"/>
</group>
</group>
</page>
@@ -538,12 +543,13 @@
日
</div>
<field name="expected_reminders"/>
<field name="is_less_than_2" invisible="1"/>
</group>
</group>
<group col="2" string="收费详细">
<group>
<label for="rent_free_period_month"/>
<div class="d-inline-flex w-100">
<label for="rent_free_period_month" invisible="is_less_than_2"/>
<div class="d-inline-flex w-100" invisible="is_less_than_2">
<field name="rent_free_period_month" required="1" class="me-2"/>
月
<field name="rent_free_period_days" required="1" class="me-2"/>
@@ -555,8 +561,8 @@
<field name="is_mange" invisible="1"/>
<field name="performance_bonds_write" invisible="1"/>
<field name="total_contract_receivables"/>
<label for="first_years_begin"/>
<div class="d-inline-flex w-100">
<label for="first_years_begin" invisible="is_less_than_2"/>
<div class="d-inline-flex w-100" invisible="is_less_than_2">
<field name="first_years_begin" string="自第" class="me-2"
style="max-width: 3rem !important;"/>年开始,每
<field name="increments_every_few_years" class="me-2"