feat(kyc): Add kanban, graph, pivot views and remove documents field
- Remove documents field from model and form - Add kanban view for KYC requests - Add graph view for KYC analysis - Add pivot view for KYC statistics - Update action window to support new views - Add new view files to manifest
This commit is contained in:
@@ -39,7 +39,8 @@
|
||||
'--db_user=' + os.environ['ODOO_DB_USER'],
|
||||
'--db_password=' + os.environ['ODOO_DB_PASSWORD'],
|
||||
'-u', '{{ modules }}',
|
||||
'--stop-after-init'
|
||||
'--stop-after-init',
|
||||
'--no-http'
|
||||
], capture_output=True, text=True)
|
||||
print(result.stdout)
|
||||
print(result.stderr, file=__import__('sys').stderr)
|
||||
|
||||
@@ -88,16 +88,19 @@ tasks:
|
||||
nodes.insert(doc)
|
||||
print(f"Inserted node: {node_data['uuid']}")
|
||||
|
||||
# 3. Calculate isochrone via GraphHopper (with cache)
|
||||
# 3. Calculate isochrone via GraphHopper (20 hours car - has CH)
|
||||
- id: calculate_isochrone
|
||||
type: io.kestra.plugin.core.http.Request
|
||||
uri: "{{ vars.graphhopper_url }}/isochrone?point={{ json(outputs.fetch_node.body).latitude }},{{ json(outputs.fetch_node.body).longitude }}&time_limit=3600&profile=car"
|
||||
uri: "{{ vars.graphhopper_url }}/isochrone?point={{ json(outputs.fetch_node.body).latitude }},{{ json(outputs.fetch_node.body).longitude }}&time_limit=72000&profile=car"
|
||||
method: GET
|
||||
options:
|
||||
connectTimeout: PT30S
|
||||
readTimeout: PT5M
|
||||
connectTimeout: PT1M
|
||||
readTimeout: PT30M
|
||||
headers:
|
||||
Accept: application/json
|
||||
cache:
|
||||
ttl: P7D
|
||||
key: "isochrone_{{ json(outputs.fetch_node.body).latitude }}_{{ json(outputs.fetch_node.body).longitude }}_72000_car"
|
||||
|
||||
# 4. Save isochrone to ArangoDB
|
||||
- id: save_isochrone
|
||||
@@ -106,13 +109,14 @@ tasks:
|
||||
image: python:3.11-slim
|
||||
beforeCommands:
|
||||
- pip install python-arango kestra
|
||||
inputFiles:
|
||||
isochrone.json: "{{ outputs.calculate_isochrone.body }}"
|
||||
env:
|
||||
ARANGO_URL: "{{ vars.arangodb_url }}"
|
||||
ARANGO_DB: "{{ vars.arangodb_database }}"
|
||||
ARANGO_PASSWORD: "{{ secret('ARANGODB_PASSWORD') }}"
|
||||
NODE_UUID: "{{ render(vars.node_uuid) }}"
|
||||
DURATION_MINUTES: "{{ render(vars.duration_mins) }}"
|
||||
ISOCHRONE_DATA: "{{ outputs.calculate_isochrone.body }}"
|
||||
script: |
|
||||
import os
|
||||
import json
|
||||
@@ -121,7 +125,8 @@ tasks:
|
||||
from arango import ArangoClient
|
||||
from kestra import Kestra
|
||||
|
||||
isochrone_data = json.loads(os.environ['ISOCHRONE_DATA'])
|
||||
with open('isochrone.json') as f:
|
||||
isochrone_data = json.load(f)
|
||||
node_uuid = os.environ['NODE_UUID']
|
||||
duration_minutes = int(os.environ['DURATION_MINUTES'])
|
||||
|
||||
|
||||
@@ -26,6 +26,9 @@
|
||||
'views/allowed_countries_menu.xml',
|
||||
'views/kyc_view_form.xml',
|
||||
'views/kyc_view_tree.xml',
|
||||
'views/kyc_view_kanban.xml',
|
||||
'views/kyc_view_graph.xml',
|
||||
'views/kyc_view_pivot.xml',
|
||||
'views/kyc_view_search.xml',
|
||||
'views/kyc_action.xml',
|
||||
'views/menu_marketplace_root.xml',
|
||||
|
||||
@@ -35,8 +35,6 @@ class KYC(models.Model):
|
||||
score = fields.Integer('KYC Score', default=0, help="Score from 0 to 100")
|
||||
|
||||
|
||||
# Documents
|
||||
documents = fields.Text('Documents', help="JSON array of document URLs")
|
||||
|
||||
# Review Information
|
||||
reviewer_id = fields.Many2one('res.users', 'Reviewer', tracking=True)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<record id="action_marketplace_kyc" model="ir.actions.act_window">
|
||||
<field name="name">KYC Requests</field>
|
||||
<field name="res_model">kyc.request</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree,form,kanban,graph,pivot</field>
|
||||
<field name="context">{'search_default_pending': 1}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
|
||||
@@ -35,9 +35,6 @@
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Documents">
|
||||
<field name="documents"/>
|
||||
</page>
|
||||
<page string="Review Notes">
|
||||
<field name="review_notes" widget="html"/>
|
||||
</page>
|
||||
|
||||
15
odoo/addons/kyc/views/kyc_view_graph.xml
Normal file
15
odoo/addons/kyc/views/kyc_view_graph.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="view_kyc_request_graph" model="ir.ui.view">
|
||||
<field name="name">kyc.request.graph</field>
|
||||
<field name="model">kyc.request</field>
|
||||
<field name="arch" type="xml">
|
||||
<graph string="KYC Requests Analysis">
|
||||
<field name="status" type="row"/>
|
||||
<field name="create_date" interval="day" type="col"/>
|
||||
</graph>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
51
odoo/addons/kyc/views/kyc_view_kanban.xml
Normal file
51
odoo/addons/kyc/views/kyc_view_kanban.xml
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="view_kyc_request_kanban" model="ir.ui.view">
|
||||
<field name="name">kyc.request.kanban</field>
|
||||
<field name="model">kyc.request</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban class="o_kanban_small_column">
|
||||
<field name="status"/>
|
||||
<field name="team_name"/>
|
||||
<field name="name"/>
|
||||
<field name="score"/>
|
||||
<field name="submitted_date"/>
|
||||
<field name="reviewer_id"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click">
|
||||
<div class="o_kanban_record_top">
|
||||
<div class="o_kanban_record_headings">
|
||||
<strong class="o_kanban_record_title">
|
||||
<field name="name"/>
|
||||
</strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="o_kanban_record_body">
|
||||
<ul class="o_kanban_record_props list-unstyled">
|
||||
<li t-if="record.team_name.raw_value">
|
||||
<field name="team_name"/>
|
||||
</li>
|
||||
<li t-if="record.score.raw_value">
|
||||
<field name="score"/>/100
|
||||
</li>
|
||||
<li t-if="record.submitted_date.raw_value">
|
||||
Submitted: <field name="submitted_date"/>
|
||||
</li>
|
||||
<li t-if="record.reviewer_id.raw_value">
|
||||
Reviewer: <field name="reviewer_id"/>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="o_kanban_record_bottom">
|
||||
<div class="oe_kanban_status"/>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
16
odoo/addons/kyc/views/kyc_view_pivot.xml
Normal file
16
odoo/addons/kyc/views/kyc_view_pivot.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="view_kyc_request_pivot" model="ir.ui.view">
|
||||
<field name="name">kyc.request.pivot</field>
|
||||
<field name="model">kyc.request</field>
|
||||
<field name="arch" type="xml">
|
||||
<pivot string="KYC Status Analysis">
|
||||
<field name="status" type="row"/>
|
||||
<field name="team_type" type="col"/>
|
||||
<field name="create_date" type="measure"/>
|
||||
</pivot>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user