django_webapps_fullstack.dashboard.forms¶
This module provides the core business functionality forms for managing personal belongings through the dingx logistics platform. It enables users to track, organize, and manage physical objects across different locations (storage, home, disposal, transfer) with visual product management and comprehensive user profile administration.
Business Context:
The dashboard app is the central hub of the dingx platform where users interact with their registered objects (products). The system tracks physical belongings across four main locations:
Storage: Items kept in long-term storage facilities
Home: Items currently at the user’s residence
Disposal: Items marked for disposal or donation
Transfer: Items currently in transit between locations
Users can visualize their inventory with product images from multiple perspectives (front, right, back, left), organize items through drag-and-drop functionality, and manage order baskets for logistics operations.
Key Business Processes:
Product Overview & Management:
OverviewForm: Visual dashboard showing all user products with filtering by locationProduct cards with images, descriptions, and location badges
Color-coded system for quick location identification
Drag-and-drop interface for organizing products into baskets
Real-time product count by location
Caching mechanism for performance optimization
Product Editing:
Edit_ObjectForm: Update product names and descriptionsView multi-perspective product images
Manage product attributes (volume, weight, location)
Cache invalidation after updates to ensure data consistency
Basket Management:
BasketForm: Create transfer orders by selecting productsOrganize logistics operations through basket system
Support for bulk product selection and movement
User Profile Management:
Account_ProfileForm: Complete profile editing (name, contact, language preferences)Multi-language support with dynamic title selection
Real-time validation against Odoo database
Phone number formatting with international support
Address Management:
Delivery_AddressForm: Manage delivery address detailsInvoice_AddressForm: Manage billing address informationCountry and state selection with localization
Support for Swiss cantons with multi-language names
Integration with Odoo partner address system
Technical Features:
Dynamic form field generation based on user language
Integration with Bootstrap design system for color coding
Odoo XMLRPC backend synchronization
Django caching framework for performance
Multi-language support via Django i18n
Image handling with base64 encoding
Integration:
All forms communicate with the Odoo ERP backend via Twisted XMLRPC server, ensuring synchronized data across inventory management, order processing, and user administration systems.
Classes
|
Create a form for the "account_profile" template and create the corresponding functions of the form. |
|
Create the "dashboard_basket" form. |
|
Create the delivery form for the "account_address" template and create the corresponding functions of the form. |
|
Create the "edit_object" form. |
|
Create the invoice form for the "account_address" template and create the corresponding functions of the form. |
|
Create the "overview" form. |
- class django_webapps_fullstack.dashboard.forms.Account_ProfileForm(*args, **kwargs)[source]¶
Bases:
FormCreate a form for the “account_profile” template and create the corresponding functions of the form.
- base_fields = {}¶
- declared_fields = {}¶
- property media¶
Return all media required to render the widgets on this form.
- class django_webapps_fullstack.dashboard.forms.BasketForm(*args, **kwargs)[source]¶
Bases:
FormCreate the “dashboard_basket” form. The ordered objects of the customer will be shown.
- base_fields = {}¶
- declared_fields = {}¶
- get_ordered_products(basketPlace, BasketElements)[source]¶
Get the details from the ordered products including pictures and colors.
- property media¶
Return all media required to render the widgets on this form.
- class django_webapps_fullstack.dashboard.forms.Delivery_AddressForm(*args, **kwargs)[source]¶
Bases:
FormCreate the delivery form for the “account_address” template and create the corresponding functions of the form.
- base_fields = {}¶
- declared_fields = {}¶
- property media¶
Return all media required to render the widgets on this form.
- class django_webapps_fullstack.dashboard.forms.Edit_ObjectForm(*args, product=None, **kwargs)[source]¶
Bases:
FormCreate the “edit_object” form. The selected object will be shown including the pictures. Some fields of the object could be edited.
- base_fields = {}¶
- declared_fields = {}¶
- get_product(product_id)[source]¶
Get the details for the selected product and add badgecolor to the product.
- get_product_pictures(product_id)[source]¶
Get the pictures from all perspectives for the selected product.
- property media¶
Return all media required to render the widgets on this form.
- class django_webapps_fullstack.dashboard.forms.Invoice_AddressForm(*args, **kwargs)[source]¶
Bases:
FormCreate the invoice form for the “account_address” template and create the corresponding functions of the form.
- base_fields = {}¶
- declared_fields = {}¶
- property media¶
Return all media required to render the widgets on this form.
- class django_webapps_fullstack.dashboard.forms.OverviewForm(*args, **kwargs)[source]¶
Bases:
FormCreate the “overview” form. All products of the user will be shown.
- base_fields = {}¶
- count_product_place(partner_id, card_place)[source]¶
Get the number of article belonging to the specific place.
- declared_fields = {}¶
- get_card_classes(card_place, place)[source]¶
Set the ‘CSS’ classes of the card places (= card_place) for a dedicated place. This is done by building dictionaries for each card place.
Explanation of the different classes:
- “basket_enabled”: enables the ‘basket’ function for that card place,
objects can be dragged on that place
- “select_enabled”: enables the ‘select’ function for that card place,
dashboard view with only objects of that the place can be selected
- “lift”: lift up a card place,
place is enabled for dragging objects
- “link_enabled”: dashboard link of that place is enabled,
dashboard view with only objects of that the place is enabled
- get_header_background_color(place)[source]¶
Get the background color of the header corresponding to the selected place. The colors come form the section “bootstrap_colors” of the parameter file “parameter_design.ini”.
- get_product_list(partner_id, place)[source]¶
Get all products from the dedicated partner including pictures. In addition the individual CSS classes will be added to products based on the place of the product.
- property media¶
Return all media required to render the widgets on this form.