From 84fd7cd5fc0285a887bb55b66eaa8ba08013e86b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= <9664676+pengyuthon@user.noreply.gitee.com> Date: Tue, 30 Dec 2025 11:01:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- soong_workflow/models/soong_workflow_mixin.py | 6 +++--- .../wizard/property_rental_wizard.py | 9 +++++---- yuthon_purchase/models/inherit_purchase_order.py | 6 ++++++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index a7ed5cdd9..5fd5a757a 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -827,9 +827,9 @@ class SoongWorkflowMixin(models.AbstractModel): id_el.set("name", "log_ids") id_el.set("invisible", "1") invisible += " or not log_ids or not is_back" - # if button.name == "结束": - # invisible += " or True" - invisible += " or work_end" + + if button.name != "打印": + invisible += " or work_end" if model == 'purchase.order': invisible = invisible.replace("询价", "draft") diff --git a/yuthon_property_approval/wizard/property_rental_wizard.py b/yuthon_property_approval/wizard/property_rental_wizard.py index fb9566b38..a1294a343 100644 --- a/yuthon_property_approval/wizard/property_rental_wizard.py +++ b/yuthon_property_approval/wizard/property_rental_wizard.py @@ -144,10 +144,11 @@ class PropertyRentalWizard(models.Model): ('due_date', '<=', last_day_of_month) ], limit=1) if record.contract_sort not in ['guanggao', 'guanzi', 'room']: - matched_breakdowns = record.management_breakdown_ids.filtered(lambda b: - b.start_data <= last_day_of_month and - b.end_data >= first_day_of_month - )[:1] + matched_breakdowns = record.management_breakdown_ids.filtered( + lambda b: + b.start_data <= last_day_of_month and + (not b.end_data or b.end_data >= first_day_of_month) + )[:1] original_amount = matched_breakdowns.management_monthly_amount else: original_amount = manage_amount diff --git a/yuthon_purchase/models/inherit_purchase_order.py b/yuthon_purchase/models/inherit_purchase_order.py index 9833fec01..1146f44ff 100644 --- a/yuthon_purchase/models/inherit_purchase_order.py +++ b/yuthon_purchase/models/inherit_purchase_order.py @@ -37,6 +37,12 @@ class InheritPurchaseOrder(models.Model): for order in order_ids: order.button_cancel() + @api.onchange('category_id') + def _onchange_category_id(self): + for record in self: + if record.pay_line_ids: + for line in record.pay_line_ids: + line.category_id = record.category_id.id def end_approval(self): self.button_confirm()