添加功能

This commit is contained in:
李鹏宇
2025-09-11 17:04:53 +08:00
parent 518095b44f
commit 1bc4a86808
26 changed files with 497 additions and 249 deletions
@@ -28,19 +28,20 @@ class SoongWorkflowRecordDeleteWizard(models.TransientModel):
})
target_model = self.env[record.res_model]
target_record = target_model.sudo().browse(record.res_id)
if target_model._name in ["hr.leave.batch"]:
if target_record.leave_ids:
for leave in target_record.leave_ids:
leave.sudo().with_context(from_cancel_wizard=True).write({
"state": "confirm",
"active": False
})
if target_record.hour_leave_ids:
for hour_leave in target_record.hour_leave_ids:
hour_leave.sudo().with_context(from_cancel_wizard=True).write({
"state": "confirm",
"active": False
})
if target_record:
if target_model._name in ["hr.leave.batch"]:
if target_record.leave_ids:
for leave in target_record.leave_ids:
leave.sudo().with_context(from_cancel_wizard=True).write({
"state": "confirm",
"active": False
})
if target_record.hour_leave_ids:
for hour_leave in target_record.hour_leave_ids:
hour_leave.sudo().with_context(from_cancel_wizard=True).write({
"state": "confirm",
"active": False
})
target_record.write({'active': False})
else:
self.env["soong.workflow.record"].sudo().search(
@@ -24,7 +24,7 @@ class LeaveAllocationWizard(models.Model):
raise ValidationError('请上传文件。')
book = xlrd.open_workbook(file_contents=base64.decodebytes(self.excel_file))
sh = book.sheet_by_index(0)
for rx in range(1, sh.nrows):
for rx in range(1, 2):
row = sh.row(rx)
self.salary_import(row)
@@ -35,29 +35,28 @@ class LeaveAllocationWizard(models.Model):
holiday_status_id = self.env['hr.leave.type'].search([('name', '=', '年假'), ('company_id', '=', '天河物管')], limit=1)
holiday_status_id1 = self.env['hr.leave.type'].search([('name', '=', '补休')], limit=1)
accrual_plan_id = self.env['hr.leave.accrual.plan'].search([('name', '=', '年假(天河物管)')], limit=1)
if row[1].value:
number_of_days_display = int(row[1].value)/8
else:
number_of_days_display = 0
self.env['hr.leave.allocation'].create({
'employee_id': employee_id.id,
'name': '年假公司分配',
'number_of_days': number_of_days_display,
'employee_ids': [(6, 0, [employee_id.id])],
'holiday_status_id': holiday_status_id.id,
'accrual_plan_id': accrual_plan_id.id,
'allocation_type': 'accrual',
"number_of_days_display":number_of_days_display,
'notes':'年假公司分配'
})
self.env['hr.leave.allocation'].create({
'employee_id': employee_id.id,
'name': '补休',
'employee_ids': [(6, 0, [employee_id.id])],
'holiday_status_id' : holiday_status_id1.id,
'number_of_hours_display':row[2].value,
})
if row[1].value and int(row[1].value) != 0:
number_of_days_display = int(row[1].value) / 8
self.env['hr.leave.allocation'].create({
'employee_id': employee_id.id,
'name': '年假公司分配',
'number_of_days': number_of_days_display,
'employee_ids': [(6, 0, [employee_id.id])],
'holiday_status_id': holiday_status_id.id,
'accrual_plan_id': accrual_plan_id.id,
'allocation_type': 'accrual',
"number_of_days_display": number_of_days_display,
'notes': '年假公司分配'
})
if row[2].value and int(row[2].value) != 0:
self.env['hr.leave.allocation'].create({
'holiday_status_id': holiday_status_id1.id,
'employee_id': employee_id.id,
'name': '补休',
'employee_ids': [(6, 0, [employee_id.id])],
'number_of_hours_display': int(row[2].value)
})
@@ -180,6 +180,7 @@ class OvertimeApprovals(models.Model):
if self.meal == 'yes':
meal_number += 1
employee_id.write({'meal_number': meal_number})
holiday_status_id = self.env['hr.leave.type'].search([('name', '=', '补休')])
allocation = self.env['hr.leave.allocation'].create({
'employee_id': employee_id.id,
@@ -224,6 +225,17 @@ class OvertimeApprovals(models.Model):
'update_date': fields.Datetime.now(),
'text': '审批'
}
if self.meal == 'yes':
meal_fee_value = (0, 0, {
'vacation_id': reports_id.id,
'update_type': 'add',
'workflow_record_id': workflow_record_id.id,
'update_date': fields.Datetime.now(),
'update_lines': 1,
'text': '审批'
})
reports_id.write({'meal_fee_ids': [meal_fee_value]})
reports_id.write({'overtime_ids': [(0, 0, overtime_data)]})
@api.depends('users_id', 'duration')
+1
View File
@@ -55,6 +55,7 @@
'views/property_accounting_approval_views.xml',
'views/property_record_views.xml',
'views/property_equity_views.xml',
'views/payment_process_viwes.xml',
'views/property_handover_views.xml',
'views/property_merge_approval_views.xml',
'views/property_current_approval_views.xml',
@@ -7,7 +7,13 @@
<field name="padding">3</field>
<field name="company_id" eval="False"/>
</record>
<record id="payment_process_code_sequence" model="ir.sequence">
<field name="name">支付流程编号</field>
<field name="code">payment_process_code</field>
<field name="prefix">ZF%(y)s%(month)s%(day)s</field>
<field name="padding">3</field>
<field name="company_id" eval="False"/>
</record>
<record id="property_business_confirm_code_sequence" model="ir.sequence">
<field name="name">经营报表确认单编号</field>
<field name="code">property_business_confirm_code</field>
+2 -1
View File
@@ -55,4 +55,5 @@ from . import property_accounts_approval
from . import inherit_property_tenant_information
from . import property_meeting_approval
from . import property_lessee_analysis
from . import yuthon_property_ledger
from . import yuthon_property_ledger
from . import payment_process
@@ -0,0 +1,32 @@
from odoo import models, fields, api
class PaymentProcess(models.Model):
_name = 'payment.process'
_description = '支付流程'
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
code = fields.Char(string="编号", readonly=True,default=lambda self: self.env['ir.sequence'].next_by_code('payment_process_code'))
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="部门")
company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司")
supervising_id = fields.Many2one('property.supervising.approval', string='合同编号')
reason = fields.Text(related='supervising_id.reason', string='事项')
payment_instructions = fields.Text(string='支付说明')
payment_nodes = fields.Selection([('first', '一期'), ('second', '二期'), ('third', '三期'), ('fourth', '四期')],
string="支付节点")
amount = fields.Float(string="金额")
documents_id = fields.Many2one('ir.attachment', string="附件")
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])])
@@ -7,28 +7,26 @@ from odoo.exceptions import UserError, ValidationError
class PropertyAccountingApproval(models.Model):
_name = 'property.accounting.approval'
_description = '建设工程委托核算合同审批'
_description = '建设工程委托监理合同审批 '
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
name = fields.Char(string='标题')
name = fields.Char(string='合同编号')
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_accounting_approval_code'))
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="部门")
company_id = fields.Many2one('yuthon.property.company', string="甲方")
company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司")
company_a_id = fields.Many2one('yuthon.property.company', string="甲方")
budget_list_id = fields.Many2one('ir.attachment', string="预算清单")
project_content = fields.Char(string="工程内容")
image = fields.Binary(string="维修前图片")
company_b_id = fields.Many2one('property.construction.unit', string="乙方")
property_id = fields.Many2one('yuthon.property', string='物业')
reason = fields.Text(string="正文")
three_point_offer = fields.Text(string="三方报价")
documents_ids = fields.Many2many('ir.attachment', string="附件")
contract_id = fields.Many2one('ir.attachment', string="合同")
property_address = fields.Char(string='物业地址')
contract_amount = fields.Float(string="合同金额")
start_date = fields.Date(string="开始日期")
end_date = fields.Date(string="结束日期")
amount = fields.Float(string="总金额")
is_tex = fields.Boolean(string="是否含税")
lack = fields.Float(string="差额")
percentage = fields.Float(string="差额百分比")
contract_id = fields.Many2one('ir.attachment', string="合同")
accounting_way_ids = fields.One2many('accounting.way.line', 'accounting_id', string="关联支付方式明细行")
lease_ids = fields.One2many('property.lease.contract.line', 'accounting_id', string="物业信息明细")
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
active = fields.Boolean('Active', default=True, tracking=True)
@@ -44,8 +42,10 @@ class PropertyAccountingApproval(models.Model):
class AccountingWayLine(models.Model):
_name = 'accounting.way.line'
pay_way = fields.Selection([('cumulative', '累计项'), ('stage', '单项'), ('other', '其他')], string="付款方式",)
interval = fields.Char(string="区间")
service_charge = fields.Float(string="服务费")
payment_nodes = fields.Selection([('first', '一期'), ('second', '二期'), ('third', '三期'), ('fourth', '四期')],
string="支付节点")
payout_ratio = fields.Float(string="支付比例")
amount = fields.Float(string="金额")
remake = fields.Char(string="备注")
payment_instructions = fields.Text(string="支付说明")
accounting_id = fields.Many2one('property.accounting.approval', string="关联核算方式")
@@ -7,7 +7,7 @@ from odoo.exceptions import UserError, ValidationError
class PropertyConstructionApproval(models.Model):
_name = 'property.construction.approval'
_description = '建设工程施工合同审批'
_description = '建设工程造价咨询合同审批'
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
name = fields.Char(string='标题')
@@ -15,19 +15,21 @@ class PropertyConstructionApproval(models.Model):
default=lambda self: self.env['ir.sequence'].next_by_code('property_construction_approval_code'))
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="部门")
company_id = fields.Many2one('yuthon.property.company', string="甲方")
company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司")
company_a_id = fields.Many2one('yuthon.property.company', string="甲方")
project_content = fields.Char(string="工程内容")
company_b_id = fields.Many2one('property.construction.unit', string="乙方")
property_id = fields.Many2one('yuthon.property', string='物业')
property_address = fields.Char(string='物业地址')
reason = fields.Text(string="正文")
image = fields.Binary(string="开工前图片")
contract_id = fields.Many2one('ir.attachment', string="合同")
start_date = fields.Date(string="开始日期")
end_date = fields.Date(string="结束日期")
review_price = fields.Float(string="审核价")
budget_list_id = fields.Many2one('ir.attachment', string="预算清单")
start_date = fields.Date(string="代理开始日期")
end_date = fields.Date(string="代理结束日期")
business_type = fields.Char(string="业务类型")
contract_amount = fields.Float(string="合同金额")
payment_methods = fields.Char(string="付款方式")
contract_id = fields.Many2one('ir.attachment', string="合同")
payment_methods = fields.Selection([('onetime', '一次性'), ('installment', '分期')], string="付款方式")
lease_ids = fields.One2many('property.lease.contract.line', 'construction_id', string="物业信息明细")
construction_way_ids = fields.One2many('construction.way.line', 'construction_id', string="关联支付方式")
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
@@ -43,12 +45,14 @@ class PropertyConstructionApproval(models.Model):
class ConstructionWayLine(models.Model):
_name = 'construction.way.line'
_description = '施工支付方式'
_description = '价咨询合同审批支付方式'
name = fields.Char(string="支付节点")
pay_ratio = fields.Float(string="支付比例%")
payment_nodes = fields.Selection([('first', '一期'), ('second', '二期'), ('third', '三期'), ('fourth', '四期')],
string="支付节点")
payout_ratio = fields.Float(string="支付比例")
coping_date = fields.Date(string="应付日期")
amount = fields.Float(string="金额")
paid_time = fields.Text(string="付费时间")
remake = fields.Char(string="备注")
construction_id = fields.Many2one('property.construction.approval', string="关联施工合同")
payment_instructions = fields.Text(string="支付说明")
construction_id = fields.Many2one('property.construction.approval', string="关联价咨询合同审批")
@@ -6,19 +6,27 @@ from odoo import models, fields, api, exceptions, _
class PropertyDelegatedAgent(models.Model):
_name = 'property.delegated.agent'
_description = '零星工程'
_description = '零星工程年度委托合同审批'
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
name = fields.Char(string="名称")
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
name = fields.Char(string="合同编号")
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_delegated_agent_code'))
annual = fields.Char(string="年度")
contract_date = fields.Date(string="合同有效期")
signing_date = fields.Date(string="签订日期")
payment_date = fields.Date(string="付款日期")
consult_fee = fields.Float(string="咨询费")
quotations_list_id = fields.Many2one('ir.attachment', string="报价清单")
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司")
company_a_id = fields.Many2one('yuthon.property.company', string="甲方")
company_b_id = fields.Many2one('property.construction.unit', string="乙方")
matters = fields.Text(string="事项")
text = fields.Text(string="正文")
license_id = fields.Many2one('ir.attachment', string='营业执照')
aptitude_id = fields.Many2one('ir.attachment', string='资质')
contract_id = fields.Many2one('ir.attachment', string='合同')
legal_person_id_card = fields.Many2one('ir.attachment', string='法人身份证')
bid_winning = fields.Many2one('ir.attachment', string='中标确认书')
service_start_date = fields.Date(string="服务开始时间")
service_end_date = fields.Date(string="服务结束时间")
settlement_method = fields.Selection([('cash', '预算审核'), ('bank', '结算审核')], string='结算方式', default='cash')
floating = fields.Float(string="下浮%")
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
active = fields.Boolean('Active', default=True, tracking=True)
@@ -4,27 +4,28 @@ from odoo.exceptions import UserError, ValidationError
class PropertyDesignApproval(models.Model):
_name = 'property.design.approval'
_description = '工程设计合同审批'
_description = '建设工程设计合同审批'
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
name = fields.Char(string='标题')
name = fields.Char(string='合同编号')
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_design_approval_code'))
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="部门")
company_id = fields.Many2one('yuthon.property.company', string="甲方")
project_content = fields.Char(string="工程内容")
company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司")
company_a_id = fields.Many2one('yuthon.property.company', string="甲方")
company_b_id = fields.Many2one('property.construction.unit', string="乙方")
property_id = fields.Many2one('yuthon.property', string='物业')
budget_list_id = fields.Many2one('ir.attachment', string="预算清单")
property_address = fields.Char(string='物业地址')
reason = fields.Text(string="正文")
three_point_offer = fields.Text(string="三方报价")
image = fields.Binary(string="开工前图片")
contract_id = fields.Many2one('ir.attachment', string="合同")
start_date = fields.Date(string="开始日期")
end_date = fields.Date(string="结束日期")
review_price = fields.Float(string="审核价")
business_type = fields.Char(string="业务类型")
contract_amount = fields.Float(string="合同金额")
payment_methods = fields.Char(string="付款方式")
payment_methods = fields.Selection([('onetime', '一次性'), ('installment', '分期')], string="付款方式")
lease_ids = fields.One2many('property.lease.contract.line', 'design_id', string="关联租赁信息")
business_type = fields.Char(string="业务类型")
design_way_ids = fields.One2many('design.way.line', 'design_id', string="关联支付方式")
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
@@ -42,9 +43,10 @@ class DesignWayLine(models.Model):
_name = 'design.way.line'
_description = '施工支付方式'
name = fields.Char(string="支付节点")
pay_ratio = fields.Float(string="支付比例%")
payment_nodes = fields.Selection([('first', '一期'), ('second', '二期'), ('third', '三期'), ('fourth', '四期')],
string="支付节点")
payout_ratio = fields.Float(string="支付比例")
amount = fields.Float(string="金额")
paid_time = fields.Text(string="付费时间")
remake = fields.Char(string="备注")
payment_instructions = fields.Text(string="支付说明")
design_id = fields.Many2one('property.design.approval', string="关联施工合同")
@@ -1658,6 +1658,11 @@ class PropertyLeaseContractLine(models.Model):
_description = '物业列表明细行'
lease_id = fields.Many2one('property.lease.contract', string="关联凭租合同审批")
construction_id = fields.Many2one('property.construction.approval', string="关联建设工程造价咨询合同审批")
project_id = fields.Many2one('property.project.approval', string="关联工程立项")
design_id = fields.Many2one('property.design.approval', string="关联建设工程设计合同审批")
accounting_id = fields.Many2one('property.accounting.approval', string="关联建设工程委托监理合同审批")
supervising_id = fields.Many2one('property.supervising.approval', string="关联建设工程施工合同审批")
address_id = fields.Many2one('yuthon.property', string="物业地址")
admin_line_id = fields.Many2one(related='address_id.admin_id', string="管理员")
property_area = fields.Float(related='address_id.management_area', string="面积")
@@ -12,12 +12,13 @@ class PropertyProjectApproval(models.Model):
default=lambda self: self.env['ir.sequence'].next_by_code('property_project_approval_code'))
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_id = fields.Many2one('yuthon.property', string='物业')
property_address = fields.Char(string='物业地址')
background_note = fields.Html(string="背景说明")
documents_id = fields.Many2one('ir.attachment', string="建议书/可研报告")
amount = fields.Float(string="预算金额")
start_date = fields.Date(string="开始日期")
end_date = fields.Date(string="结束日期")
lease_ids = fields.One2many('property.lease.contract.line', 'project_id', string="物业信息")
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
active = fields.Boolean('Active', default=True, tracking=True)
@@ -4,19 +4,25 @@ from odoo.exceptions import UserError
class PropertySporadicWorks(models.Model):
_name = 'property.sporadic.works'
_description = '委托招标代理'
_description = '项目委托招标代理合同'
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
name = fields.Char(string="工程名称", required=True)
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_sporadic_works_code'))
name = fields.Char(string="合同编号", required=True)
code = fields.Char(string="流水号", default=lambda self: self.env['ir.sequence'].next_by_code('property_sporadic_works_code'))
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
company_a_id = fields.Many2one('yuthon.property.company', string="甲方")
company_b_id = fields.Many2one('property.construction.unit', string="乙方")
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
signing_date = fields.Date(string="签订日期")
acceptance_date = fields.Date(string="验收日期")
total = fields.Float(string="总金额")
coping = fields.Float(string="应付")
paid = fields.Float(string="已付")
not_paid = fields.Float(string="未付")
company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司")
text = fields.Text(string="正文")
three_quotation_id = fields.Many2one('ir.attachment', string="三方报价")
service_contract = fields.Many2one('ir.attachment', string="服务合同")
service_start_date = fields.Date(string="服务开始时间")
service_end_date = fields.Date(string="服务结束时间")
standard_amount = fields.Float(string="标准金额")
service_fee = fields.Float(string="服务费")
settlement_party = fields.Selection([('self' , '我方'), ('other', '中标方')], string="结算方")
payment_methods = fields.Selection([('onetime', '一次性'), ('installment', '分期')], string="付款方式")
payment_methods_line_ids = fields.One2many('payment.methods.line', 'payment_methods_id', string="付款方式明细行")
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
@@ -34,10 +40,10 @@ class PaymentMethodsLine(models.Model):
_name = 'payment.methods.line'
_description = '付款方式明细行'
name = fields.Char(string="合同阶段")
payment_nodes = fields.Selection([('first', '一期' ), ('second', '二期'), ('third', '三期'), ('fourth', '四期')], string="支付节点")
payout_ratio = fields.Float(string="支付比例")
coping_date = fields.Date(string="应付日期")
amount = fields.Float(string="金额")
remake = fields.Char(string="备注")
quotations_list_id = fields.Many2one('ir.attachment', string="报价清单")
accounting_list_id = fields.Many2one('ir.attachment', string="核算清单")
payment_instructions = fields.Text(string="支付说明")
payment_methods_id = fields.Many2one('property.sporadic.works', string="关联付款方式")
@@ -4,30 +4,35 @@ from odoo.exceptions import UserError, ValidationError
class PropertySupervisingApproval(models.Model):
_name = 'property.supervising.approval'
_description = '工程设计合同审批'
_description = '建设工程施工合同审批 '
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
name = fields.Char(string='标题')
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('property_supervising_code'))
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="部门")
company_id = fields.Many2one('yuthon.property.company', string="甲方")
project_content = fields.Char(string="工程内容")
company_b_id = fields.Many2one('property.construction.unit', string="乙方")
property_id = fields.Many2one('yuthon.property', string='物业')
reason = fields.Text(string="正文")
documents_ids = fields.Many2many('ir.attachment', string="附件")
contract_id = fields.Many2one('ir.attachment', string="合同")
start_date = fields.Date(string="开始日期")
end_date = fields.Date(string="结束日期")
review_price = fields.Float(string="审核价")
business_type = fields.Char(string="业务类型")
contract_amount = fields.Float(string="合同金额")
payment_methods = fields.Char(string="付款方式")
supervising_way_ids = fields.One2many('supervising.way.line', 'supervising_id', string="关联支付方式")
urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
default='normal')
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="部门")
company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司")
company_a_id = fields.Many2one('yuthon.property.company', string="甲方")
company_b_id = fields.Many2one('property.construction.unit', string="乙方")
budget_list_id = fields.Many2one('ir.attachment', string="预算清单")
property_address = fields.Char(string='物业地址')
reason = fields.Text(string="正文")
image = fields.Binary(string="开工前图片")
contract_id = fields.Many2one('ir.attachment', string="合同")
start_date = fields.Date(string="开始日期")
project_content = fields.Char(string="工程内容")
end_date = fields.Date(string="结束日期")
review_price = fields.Float(string="审核价")
floating = fields.Float(string="浮动")
contract_amount = fields.Float(string="合同金额")
payment_methods = fields.Selection([('onetime', '一次性'), ('installment', '分期')], string="付款方式")
lease_ids = fields.One2many('property.lease.contract.line', 'supervising_id', string="物业信息明细")
business_type = fields.Char(string="业务类型")
active = fields.Boolean('Active', default=True, tracking=True)
work_end = fields.Boolean(string="结束")
@@ -41,7 +46,8 @@ class SupervisingWayLine(models.Model):
_name = 'supervising.way.line'
_description = '施工支付方式'
name = fields.Char(string="支付节点")
payment_nodes = fields.Selection([('first', '一期'), ('second', '二期'), ('third', '三期'), ('fourth', '四期')],
string="支付节点")
pay_ratio = fields.Float(string="支付比例%")
amount = fields.Float(string="金额")
remake = fields.Char(string="备注")
@@ -102,5 +102,6 @@ access_binding_information_wizard,binding_information_wizard,model_binding_infor
access_yuthon_property_ledger, yuthon_property_ledger,model_yuthon_property_ledger,base.group_user,1,1,1,1
access_property_lessee_analysis,property_lessee_analysis,model_property_lessee_analysis,base.group_user,1,1,1,1
access_contract_signature_wizard,contract_signature_wizard,model_contract_signature_wizard,base.group_user,1,1,1,1
access_payment_process,payment_process,model_payment_process,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
102 access_property_lessee_analysis property_lessee_analysis model_property_lessee_analysis base.group_user 1 1 1 1
103 access_contract_signature_wizard contract_signature_wizard model_contract_signature_wizard base.group_user 1 1 1 1
104 access_payment_process payment_process model_payment_process base.group_user 1 1 1 1
105
106
107
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_payment_process_tree" model="ir.ui.view">
<field name="name">payment.process.tree</field>
<field name="model">payment.process</field>
<field name="arch" type="xml">
<tree string="支付流程">
<field name="supervising_id"/>
<field name="reason"/>
<field name="payment_instructions"/>
</tree>
</field>
</record>
<record id="view_payment_process_form" model="ir.ui.view">
<field name="name">payment.process.form</field>
<field name="model">payment.process</field>
<field name="arch" type="xml">
<form string="支付流程">
<sheet>
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
invisible="urgency_level != 'normal'"/>
<widget name="web_ribbon" title="急件" bg_color="text-bg-warning"
invisible="urgency_level != 'urgent'"/>
<widget name="web_ribbon" title="特级" bg_color="text-bg-danger"
invisible="urgency_level != 'emergency'"/>
<group col="3">
<group>
<field name="code" string="流水号" readonly="1"/>
</group>
<group>
<field name="urgency_level" readonly="1"/>
</group>
<group/>
</group>
<div class="col-12 text-center">
<h1>
<field name="name_title" readonly="1"/>
</h1>
</div>
<group>
<field name="name" required="1" string="合同编号:"/>
</group>
<group string="审批事项">
<field name="users_id"/>
<field name="supervising_id"/>
<field name="reason"/>
<field name="payment_instructions"/>
<field name="payment_nodes"/>
<field name="amount"/>
<field name="documents_id" widget="many2many_tags"/>
<field name="department_id" invisible="1"/>
<field name="company_id" invisible="1"/>
</group>
</sheet>
</form>
</field>
</record>
</odoo>
@@ -4,7 +4,7 @@
<field name="name">property.accounting.approval.tree</field>
<field name="model">property.accounting.approval</field>
<field name="arch" type="xml">
<tree string="建设工程委托核算合同审批">
<tree string="建设工程委托监理合同审批">
<field name="name"/>
<field name="company_id" required="1"/>
<field name="company_b_id"/>
@@ -17,7 +17,7 @@
<field name="name">property.accounting.approval.form</field>
<field name="model">property.accounting.approval</field>
<field name="arch" type="xml">
<form string="建设工程委托核算合同审批" create="0">
<form string="建设工程委托监理合同审批" create="0">
<sheet>
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
invisible="urgency_level != 'normal'"/>
@@ -42,49 +42,56 @@
<group>
<field name="name" required="1" string="合同编号:"/>
</group>
<group col="2">
<group col="2">
<group>
<field name="company_id" required="1"/>
<field name="project_content"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="company_a_id"/>
</group>
<group>
<field name="company_b_id" options="{'no_create': True}"/>
<field name="property_id" options="{'no_create': True}"/>
<field name="company_b_id"/>
</group>
</group>
<group>
<field name="work_end" invisible="1"/>
<field name="users_id"/>
<field name="property_address"/>
<field name="reason"/>
<field name="three_point_offer"/>
<field name="documents_ids" widget="preview_many2many"/>
<field name="image"/>
<field name="budget_list_id" widget="preview_many2one"/>
<field name="contract_id" widget="preview_many2one"/>
</group>
<group col="2">
<group>
<field name="start_date"/>
<field name="amount"/>
</group>
<group>
<field name="end_date"/>
<field name="is_tex"/>
</group>
</group>
<label for="lack"/>
<label for="start_date"/>
<div class="d-inline-flex w-100">
<field name="lack" class="me-2" style="max-width: 11rem !important;" string=" "/>不足
<field name="percentage" class="me-2" style="max-width: 11rem !important;"/>元收百分比
<field name="start_date" class="me-2" style="max-width: 7rem;"
string="代理期限"/>至
<field name="end_date" class="me-2" style="max-width: 7rem;"
force_save="1"/>
</div>
<field name="contract_amount"/>
<field name="business_type"/>
<field name="payment_methods"/>
<field name="work_end" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="project_content"/>
<field name="department_id" invisible="1"/>
</group>
<notebook>
<page string="物业信息">
<field name="lease_ids">
<tree editable="bottom" create="false">
<field name="accounting_id" column_invisible="1"/>
<field name="address_id"/>
<field name="admin_line_id"/>
<field name="property_area"/>
<field name="evaluate_unit_price"/>
</tree>
</field>
</page>
<page string="支付方式">
<field name="accounting_way_ids">
<tree editable="bottom">
<field name="accounting_id" column_invisible="1"/>
<field name="pay_way"/>
<field name="interval"/>
<field name="service_charge"/>
<field name="remake"/>
<field name="accounting_id" column_invisible="1"/>
<field name="payment_nodes"/>
<field name="coping_date"/>
<field name="amount"/>
<field name="remake"/>
</tree>
</field>
</page>
@@ -94,7 +101,7 @@
</field>
</record>
<record id="view_property_accounting_approval_action" model="ir.actions.act_window">
<field name="name">核算审批</field>
<field name="name">建设工程委托监理合同审批</field>
<field name="res_model">property.accounting.approval</field>
<field name="view_mode">tree,form</field>
</record>
@@ -27,7 +27,7 @@
invisible="urgency_level != 'emergency'"/>
<group col="3">
<group>
<field name="code" string="流水号" readonly="1"/>
<field name="code" string="合同编号" readonly="1"/>
</group>
<group>
<field name="urgency_level" readonly="1"/>
@@ -40,49 +40,57 @@
</h1>
</div>
<group>
<field name="name" required="1" string="合同编号:"/>
<field name="name" readonly="1"/>
</group>
<group col="2">
<group>
<field name="work_end" invisible="1"/>
<field name="company_id" required="1"/>
<field name="project_content"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="company_a_id"/>
</group>
<group>
<field name="company_b_id" options="{'no_create': True}"/>
<field name="property_id" options="{'no_create': True}"/>
<field name="company_b_id"/>
</group>
</group>
<group>
<field name="user_id"/>
<field name="property_address"/>
<field name="department_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="reason"/>
<field name="image"/>
<field name="budget_list_id" widget="preview_many2one"/>
<field name="contract_id" widget="preview_many2one"/>
</group>
<group col="2">
<group>
<field name="contract_amount"/>
<field name="start_date"/>
<field name="review_price"/>
</group>
<group>
<field name="payment_methods"/>
<field name="end_date"/>
<field name="business_type"/>
</group>
<label for="start_date"/>
<div class="d-inline-flex w-100">
<field name="start_date" class="me-2" style="max-width: 7rem;"
string="代理期限"/>至
<field name="end_date" class="me-2" style="max-width: 7rem;"
force_save="1"/>
</div>
<field name="contract_amount"/>
<field name="business_type"/>
<field name="payment_methods"/>
</group>
<notebook>
<page string="物业信息">
<field name="lease_ids">
<tree editable="bottom" create="false">
<field name="construction_id" column_invisible="1"/>
<field name="address_id"/>
<field name="admin_line_id"/>
<field name="property_area"/>
<field name="evaluate_unit_price"/>
</tree>
</field>
</page>
<page string="支付方式">
<field name="construction_way_ids">
<tree editable="bottom">
<field name="construction_id" column_invisible="1"/>
<field name="name"/>
<field name="pay_ratio"/>
<tree editable="bottom">
<field name="construction_id" column_invisible="1"/>
<field name="payment_nodes"/>
<field name="coping_date"/>
<field name="amount"/>
<field name="paid_time"/>
<field name="remake"/>
</tree>
</tree>
</field>
</page>
</notebook>
@@ -6,10 +6,8 @@
<field name="arch" type="xml">
<tree string="零星工程">
<field name="name"/>
<field name="annual"/>
<field name="contract_date"/>
<field name="payment_date"/>
<field name="consult_fee"/>
<field name="service_start_date"/>
<field name="service_end_date"/>
</tree>
</field>
</record>
@@ -45,14 +43,43 @@
<field name="name" required="1"/>
</h1>
</div>
<group col="2">
<group>
<field name="company_a_id"/>
</group>
<group>
<field name="company_b_id"/>
</group>
</group>
<group>
<field name="user_id"/>
<field name="department_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="work_end" invisible="1"/>
<field name="annual"/>
<field name="contract_date"/>
<field name="signing_date"/>
<field name="payment_date"/>
<field name="consult_fee"/>
<field name="quotations_list_id" widget="preview_many2one"/>
<field name="matters"/>
<field name="text"/>
</group>
<group col="2">
<group>
<field name="license_id" widget="preview_many2one"/>
<field name="aptitude_id" widget="preview_many2one"/>
<field name="contract_id" widget="preview_many2one"/>
</group>
<group>
<field name="legal_person_id_card" widget="preview_many2one"/>
<field name="bid_winning" widget="preview_many2one"/>
</group>
</group>
<group>
<label for="service_start_date"/>
<div class="d-inline-flex w-100">
<field name="service_start_date" class="me-2" style="max-width: 7rem;"
string="服务期限"/>至
<field name="service_end_date" class="me-2" style="max-width: 7rem;"
force_save="1"/>
</div>
<field name="settlement_method"/>
<field name="floating"/>
</group>
</sheet>
</form>
@@ -44,43 +44,53 @@
</group>
<group col="2">
<group>
<field name="work_end" invisible="1"/>
<field name="company_id" required="1"/>
<field name="project_content"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="company_a_id"/>
</group>
<group>
<field name="company_b_id" options="{'no_create': True}"/>
<field name="property_id" options="{'no_create': True}"/>
<field name="company_b_id"/>
</group>
</group>
<group>
<field name="users_id"/>
<field name="property_address"/>
<field name="reason"/>
<field name="three_point_offer"/>
<field name="image"/>
<field name="budget_list_id" widget="preview_many2one"/>
<field name="contract_id" widget="preview_many2one"/>
</group>
<group col="2">
<group>
<field name="contract_amount"/>
<field name="start_date"/>
<field name="review_price"/>
</group>
<group>
<field name="payment_methods"/>
<field name="end_date"/>
<field name="business_type"/>
</group>
<label for="start_date"/>
<div class="d-inline-flex w-100">
<field name="start_date" class="me-2" style="max-width: 7rem;"
string="合同期限"/>至
<field name="end_date" class="me-2" style="max-width: 7rem;"
force_save="1"/>
</div>
<field name="contract_amount"/>
<field name="business_type"/>
<field name="payment_methods"/>
<field name="work_end" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="project_content"/>
<field name="department_id" invisible="1"/>
</group>
<notebook>
<page string="物业信息">
<field name="lease_ids">
<tree editable="bottom" create="false">
<field name="design_id" column_invisible="1"/>
<field name="address_id"/>
<field name="admin_line_id"/>
<field name="property_area"/>
<field name="evaluate_unit_price"/>
</tree>
</field>
</page>
<page string="支付方式">
<field name="design_way_ids">
<tree editable="bottom">
<field name="design_id" column_invisible="1"/>
<field name="name"/>
<field name="pay_ratio"/>
<field name="payment_nodes"/>
<field name="coping_date"/>
<field name="amount"/>
<field name="paid_time"/>
<field name="remake"/>
</tree>
</field>
@@ -42,15 +42,28 @@
<group>
<field name="work_end" invisible="1"/>
<field name="name" required="1" string="项目名称:"/>
<field name="property_address"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="property_id" options="{'no_create': True}"/>
<field name="background_note"/>
<field name="amount"/>
<field name="documents_id" widget="preview_many2one"/>
<field name="start_date"/>
<field name="end_date"/>
</group>
<notebook>
<page string="物业信息">
<field name="lease_ids">
<tree editable="bottom" create="false">
<field name="project_id" column_invisible="1"/>
<field name="address_id"/>
<field name="admin_line_id"/>
<field name="property_area"/>
<field name="evaluate_unit_price"/>
</tree>
</field>
</page>
</notebook>
</sheet>
</form>
</field>
@@ -4,11 +4,8 @@
<field name="name">property.sporadic.works.tree</field>
<field name="model">property.sporadic.works</field>
<field name="arch" type="xml">
<tree string="委托招标代理">
<tree string="项目委托招标代理合同">
<field name="name"/>
<field name="signing_date"/>
<field name="acceptance_date"/>
<field name="total"/>
</tree>
</field>
</record>
@@ -16,7 +13,7 @@
<field name="name">property.sporadic.works.form</field>
<field name="model">property.sporadic.works</field>
<field name="arch" type="xml">
<form string="委托招标代理" create="0">
<form string="项目委托招标代理合同" create="0">
<sheet>
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
invisible="urgency_level != 'normal'"/>
@@ -44,27 +41,46 @@
<field name="name" required="1"/>
</h1>
</div>
<group col="2">
<group>
<field name="company_a_id"/>
</group>
<group>
<field name="company_b_id"/>
</group>
</group>
<group>
<field name="signing_date"/>
<field name="acceptance_date"/>
<field name="total"/>
<field name="work_end" invisible="1"/>
<field name="coping"/>
<field name="paid"/>
<field name="not_paid"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="text"/>
<field name="three_quotation_id" widget="preview_many2one"/>
<field name="service_contract" widget="preview_many2one"/>
<label for="service_start_date"/>
<div class="d-inline-flex w-100">
<field name="service_start_date" class="me-2" style="max-width: 7rem;"
string="服务期限"/>至
<field name="service_end_date" class="me-2" style="max-width: 7rem;"
force_save="1"/>
</div>
</group>
<group col="2">
<group>
<field name="standard_amount"/>
<field name="service_fee"/>
</group>
<group>
<field name="settlement_party"/>
<field name="payment_methods"/>
</group>
</group>
<notebook>
<page string="付款方式">
<field name="payment_methods_line_ids">
<tree editable="bottom">
<field name="name"/>
<field name="payment_nodes"/>
<field name="coping_date"/>
<field name="amount"/>
<field name="remake"/>
<field name="quotations_list_id" widget="preview_many2one"/>
<field name="accounting_list_id" widget="preview_many2one"/>
</tree>
</field>
</page>
@@ -42,43 +42,55 @@
<group>
<field name="name" required="1" string="合同编号:"/>
</group>
<group col="2">
<group col="2">
<group>
<field name="work_end" invisible="1"/>
<field name="company_id" required="1"/>
<field name="project_content"/>
<field name="users_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="company_a_id"/>
</group>
<group>
<field name="company_b_id"/>
<field name="property_id"/>
</group>
</group>
<group>
<field name="users_id"/>
<field name="property_address"/>
<field name="reason"/>
<field name="documents_ids" widget="preview_many2many"/>
<field name="image"/>
<field name="budget_list_id" widget="preview_many2one"/>
<field name="contract_id" widget="preview_many2one"/>
</group>
<group col="2">
<group>
<field name="contract_amount"/>
<field name="start_date"/>
<field name="review_price"/>
</group>
<group>
<field name="payment_methods"/>
<field name="end_date"/>
<field name="business_type"/>
</group>
<label for="start_date"/>
<div class="d-inline-flex w-100">
<field name="start_date" class="me-2" style="max-width: 7rem;"
string="代理期限"/>至
<field name="end_date" class="me-2" style="max-width: 7rem;"
force_save="1"/>
</div>
<field name="review_price"/>
<field name="floating"/>
<field name="contract_amount"/>
<field name="business_type"/>
<field name="payment_methods"/>
<field name="work_end" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="project_content"/>
<field name="department_id" invisible="1"/>
</group>
<notebook>
<page string="物业信息">
<field name="lease_ids">
<tree editable="bottom" create="false">
<field name="supervising_id" column_invisible="1"/>
<field name="address_id"/>
<field name="admin_line_id"/>
<field name="property_area"/>
<field name="evaluate_unit_price"/>
</tree>
</field>
</page>
<page string="支付方式">
<field name="supervising_way_ids">
<tree editable="bottom">
<field name="supervising_id" column_invisible="1"/>
<field name="name"/>
<field name="pay_ratio"/>
<field name="payment_nodes"/>
<field name="amount"/>
<field name="remake"/>
</tree>
@@ -0,0 +1,12 @@
from odoo import models, fields, api, _, SUPERUSER_ID
from odoo.exceptions import UserError, ValidationError
class BuildPopWizard(models.TransientModel):
_name = 'build.pop.wizard'
_description = '添加物业弹窗'
def confirm(self):
pass