Skip to content

Commit bf9d512

Browse files
Merge pull request #7 from John75SunCity/main
pull
2 parents 8bbd37d + 5de1a53 commit bf9d512

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+843
-254
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "design-themes"]
2+
path = design-themes
3+
url = https://github.com/odoo/design-themes.git

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"python.analysis.typeCheckingMode": "basic",
32
"python.analysis.extraPaths": [
43
"/workspaces/ssh-git-github.com-odoo-odoo.git-8.0"
54
]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ It is designed for use in a Dockerized development environment, such as GitHub C
1616

1717
## Project Structure
1818

19-
```
19+
```text
2020
.
2121
├── records_management/
2222
│ ├── __init__.py

docker-compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '2'
1+
version: '3'
22
services:
33
db:
44
image: postgres:10
@@ -9,16 +9,16 @@ services:
99
restart: always
1010

1111
odoo:
12-
image: odoo:8.0
12+
image: odoo:16.0
1313
depends_on:
1414
- db
1515
ports:
1616
- "8069:8069"
1717
volumes:
18+
# Ensure the 'records_management' directory exists at the project root or update the path below to an absolute path if needed
1819
- ./records_management:/mnt/extra-addons/records_management
1920
environment:
2021
- HOST=db
2122
- USER=odoo
22-
- PASSWORD=odoo
23-
restart: always
24-
/mnt/extra-addons/records_management/__manifest__.py
23+
restart: always
24+
# /mnt/extra-addons/records_management/__manifest__.py

records_management-1/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Records Management Odoo Module
2+
3+
## Overview
4+
The Records Management module for Odoo is designed to streamline the management of records related to shredding services and inventory control. This module allows users to create and manage pickup requests, track shredding services, and maintain an organized inventory of stock items.
5+
6+
## Features
7+
- **Pickup Requests**: Users can create and manage pickup requests for items associated with customers.
8+
- **Shredding Services**: Track shredding services provided to customers, including service types and associated charges.
9+
- **Inventory Management**: View and manage inventory items linked to customers, including serial numbers and quantities.
10+
- **Audit Logging**: Maintain a log of actions taken on records for accountability and tracking purposes.
11+
12+
## Installation Instructions
13+
1. **Clone the Repository**: Clone the repository to your local machine.
14+
```
15+
git clone <repository-url>
16+
```
17+
2. **Install Dependencies**: Ensure that you have Odoo installed and running. Install any required Python packages.
18+
3. **Add the Module**: Place the `records_management` directory in your Odoo addons path.
19+
4. **Update the App List**: In the Odoo interface, go to Apps and click on "Update Apps List".
20+
5. **Install the Module**: Search for "Records Management" in the Apps menu and click "Install".
21+
22+
## Usage
23+
- **Creating Pickup Requests**: Navigate to the Pickup Requests menu to create new requests for items.
24+
- **Managing Shredding Services**: Access the Shredding Services menu to log and track shredding activities.
25+
- **Viewing Inventory**: Use the Inventory menu to view and manage stock items associated with customers.
26+
27+
## Security
28+
The module includes security settings to manage access rights for different user groups, ensuring that only authorized personnel can perform sensitive actions.
29+
30+
## JavaScript Functionality
31+
The module integrates JavaScript for enhanced user interaction, including barcode scanning capabilities for quick item identification.
32+
33+
## Support
34+
For any issues or feature requests, please open an issue in the repository or contact the module maintainer.

records_management-1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import models
2+
from . import controllers
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "Records Management",
3+
"version": "1.0",
4+
"category": "Inventory",
5+
"summary": "Module for managing records and shredding services.",
6+
"description": "This module provides functionalities for managing stock production lots, shredding services, and pickup requests, including customer references and audit logging.",
7+
"author": "Your Name",
8+
"website": "https://yourwebsite.com",
9+
"depends": [
10+
"base",
11+
"stock",
12+
"sale",
13+
"web"
14+
],
15+
"data": [
16+
"security/ir.model.access.csv",
17+
"security/security.xml",
18+
"data/scrm_records_management_data.xml",
19+
"views/scrm_records_management_views.xml",
20+
"views/scrm_records_management_templates.xml",
21+
"views/assets.xml"
22+
],
23+
"installable": true,
24+
"application": false,
25+
"auto_install": false
26+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# File: /records_management/records_management/controllers/__init__.py
2+
3+
from . import scrm_records_management_controller
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
from odoo import http
2+
from odoo.http import request
3+
from odoo.exceptions import AccessError, ValidationError
4+
from odoo import _
5+
6+
class ScrmRecordsManagementController(http.Controller):
7+
8+
@http.route('/my/inventory', type='http', auth='user', website=True)
9+
def inventory(self, **kw):
10+
partner = request.env.user.partner_id
11+
if not partner:
12+
raise AccessError(_("No partner associated with this user."))
13+
14+
serials = request.env['stock.production.lot'].search([('customer_id', '=', partner.id)])
15+
quants = request.env['stock.quant'].search([('lot_id', 'in', serials.ids), ('location_id.usage', '=', 'internal')])
16+
17+
return request.render('records_management.inventory_template', {'quants': quants})
18+
19+
@http.route('/my/request_pickup', type='http', auth='user', website=True, methods=['GET', 'POST'])
20+
def request_pickup(self, **post):
21+
partner = request.env.user.partner_id
22+
error = None
23+
24+
if request.httprequest.method == 'POST':
25+
try:
26+
raw_ids = request.httprequest.form.getlist('item_ids')
27+
item_ids = [int(id) for id in raw_ids if id.isdigit()]
28+
if not item_ids:
29+
error = _("Please select at least one item for pickup.")
30+
else:
31+
request.env['pickup.request'].sudo().create_pickup_request(partner, item_ids)
32+
return request.redirect('/my/inventory')
33+
except (ValidationError, Exception) as e:
34+
error = str(e)
35+
36+
serials = request.env['stock.production.lot'].search([('customer_id', '=', partner.id)])
37+
return request.render('records_management.pickup_request_form', {
38+
'serials': serials,
39+
'error': error,
40+
'pickup_item_ids_field': 'item_ids',
41+
'partner': partner,
42+
'pickup_request': request.env['pickup.request'].new({
43+
'customer_id': partner.id,
44+
'item_ids': [(6, 0, [])]
45+
}),
46+
})

0 commit comments

Comments
 (0)