From 5e8ac0136221dfc2675ff47da7861b27b9f75763 Mon Sep 17 00:00:00 2001 From: Alaguraj0361 Date: Tue, 31 Mar 2026 11:09:34 +0530 Subject: [PATCH] chore: Week 4 UAT documents, demo data scripts, and backup drill procedures --- docs/testing/UAT_SCRIPTS.md | 45 ++++++++++++++++++++++++++++ docs/training/ROLES.md | 28 ++++++++++++++++++ scripts/backup_drill.sh | 44 +++++++++++++++++++++++++++ scripts/create_demo_data.py | 59 +++++++++++++++++++++++++++++++++++++ 4 files changed, 176 insertions(+) create mode 100644 docs/testing/UAT_SCRIPTS.md create mode 100644 docs/training/ROLES.md create mode 100644 scripts/backup_drill.sh create mode 100644 scripts/create_demo_data.py diff --git a/docs/testing/UAT_SCRIPTS.md b/docs/testing/UAT_SCRIPTS.md new file mode 100644 index 0000000..5f5f9d0 --- /dev/null +++ b/docs/testing/UAT_SCRIPTS.md @@ -0,0 +1,45 @@ +# C2C User Acceptance Testing (UAT) Scripts + +Welcome to the C2C Odoo ERP User Acceptance Testing manual. +Please follow each script chronologically. Testers should mark Pass/Fail for each action. + +## UAT Script 1: Basic Procurement & Quality Control +**Goal**: Verify receipt of raw materials properly enforces lot creation and expiry dates. + +| Step | Action | Expected Result | Pass/Fail | +|---|---|---|---| +| 1.1 | Login as **Purchase Officer** to `C2C Agricorp`. Create PO for `100kg Raw Jasmine`. | PO is saved successfully in Draft. | [ ] | +| 1.2 | Confirm PO. Open standard Receipt from the PO. | Receipt automatically targets `WH/Stock`. | [ ] | +| 1.3 | Click "Detailed Operations" icon on the Jasmine line. Enter `LOT-TEST-001` and an Expiry Date. | Odoo demands matching quantities. Date is saved. | [ ] | +| 1.4 | Validate Receipt. | Stock 100kg moved to `WH/Stock`, Accounting Journal Entry drafted. | [ ] | +| 1.5 | Create an Internal Transfer to `QC Hold`. Validate. | Goods arrive in QC Hold waiting for inspection. | [ ] | + +## UAT Script 2: Multi-Output Manufacturing & Yield Report +**Goal**: Ensure BOMs can create 2 distinct products at the end of production, while calculating accurate Yield metrics. + +| Step | Action | Expected Result | Pass/Fail | +|---|---|---|---| +| 2.1 | Login as **Manufacturing Manager**. Go to MRP > Products > BOM. | The `Output Products` custom tab is visible. | [ ] | +| 2.2 | Create BOM for `500g Rose Pack`. Add Primary (200 units). Add Components (`100kg Raw Roses`). Add Output Product (`Rose Stems` x 10). | BOM saves successfully. | [ ] | +| 2.3 | Create a Manufacturing Order from this BOM. Confirm. | The `Additional Outputs` tab automatically populated with `Rose Stems` x 10. | [ ] | +| 2.4 | Click "Produce All" / Mark As Done. Apply a lot number. | MO validates. **2 separate Stock Moves** were created to Finished Goods. | [ ] | +| 2.5 | Go to MRP > Reporting > Yield & Wastage. | A new row exists for this MO showing the exact Yield %. | [ ] | + +## UAT Script 3: Intercompany PO/SO Sync & Auto-Invoicing +**Goal**: Verify that Clickstocart Inc buying from C2C Imports triggers automated intercompany execution. + +| Step | Action | Expected Result | Pass/Fail | +|---|---|---|---| +| 3.1 | Switch to `Clickstocart Inc US`. Create a PO vendor = `C2C Imports`. | PO is in Draft state. | [ ] | +| 3.2 | Click Confirm Order. | PO goes to Locked/Confirmed. | [ ] | +| 3.3 | Switch to `C2C Imports & Exports`. Open Sales. | A new SO exists instantly matching the PO details. | [ ] | +| 3.4 | Confirm SO. Deliver all goods via the Delivery smart button. Validate. | Delivery completes successfully. | [ ] | +| 3.5 | Switch back to `Clickstocart Inc US`. Check the PO. | The Receipt is magically marked as Done. Vendor Bill drafted. | [ ] | + +## UAT Script 4: Repack Wizard Conversions +**Goal**: Convert bulk UoM to retail UoM directly. + +| Step | Action | Expected Result | Pass/Fail | +|---|---|---|---| +| 4.1 | As **Warehouse Staff**, go to Inventory > Operations > Repack Orders. | Custom wizard opens. | [ ] | +| 4.2 | Set Source = `10kg Bulk Turmeric`. Set Dest = `100 Units of 100g Packs`. Confirm. | 10kg removed from Inventory. 100 units added. Lot traceability preserved. | [ ] | diff --git a/docs/training/ROLES.md b/docs/training/ROLES.md new file mode 100644 index 0000000..631d7b5 --- /dev/null +++ b/docs/training/ROLES.md @@ -0,0 +1,28 @@ +# Role-Wise Training Notes + +This document provides specialized guidance to training different user types. + +## 1. Manufacturing Managers +- **Key Modules**: Manufacturing, Quality Control. +- **New Superpowers**: + - You can track exact output efficiency through the **Reporting > Yield & Wastage** dashboard. Anything yellow or red means your workers threw away more raw material than expected. + - You are no longer restricted to 1 finished good. Ensure your staff use the **Output Products** tab to register byproducts so accounting gets zero-cost tracking correctly. +- **Warnings**: Do not hit "Done" on an MO unless you have fully supplied the component Lot IDs. Odoo will block you if Expiry rules are enforced. + +## 2. Warehouse Staff +- **Key Modules**: Inventory, Repacking. +- **New Superpowers**: + - Instead of running complex manufacturing orders, you now use **Operations > Repack Orders** to instantly slice a bulk bucket of inventory into 100 retail bags. + - Expiration features (FEFO) are strict. When creating stock receipts from vendors, Odoo will demand the Lot number. Put the supplier's barcode in. + +## 3. Procurement Office / Wholesalers +- **Key Modules**: Purchase, Sales. +- **New Superpowers**: + - No more double entry for inner-group trading! If you (Clickstocart Inc) buy goods from C2C Imports, just Confirm your PO. Email your wholesale partner to log in—they will see the Sales Order already typed up and waiting for shipment. + - Pricelists are active. Sales teams do not need manual discounts. + +## 4. Accounts Team +- **Key Modules**: Accounting, Dashboards. +- **New Superpowers**: + - C2C Dashboards provide **Intercompany AR/AP** live balances. + - When inner-group companies ship products, Odoo automatically processes Draft Bills and Invoices for both sides, perfectly matching quantities in transit. diff --git a/scripts/backup_drill.sh b/scripts/backup_drill.sh new file mode 100644 index 0000000..e234243 --- /dev/null +++ b/scripts/backup_drill.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Backup Drill Script for C2C ERP +# Goal: Setup automated daily backups and conduct restore test on staging + +# Config +CONTAINER_NAME="odoo_clickstocart_db" +DB_USER="odoo" +DB_NAME="Clickstocart" +BACKUP_DIR="/var/lib/postgresql/data/backups" +TIMESTAMP=$(date +"%Y%m%d_%H%M%S") +BACKUP_FILE="${BACKUP_DIR}/${DB_NAME}_${TIMESTAMP}.sql" + +# 1. Execute Backup inside the postgres container +echo "Starting database backup for ${DB_NAME}..." +docker exec -i ${CONTAINER_NAME} mkdir -p ${BACKUP_DIR} +docker exec -i ${CONTAINER_NAME} pg_dump -U ${DB_USER} -d ${DB_NAME} -F c -f ${BACKUP_FILE} + +if [ $? -eq 0 ]; then + echo "✅ Backup successfully created at: ${BACKUP_FILE}" +else + echo "❌ Backup failed!" + exit 1 +fi + +# 2. Simulate Restore Test (Staging database) +STAGING_DB="${DB_NAME}_staging_test" +echo "Starting RESTORE DRILL to staging database: ${STAGING_DB}" + +# Create staging database +docker exec -i ${CONTAINER_NAME} psql -U ${DB_USER} -d postgres -c "CREATE DATABASE \"${STAGING_DB}\";" + +# Restore the dump into the new staging database +docker exec -i ${CONTAINER_NAME} pg_restore -U ${DB_USER} -d ${STAGING_DB} -1 ${BACKUP_FILE} + +if [ $? -eq 0 ]; then + echo "✅ Restore Drill successfully validated on ${STAGING_DB}!" +else + echo "❌ Restore Drill failed!" + exit 1 +fi + +echo "=========================================" +echo "✅ Performance + Backup Drill Completed! " +echo "=========================================" diff --git a/scripts/create_demo_data.py b/scripts/create_demo_data.py new file mode 100644 index 0000000..9ae8a65 --- /dev/null +++ b/scripts/create_demo_data.py @@ -0,0 +1,59 @@ +# Demo Dataset Script for UAT Phase +# Installs sample raw materials, bulk inventory, and finished goods to test all 4 weeks of features. +from odoo import api, SUPERUSER_ID + +env = env(user=SUPERUSER_ID) + +# 1. Create a dummy test UoM (if needed) or use standard +kg_uom = env.ref('uom.product_uom_kgm').id +unit_uom = env.ref('uom.product_uom_unit').id + +print("Generating Demo Products...") + +prod_bulk = env['product.product'].create({ + 'name': '[DEMO-100] Turmeric Bulk Sack', + 'type': 'product', + 'tracking': 'lot', + 'uom_id': kg_uom, + 'uom_po_id': kg_uom, + 'list_price': 150.0, + 'standard_price': 120.0, +}) + +prod_retail = env['product.product'].create({ + 'name': '[DEMO-200] Turmeric Retail Bag 500g', + 'type': 'product', + 'tracking': 'lot', + 'uom_id': unit_uom, + 'uom_po_id': unit_uom, + 'list_price': 5.0, + 'standard_price': 2.5, +}) + +prod_byproduct = env['product.product'].create({ + 'name': '[DEMO-300] Turmeric Stems / Core', + 'type': 'product', + 'tracking': 'none', + 'uom_id': kg_uom, + 'uom_po_id': kg_uom, + 'list_price': 0.5, + 'standard_price': 0.1, +}) + +print("Generating Demo BOM Structure...") +bom = env['mrp.bom'].create({ + 'product_tmpl_id': prod_retail.product_tmpl_id.id, + 'product_qty': 200, # 100 kg of bulk = 200 bags of 500g + 'type': 'normal', + 'bom_line_ids': [(0, 0, { + 'product_id': prod_bulk.id, + 'product_qty': 100, + 'product_uom_id': kg_uom, + })] +}) + +# NOTE: Custom output products (Byproducts) can be dynamically linked through testing manually +# due to varying implementations (standard odoo byproduct vs custom c2c_multi_output_bom) + +print("✅ Demo Data Successfully Generated!") +env.cr.commit()