Add support for cash counter#127
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements a comprehensive cash session management system to replace the previous cash denomination tracking approach. The system tracks cash sessions for cashiers at billing counters, manages transfers between sessions, and integrates with accounting through journal entries.
Key Changes:
- Replaces denomination-based tracking with session-based cash management
- Implements cash transfer workflow between counters and main cash
- Adds API endpoints for external Care system integration
- Configures company-level cash journal settings
Reviewed changes
Copilot reviewed 50 out of 50 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| cash_denomination/models/cash_session.py | New model for tracking cash sessions with lifecycle management (open/close) |
| cash_denomination/models/cash_transfer.py | New model for cash transfers between sessions with acceptance/rejection workflow |
| cash_denomination/models/res_company.py | Adds company configuration for counter and main cash journals |
| cash_denomination/views/cash_session_views.xml | UI views for managing cash sessions |
| cash_denomination/views/cash_transfer_views.xml | UI views for managing cash transfers |
| cash_denomination/views/res_company_views.xml | Company settings page for cash journal configuration and menu structure |
| care_connector/models/account_journal.py | Adds Care Connector code field to journals for API mapping |
| care_connector/models/account_payment.py | Links payments to cash sessions |
| care_connector/models/bill_counter.py | Adds is_main_cash flag to identify main cash location |
| care_connector/resources/cash_session.py | Business logic for session and transfer operations |
| care_connector/resources/account_move_payment.py | Updates payment creation to link with cash sessions |
| care_connector/controllers/cash_session.py | REST API endpoints for session management |
| care_connector/pydantic_models/cash_session.py | Pydantic models for API request/response validation |
| cash_denomination/manifest.py | Updates module metadata and dependencies |
| cash_denomination/security/ir.model.access.csv | Security access rules for new models |
| Removed files | Removes old denomination, wizard, template, controller, and static files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| class AccountJournal(models.Model): | ||
| _inherit = 'account.journal' | ||
|
|
||
| x_care_journal_code = fields.Selection( | ||
| selection=[ | ||
| ('cash', 'Cash'), | ||
| ('bank', 'Bank'), | ||
| ('card', 'Card'), | ||
| ], |
There was a problem hiding this comment.
The x_care_journal_code selection values are hardcoded here but should match the payment method types expected by the Care system. Consider moving these to a constant or configuration to ensure consistency with care_connector/resources/account_move_payment.py where journal lookup occurs.
| class AccountJournal(models.Model): | |
| _inherit = 'account.journal' | |
| x_care_journal_code = fields.Selection( | |
| selection=[ | |
| ('cash', 'Cash'), | |
| ('bank', 'Bank'), | |
| ('card', 'Card'), | |
| ], | |
| CARE_CONNECTOR_JOURNAL_SELECTION = [ | |
| ('cash', 'Cash'), | |
| ('bank', 'Bank'), | |
| ('card', 'Card'), | |
| ] | |
| class AccountJournal(models.Model): | |
| _inherit = 'account.journal' | |
| x_care_journal_code = fields.Selection( | |
| selection=CARE_CONNECTOR_JOURNAL_SELECTION, |
| <menuitem id="menu_bill_counter" | ||
| name="Bill Counters" | ||
| parent="menu_cash_management_root" | ||
| action="care_connector.action_bill_counter" |
There was a problem hiding this comment.
The menu item references 'care_connector.action_bill_counter' using a cross-module reference without verifying that the action exists. While this appears to be intentional for module integration, consider adding a comment explaining this dependency or ensuring the action is defined in care_connector module.
No description provided.