diff --git a/soong_workflow/views/soong_workflow_record.xml b/soong_workflow/views/soong_workflow_record.xml
index 33e9392c8..09787386b 100644
--- a/soong_workflow/views/soong_workflow_record.xml
+++ b/soong_workflow/views/soong_workflow_record.xml
@@ -154,7 +154,7 @@
ir.actions.act_window
soong.workflow.record
tree,kanban,search
- {'check_employee': 1}
+ {'check_employee': 1, 'to_do': 1, 'approve_state':1 }
[('users_ids', 'in', uid), ('reclaim_state', '=', False)]
diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py
index 3691dd72b..835648320 100644
--- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py
+++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py
@@ -43,6 +43,7 @@ class HrAttendanceDetail(models.Model):
department_id = fields.Many2one('hr.department', string="部门", related="employee_id.department_id", readonly=True, store=True)
source = fields.Selection([('iot', '考勤机'), ('mini_programs', '小程序')], string="来源")
attendance_iot_id = fields.Many2one('attendance.iot', string="设备号")
+ attendance_address = fields.Char(related="attendance_iot_id.attendance_address", string="设备地址")
userid = fields.Char(string='userid')
groupname = fields.Char(string='打卡规则名称')
checkin_type = fields.Char(string='打卡类型')
diff --git a/yuthon_property/models/property_bank_statements.py b/yuthon_property/models/property_bank_statements.py
index 8176f5261..5d5e212d3 100644
--- a/yuthon_property/models/property_bank_statements.py
+++ b/yuthon_property/models/property_bank_statements.py
@@ -33,7 +33,7 @@ class PropertyBankStatements(models.Model):
original_amount = fields.Float(string='交易金额')
yes_amount = fields.Float(string='已对')
no_amount = fields.Float(string='未对')
- is_reconciliation = fields.Boolean('是否已对账')
+ reconciliation_time = fields.Datetime('对账时间')
voucher_type = fields.Selection([('electronic_transfer', '电子转账凭证'), ('telegraphic_transfer', '电汇凭证')], string='凭证种类')
remake = fields.Text('备注')
registered = fields.Float('挂账')
@@ -52,7 +52,7 @@ class PropertyBankStatements(models.Model):
'receivable_id',
string='修改应收单'
)
-
+ is_reconciliation = fields.Boolean('是否对账') # 无效
company_select = fields.Selection([('jhtz', '天河投资'), ('thwg', '天河物管'), ('thcj', '天河城建')])
property_ids = fields.Many2many('yuthon.property', string='物业地址')
bank_state = fields.Selection([('not_reconciled', '未对账'), ('reconciled', '已对账'), ('registered', '挂账'), ('other', '其他')], string='状态', default='not_reconciled')
@@ -183,3 +183,27 @@ class PropertyBankStatements(models.Model):
return record
+
+ def disposable(self):
+ bank_ids = self.env["property.bank.statements"].browse(
+ self._context.get('active_ids', self._context.get('active_id')))
+ for rec in bank_ids:
+ penalty_type = self.env['yuthon.management.type'].search(
+ [('name', '=', '违约金')],
+ limit=1)
+ bank_lines = self.env['property.bank.line'].search([
+ ('bank', '=', rec.name),
+ ('tenant_id.name', '!=', False),
+ ])
+ if bank_lines:
+ tenant_id = bank_lines[0].tenant_id.id
+ start_date = (rec.start_time + timedelta(hours=8)).date()
+ accounts = self.env['property.accounts.receivable'].search([
+ ('payout_date', '=', start_date),
+ ('lessee_id', '=', tenant_id),
+ ('contract_id', 'in', rec.contract_ids.ids),
+ ('property_id', 'in', rec.property_ids.ids),
+ ('management_type_id', '!=', penalty_type.id),
+ ])
+ if accounts:
+ rec.reconciliation_time = accounts[0].reconciliation_time
diff --git a/yuthon_property/views/property_bank_statements_views.xml b/yuthon_property/views/property_bank_statements_views.xml
index 1bb673217..0df5ce690 100644
--- a/yuthon_property/views/property_bank_statements_views.xml
+++ b/yuthon_property/views/property_bank_statements_views.xml
@@ -27,7 +27,6 @@
-
@@ -65,7 +64,6 @@
-
diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py
index 3ff8a08b4..10214bb32 100644
--- a/yuthon_property_approval/models/inherit_yuthon_property.py
+++ b/yuthon_property_approval/models/inherit_yuthon_property.py
@@ -45,6 +45,12 @@ class PropertyBankStatements(models.Model):
contract_ids = fields.Many2many('property.lease.contract', string="租赁合同审批")
accounts_id = fields.Many2one('property.accounts.approval', string="关联生成应收审批单")
+ def batch_revocation(self):
+ bank_ids = self.env["property.bank.statements"].browse(
+ self._context.get('active_ids', self._context.get('active_id')))
+ for rec in bank_ids:
+ rec.revocation()
+
def revocation(self):
for rec in self:
penalty_type = self.env['yuthon.management.type'].search(
@@ -55,69 +61,83 @@ class PropertyBankStatements(models.Model):
('bank', '=', rec.name),
('tenant_id.name', '!=', False),
])
- if bank_lines:
- tenant_id = bank_lines[0].tenant_id.id
- rec.bank_state = 'not_reconciled'
- rec.registered = 0
- rec.no_amount = rec.original_amount
- rec.yes_amount = 0
- penalty_records = self.env['property.accounts.receivable'].search([('bank_id', '=', self.id)])
- if not penalty_records:
- start_date_obj = fields.Date.from_string(start_date)
- year = start_date_obj.year
- month = start_date_obj.month
- month_start = datetime(year, month, 1).date()
- if month == 12:
- month_end = datetime(year, 12, 31).date()
- else:
- month_end = (datetime(year, month + 1, 1).date() - relativedelta(days=1))
- month_start_str = fields.Date.to_string(month_start)
- month_end_str = fields.Date.to_string(month_end)
- penalty_records = self.env['property.accounts.receivable'].search([
- ('due_date', '>=', month_start_str),
- ('due_date', '<=', month_end_str),
- ('lessee_id', '=', tenant_id),
- ('contract_id', 'in', rec.contract_ids.ids),
- ('property_id', 'in', rec.property_ids.ids),
- ('management_type_id', '=', penalty_type.id)
- ])
- to_restore = penalty_records.filtered(lambda r: r.is_write)
- if to_restore:
- to_restore.write({'is_write': False,
- 'due_date_end': None,
- 'delivered1': None,
- 'is_reconciliation': False,
- 'payout_date': None,
- })
- return
+ if not bank_lines:
+ information = self.env['property.tenant.information'].search(
+ [('name', '=', rec.name_account)],
+ limit=1)
+ if information:
+ if information.bank_ids:
+ information.bank_ids.unlink()
+ information.bank_ids.create({
+ 'tenant_id': information.id,
+ 'bank': rec.name,
+ 'user': information.name,
+ 'name': information.name
+ })
- target_year = start_date.year
- target_month = start_date.month
- to_delete = penalty_records.filtered(
- lambda r: not r.is_write
- and fields.Date.from_string(r.due_date).year == target_year
- and fields.Date.from_string(r.due_date).month == target_month
- )
- if to_delete:
- to_delete.unlink()
+ tenant_id = bank_lines[0].tenant_id.id
+ rec.bank_state = 'not_reconciled'
+ rec.registered = 0
+ rec.no_amount = rec.original_amount
+ rec.yes_amount = 0
+ rec.reconciliation_time = None
- accounts = self.env['property.accounts.receivable'].search([
- ('payout_date', '=', start_date),
+ penalty_records = self.env['property.accounts.receivable'].search([('bank_id', '=', self.id)])
+ if not penalty_records:
+ start_date_obj = fields.Date.from_string(start_date)
+ year = start_date_obj.year
+ month = start_date_obj.month
+ month_start = datetime(year, month, 1).date()
+ if month == 12:
+ month_end = datetime(year, 12, 31).date()
+ else:
+ month_end = (datetime(year, month + 1, 1).date() - relativedelta(days=1))
+ month_start_str = fields.Date.to_string(month_start)
+ month_end_str = fields.Date.to_string(month_end)
+ penalty_records = self.env['property.accounts.receivable'].search([
+ ('due_date', '>=', month_start_str),
+ ('due_date', '<=', month_end_str),
('lessee_id', '=', tenant_id),
('contract_id', 'in', rec.contract_ids.ids),
('property_id', 'in', rec.property_ids.ids),
- ('management_type_id', '!=', penalty_type.id),
+ ('management_type_id', '=', penalty_type.id)
])
- if accounts:
- for account in accounts:
- account.write({'is_reconciliation': False,
- 'payout_date': False,
- 'delivered1': 0,
- 'reconciliation_time': False,
- 'remark': None,
- })
- else:
- raise UserError(f'未找到银行账号为{rec.name}的承租方,请根据承租方姓名在承租方管理里面配置')
+ to_restore = penalty_records.filtered(lambda r: r.is_write)
+ if to_restore:
+ to_restore.write({'is_write': False,
+ 'due_date_end': None,
+ 'delivered1': None,
+ 'is_reconciliation': False,
+ 'payout_date': None,
+ })
+ return
+
+ target_year = start_date.year
+ target_month = start_date.month
+ to_delete = penalty_records.filtered(
+ lambda r: not r.is_write
+ and fields.Date.from_string(r.due_date).year == target_year
+ and fields.Date.from_string(r.due_date).month == target_month
+ )
+ if to_delete:
+ to_delete.unlink()
+
+ accounts = self.env['property.accounts.receivable'].search([
+ ('payout_date', '=', start_date),
+ ('lessee_id', '=', tenant_id),
+ ('contract_id', 'in', rec.contract_ids.ids),
+ ('property_id', 'in', rec.property_ids.ids),
+ ('original_amount', '=', rec.original_amount),
+ ('management_type_id', '!=', penalty_type.id),
+ ])
+ if accounts:
+ for account in accounts:
+ account.write({'is_reconciliation': False,
+ 'payout_date': False,
+ 'delivered1': 0,
+ 'reconciliation_time': False,
+ 'remark': None,
+ })
def binding_information(self):
return {
@@ -153,18 +173,6 @@ class PropertyBankStatements(models.Model):
statement.contract_ids = [(5,)]
statement.property_ids = [(5,)]
- def button_bank_state(self):
- receivable_ids = self.env["property.bank.statements"].browse(
- self._context.get('active_ids', self._context.get('active_id')))
- for record in receivable_ids:
- record.bank_state = 'reconciled'
-
- def button_state(self):
- receivable_ids = self.env["property.bank.statements"].browse(
- self._context.get('active_ids', self._context.get('active_id')))
- for record in receivable_ids:
- record.bank_state = 'not_reconciled'
-
def contract_penalty(self):
statements_ids = self.env['property.bank.statements'].search([('is_put', '=', True)])
for record in statements_ids:
diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml
index c9a3d5624..2a2207b81 100644
--- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml
+++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml
@@ -515,7 +515,7 @@
-
+
@@ -525,25 +525,18 @@
property.bank.statements
-
+
-
- 初始化状态
+
+ 批量撤销
code
- action = model.button_bank_state()
-
-
- 恢复
-
-
- code
- action = model.button_state()
+ action = model.batch_revocation()
diff --git a/yuthon_property_approval/wizard/click_reconciliation_wizard.py b/yuthon_property_approval/wizard/click_reconciliation_wizard.py
index e6d9263d8..3dd12cab3 100644
--- a/yuthon_property_approval/wizard/click_reconciliation_wizard.py
+++ b/yuthon_property_approval/wizard/click_reconciliation_wizard.py
@@ -14,17 +14,34 @@ class ClickReconciliationWizard(models.Model):
])
# 直接查询符合条件的对账单
for receivable in receivable_ids:
+ due_date = receivable.due_date
+ month_start = datetime.combine(due_date.replace(day=1), datetime.min.time())
+ if due_date.month == 12:
+ month_end = datetime.combine(
+ datetime(due_date.year + 1, 1, 1),
+ datetime.min.time()
+ )
+ else:
+ month_end = datetime.combine(
+ datetime(due_date.year, due_date.month + 1, 1),
+ datetime.min.time()
+ )
+
statements_ids = self.env["property.bank.statements"].search([
('bank_state', 'in', ['not_reconciled', 'registered']),
('name_account', '=', receivable.lessee_id.name),
+ ('start_time', '>=', month_start),
+ ('start_time', '<', month_end),
('is_company', '=', True),
('contract_ids', 'in', receivable.contract_id.id),
('original_amount', '=', receivable.original_amount)
], order='start_time asc')
+
if statements_ids:
record = statements_ids[0]
record.yes_amount = receivable.original_amount
record.bank_state = 'reconciled'
+ record.reconciliation_time = fields.Datetime.now() - timedelta(hours=8)
record.no_amount = 0
receivable.write({
'is_reconciliation': True,
diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py
index b23d7780b..bf48db2a1 100644
--- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py
+++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py
@@ -274,7 +274,7 @@ class PropertyReconciliationWizard(models.Model):
else:
rec.bank_id.registered = 0
rec.bank_id.bank_state = 'reconciled'
-
+ rec.reconciliation_time = fields.Datetime.now() - timedelta(hours=8),
first_line = bank_lines[0]
for line in rec.reconciliation_line_ids:
# 跳过金额为0的行
diff --git a/yuthon_purchase/__manifest__.py b/yuthon_purchase/__manifest__.py
index 23056c460..42af6981d 100644
--- a/yuthon_purchase/__manifest__.py
+++ b/yuthon_purchase/__manifest__.py
@@ -9,6 +9,7 @@
'depends': ['base', 'soong_workflow', 'hr', 'product', 'documents', 'purchase'],
'data': [
'security/ir.model.access.csv',
+ 'security/company_rule.xml',
'views/inherit_product_product_views.xml',
'views/inherit_purchase_order_views.xml',
'views/purchase_workflow_views.xml',
diff --git a/yuthon_purchase/security/company_rule.xml b/yuthon_purchase/security/company_rule.xml
new file mode 100644
index 000000000..e1e03572e
--- /dev/null
+++ b/yuthon_purchase/security/company_rule.xml
@@ -0,0 +1,8 @@
+
+
+
+ 采购多公司
+
+ [('company_id', 'in', company_ids)]
+
+
\ No newline at end of file
diff --git a/yuthon_stock/security/company_rule.xml b/yuthon_stock/security/company_rule.xml
new file mode 100644
index 000000000..c235a1662
--- /dev/null
+++ b/yuthon_stock/security/company_rule.xml
@@ -0,0 +1,8 @@
+
+
+
+ 采购多公司
+
+ [('company_id', 'in', company_ids)]
+
+
\ No newline at end of file
diff --git a/yuthon_stock/views/inherit_stock_picking.xml b/yuthon_stock/views/inherit_stock_picking.xml
index 24fda9c00..127bda1da 100644
--- a/yuthon_stock/views/inherit_stock_picking.xml
+++ b/yuthon_stock/views/inherit_stock_picking.xml
@@ -15,6 +15,12 @@
1
+
+ 1
+
+
+ 1
+
采购人员