django_webapps_fullstack.dashboard.views¶
This module implements the core business functionality of the dingx logistics platform, providing users with a comprehensive dashboard to manage their physical belongings across different locations. It handles product visualization, basket operations for logistics orders, and complete user profile and address management, all synchronized with the Odoo ERP backend.
Business Context:
The dashboard app is the central workspace where users interact with their registered objects (products). The platform tracks physical belongings across four primary locations:
Storage: Items in long-term storage facilities
Home: Items currently at user’s residence
Disposal: Items marked for disposal or donation
Transfer: Items currently in transit between locations
Users can view their inventory with multi-perspective product images, create transfer orders through drag-and-drop basket functionality, edit product details, and manage their account profile and delivery/ invoice addresses. The system provides two dashboard layouts (pictures and rows) for different user preferences.
Key Business Workflows:
Product Overview & Filtering:
overview(): Main dashboard displays all user products with location-based filteringVisual product cards with images, names, descriptions, and location badges
Color-coded system for instant location identification
Product count per location displayed in real-time
Caching for optimal performance
pictures(): Switch to picture grid layoutrows(): Switch to row list layout
Basket Operations (Logistics Orders):
Users drag products to destination location cards
basket_elements(): AJAX handler for adding products to basketbasket(): Basket collects selected products for transfer and displays products organized by destination locationremove_basket_element(): AJAX handler for removing items from basket before finalizingAJAX-based interactions for smooth UX
Product Editing:
edit_object_element(): AJAX handler for edit object selectionedit_object(): Edit product name and descriptionView multi-perspective images (front, right, back, left)
See product attributes (volume, weight, current location)
Undo changes before saving
Cache invalidation after updates ensures data consistency
User Profile Management:
account_profile(): Edit name, email, login, title, languageInternational phone number support
Multi-language interface with dynamic form field labels
Real-time validation against Odoo database
Language preference affects entire platform
Address Management:
account_address(): Manage separate delivery and invoice addressesCountry and state/canton selection with localization
Swiss cantons supported with multi-language names
Integration with Odoo partner address system
account_billing(): Billing information (placeholder)
Technical Features:
Caching Strategy: Django cache framework for product lists per partner and location
AJAX Operations: JSON responses for basket and product selection
Multi-language Support: Dynamic language activation via Django i18n
Color Coding: Bootstrap-based color scheme from parameter_design.ini
Image Handling: Base64-encoded images from Odoo with fallback to dummy images
Session Management: User context (partner_id, language, layout, place) stored in session
Error Handling: Try-catch blocks with detailed logging for debugging
Cache Invalidation: Smart cache clearing after product updates
Integration:
All views communicate with the Odoo ERP backend via XMLRPC through dashboard forms, ensuring synchronized inventory management, order processing, and user profile data across the entire dingx ecosystem.
Security:
Session-based authentication required for all views
Partner-specific data isolation
Redirect to login if session invalid
Cache cleared per partner_id for data privacy
Functions
|
Prepare the account address page to show and update the account address values of a user. |
|
Prepare the account billing page to show and update the account billing values of a user. |
|
Prepare the account profile page to show and update the account profile values of a user. |
|
Prepare the basket page with all the objects to be ordered. |
|
Get the place and the elements from the HTML page for preparing the basket. |
|
Prepare the page for editing an object. |
|
Get the element from the HTML page for preparing to edit the element. |
|
Prepare the overview page which shows the products of a user. |
|
Call the dashboard page with pictures layout. |
|
Remove an element from the basket elements list. |
|
Call the dashboard page with rows layout. |
- django_webapps_fullstack.dashboard.views.account_address(request)[source]¶
Prepare the account address page to show and update the account address values of a user.
- django_webapps_fullstack.dashboard.views.account_billing(request)[source]¶
Prepare the account billing page to show and update the account billing values of a user.
- django_webapps_fullstack.dashboard.views.account_profile(request)[source]¶
Prepare the account profile page to show and update the account profile values of a user.
- django_webapps_fullstack.dashboard.views.basket(request)[source]¶
Prepare the basket page with all the objects to be ordered.
- django_webapps_fullstack.dashboard.views.basket_elements(request, place)[source]¶
Get the place and the elements from the HTML page for preparing the basket. Call the ‘basket’ page to show the ordered elements.
- django_webapps_fullstack.dashboard.views.edit_object(request)[source]¶
Prepare the page for editing an object.
- django_webapps_fullstack.dashboard.views.edit_object_element(request, place)[source]¶
Get the element from the HTML page for preparing to edit the element. Return the URL of the ‘edit element’ page.
- django_webapps_fullstack.dashboard.views.overview(request, place)[source]¶
Prepare the overview page which shows the products of a user. If a user is logged in, than the overview page will be called. Otherwise the landung page will be called.
- django_webapps_fullstack.dashboard.views.pictures(request, place)[source]¶
Call the dashboard page with pictures layout.