Skip to content

Comments

[IMP] account_cashbox: improve internal transfer payments #850

Closed
cav-adhoc wants to merge 4 commits intoingadhoc:19.0from
adhoc-dev:19.0-t-58355-cav
Closed

[IMP] account_cashbox: improve internal transfer payments #850
cav-adhoc wants to merge 4 commits intoingadhoc:19.0from
adhoc-dev:19.0-t-58355-cav

Conversation

@cav-adhoc
Copy link
Contributor

  1. In account.payment, when creating the paired internal transfer payment, set the cashbox_session_id to the destination_cashbox_session_id of the original payment.

Copilot AI review requested due to automatic review settings December 18, 2025 16:06
@roboadhoc
Copy link
Contributor

Pull request status dashboard

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the internal transfer payment functionality in the account_cashbox module by implementing bidirectional cashbox session tracking. When creating paired internal transfer payments, the destination cashbox session from the original payment is now properly assigned to the paired payment's cashbox session, with the paired payment's destination session cleared to prevent circular references.

Key Changes:

  • Added destination_cashbox_session_id field to track the destination cashbox session for internal transfers
  • Modified paired payment creation to transfer the destination session to the paired payment's cashbox session
  • Updated the UI to display the destination cashbox session field with appropriate visibility and validation rules

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
account_cashbox/views/account_payment.xml Adds UI field for destination_cashbox_session_id with domain constraints and conditional visibility
account_cashbox/models/account_payment.py Implements destination_cashbox_session_id field and updates paired payment creation logic to properly handle session assignments

<field
name="destination_cashbox_session_id"
domain="[('state', '=', 'opened'), ('company_id', '=', company_id), '|', ('user_ids', '=', uid), ('user_ids', '=', False)]"
required="requiere_account_cashbox_session and state == 'draft' and payment_type == 'transfer'"
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'requiere' to 'require'.

Copilot uses AI. Check for mistakes.
@cav-adhoc cav-adhoc force-pushed the 19.0-t-58355-cav branch 2 times, most recently from baf7cf4 to 1622ca5 Compare December 19, 2025 13:31
…x sessions

1. In `account.payment`, when creating the paired internal transfer payment, set the
    `cashbox_session_id` to the `destination_cashbox_session_id` of the original payment.
Before this commit, when creating or editing an account cashbox session,
the user selection field allowed selecting any user in the system. This could
lead to unauthorized users being assigned to cashbox sessions,
affecting the restrictions in _session_id fields of payments.
When selecting the destination cashbox session for an internal transfer payment,
the domain should filter cashbox sessions that are linked to the selected
destination journal. This ensures that users can only select valid cashbox sessions
that correspond to the destination journal of the transfer.
@rov-adhoc
Copy link
Contributor

@roboadhoc bump

@rov-adhoc
Copy link
Contributor

@roboadhoc r+ rebase-ff

@roboadhoc
Copy link
Contributor

Merge method set to rebase and fast-forward.

roboadhoc pushed a commit that referenced this pull request Feb 23, 2026
…x sessions

1. In `account.payment`, when creating the paired internal transfer payment, set the
    `cashbox_session_id` to the `destination_cashbox_session_id` of the original payment.

Part-of: #850
Related: ingadhoc/account-financial-tools#852
Signed-off-by: rov-adhoc <rov@adhoc.com.ar>
roboadhoc pushed a commit that referenced this pull request Feb 23, 2026
roboadhoc pushed a commit that referenced this pull request Feb 23, 2026
Before this commit, when creating or editing an account cashbox session,
the user selection field allowed selecting any user in the system. This could
lead to unauthorized users being assigned to cashbox sessions,
affecting the restrictions in _session_id fields of payments.

Part-of: #850
Related: ingadhoc/account-financial-tools#852
Signed-off-by: rov-adhoc <rov@adhoc.com.ar>
roboadhoc pushed a commit to ingadhoc/account-financial-tools that referenced this pull request Feb 23, 2026
In a transfer between a journal in main currency and one in secondary currency,
the amount field in the journal entry for the main currency journal must be adjusted
so it is recorded in the main currency, not in the secondary currency. This commit fixes that behavior.

Part-of: #852
Related: ingadhoc/account-payment#850
Signed-off-by: rov-adhoc <rov@adhoc.com.ar>
roboadhoc pushed a commit to ingadhoc/account-financial-tools that referenced this pull request Feb 23, 2026
…warnings

Improve the user experience when managing internal transfer payments:

* Auto-synchronize paired payments: When updating amount or journals
  on one payment, automatically propagate changes to its paired payment
  to maintain consistency between both sides of the transfer

* State mismatch warning: Display an alert when paired payments are in
  different states, showing both current states and prompting users to
  synchronize them before completing changes

* Quick navigation: Add a "Go to Paired Payment" button directly in the
  warning message for easy access to the related payment

Technical improvements:
- Override write() method with recursion prevention via context flag
- Add computed HTML field for dynamic warning display
- Add action method for navigation between paired payments
- Update form view to display warnings before sheet content

Part-of: #852
Related: ingadhoc/account-payment#850
Signed-off-by: rov-adhoc <rov@adhoc.com.ar>
roboadhoc pushed a commit to ingadhoc/account-financial-tools that referenced this pull request Feb 23, 2026
closes #852

Related: ingadhoc/account-payment#850
Signed-off-by: rov-adhoc <rov@adhoc.com.ar>
@roboadhoc roboadhoc closed this in 2193b61 Feb 23, 2026
roboadhoc added a commit that referenced this pull request Feb 23, 2026
@roboadhoc roboadhoc added the 18.1 label Feb 23, 2026
@roboadhoc roboadhoc deleted the 19.0-t-58355-cav branch February 23, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants