Skip to content

Commit 851de67

Browse files
committed
Describe your changes
1 parent d609721 commit 851de67

25 files changed

+362
-30
lines changed
File renamed without changes.

.devcontainer/.vscode/launch.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python Debugger: Current File",
9+
"type": "debugpy",
10+
"request": "launch",
11+
"program": "${file}",
12+
"console": "integratedTerminal"
13+
},
14+
{
15+
"name": "Python Debugger: Current File",
16+
"type": "debugpy",
17+
"request": "launch",
18+
"program": "${file}",
19+
"console": "integratedTerminal"
20+
}
21+
]
22+
}

.devcontainer/devcontainer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"image": "mcr.microsoft.com/devcontainers/universal:2",
3-
"features": {}
4-
}
5-
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
2+
"features": {
3+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
4+
}
5+
}

.devcontainer/records_management

Lines changed: 0 additions & 1 deletion
This file was deleted.

.vscode/launch.json

Lines changed: 0 additions & 21 deletions
This file was deleted.

records_management/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
from .. import models
2+
13
{
24
'name': 'Records Management',
35
'version': '1.0',
46
'depends': ['stock', 'web'],
57
'data': [
68
'views/inventory_template.xml',
79
'views/pickup_request_form.xml',
10+
'views/your_view1.xml',
11+
'views/your_view2.xml',
12+
'security/ir.model.access.csv',
813
],
914
'installable': True,
1015
'application': True,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import portal
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from odoo import http
2+
from odoo.http import request
3+
4+
class InventoryPortal(http.Controller):
5+
@http.route('/my/inventory', type='http', auth='user', website=True)
6+
def inventory(self, **kw):
7+
partner = request.env.user.partner_id
8+
serials = request.env['stock.production.lot'].search([('customer_id', '=', partner.id)])
9+
quants = request.env['stock.quant'].search([
10+
('lot_id', 'in', serials.ids),
11+
('location_id.usage', '=', 'internal')
12+
])
13+
return request.render('records_management.inventory_template', {'quants': quants})
14+
15+
@http.route('/my/request_pickup', type='http', auth='user', website=True, methods=['POST'])
16+
def request_pickup(self, **post):
17+
partner = request.env.user.partner_id
18+
item_ids = [int(id) for id in request.httprequest.form.getlist('item_ids')]
19+
items = request.env['stock.production.lot'].search([
20+
('id', 'in', item_ids),
21+
('customer_id', '=', partner.id)
22+
])
23+
if items:
24+
request.env['pickup.request'].create({
25+
'customer_id': partner.id,
26+
'item_ids': [(6, 0, items.ids)],
27+
})
28+
return request.redirect('/my/inventory')

0 commit comments

Comments
 (0)