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:

  1. Product Overview & Filtering:

  • overview(): Main dashboard displays all user products with location-based filtering
    • Visual 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 layout

  • rows(): Switch to row list layout

  1. Basket Operations (Logistics Orders):

  • Users drag products to destination location cards

  • basket_elements(): AJAX handler for adding products to basket

  • basket(): Basket collects selected products for transfer and displays products organized by destination location

  • remove_basket_element(): AJAX handler for removing items from basket before finalizing

  • AJAX-based interactions for smooth UX

  1. Product Editing:

  • edit_object_element(): AJAX handler for edit object selection

  • edit_object(): Edit product name and description
    • View 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

  1. User Profile Management:

  • account_profile(): Edit name, email, login, title, language
    • International phone number support

    • Multi-language interface with dynamic form field labels

    • Real-time validation against Odoo database

    • Language preference affects entire platform

  1. Address Management:

  • account_address(): Manage separate delivery and invoice addresses
    • Country 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

account_address(request)

Prepare the account address page to show and update the account address values of a user.

account_billing(request)

Prepare the account billing page to show and update the account billing values of a user.

account_profile(request)

Prepare the account profile page to show and update the account profile values of a user.

basket(request)

Prepare the basket page with all the objects to be ordered.

basket_elements(request, place)

Get the place and the elements from the HTML page for preparing the basket.

edit_object(request)

Prepare the page for editing an object.

edit_object_element(request, place)

Get the element from the HTML page for preparing to edit the element.

overview(request, place)

Prepare the overview page which shows the products of a user.

pictures(request, place)

Call the dashboard page with pictures layout.

remove_basket_element(request)

Remove an element from the basket elements list.

rows(request, place)

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.

django_webapps_fullstack.dashboard.views.remove_basket_element(request)[source]

Remove an element from the basket elements list. Call the ‘basket’ page with the updated list.

django_webapps_fullstack.dashboard.views.rows(request, place)[source]

Call the dashboard page with rows layout.