16 changed files with 194 additions and 0 deletions
@ -0,0 +1,4 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
|
||||
|
from . import controllers |
||||
|
from . import models |
@ -0,0 +1,29 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
{ |
||||
|
'name': """Business Register(Uzņēmumu Reģistrs) open data retriever""", |
||||
|
|
||||
|
'summary':"""Module for loading Latvian Business Register data""", |
||||
|
|
||||
|
'author': """My Company""", |
||||
|
'website':"http://www.yourcompany.com", |
||||
|
|
||||
|
# Categories can be used to filter modules in modules listing |
||||
|
# Check https://github.com/odoo/odoo/blob/14.0/odoo/addons/base/data/ir_module_category_data.xml |
||||
|
# for the full list |
||||
|
'category': 'Uncategorized', |
||||
|
'version': '0.1', |
||||
|
|
||||
|
# any module necessary for this one to work correctly |
||||
|
'depends': ['base'], |
||||
|
|
||||
|
# always loaded |
||||
|
'data': [ |
||||
|
# 'security/ir.model.access.csv', |
||||
|
'views/views.xml', |
||||
|
'views/templates.xml', |
||||
|
], |
||||
|
# only loaded in demonstration mode |
||||
|
'demo': [ |
||||
|
'demo/demo.xml', |
||||
|
], |
||||
|
} |
Binary file not shown.
@ -0,0 +1,3 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
|
||||
|
from . import controllers |
Binary file not shown.
Binary file not shown.
@ -0,0 +1,21 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# from odoo import http |
||||
|
|
||||
|
|
||||
|
# class UrData(http.Controller): |
||||
|
# @http.route('/ur_data/ur_data', auth='public') |
||||
|
# def index(self, **kw): |
||||
|
# return "Hello, world" |
||||
|
|
||||
|
# @http.route('/ur_data/ur_data/objects', auth='public') |
||||
|
# def list(self, **kw): |
||||
|
# return http.request.render('ur_data.listing', { |
||||
|
# 'root': '/ur_data/ur_data', |
||||
|
# 'objects': http.request.env['ur_data.ur_data'].search([]), |
||||
|
# }) |
||||
|
|
||||
|
# @http.route('/ur_data/ur_data/objects/<model("ur_data.ur_data"):obj>', auth='public') |
||||
|
# def object(self, obj, **kw): |
||||
|
# return http.request.render('ur_data.object', { |
||||
|
# 'object': obj |
||||
|
# }) |
@ -0,0 +1,30 @@ |
|||||
|
<odoo> |
||||
|
<data> |
||||
|
<!-- |
||||
|
<record id="object0" model="ur_data.ur_data"> |
||||
|
<field name="name">Object 0</field> |
||||
|
<field name="value">0</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="object1" model="ur_data.ur_data"> |
||||
|
<field name="name">Object 1</field> |
||||
|
<field name="value">10</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="object2" model="ur_data.ur_data"> |
||||
|
<field name="name">Object 2</field> |
||||
|
<field name="value">20</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="object3" model="ur_data.ur_data"> |
||||
|
<field name="name">Object 3</field> |
||||
|
<field name="value">30</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="object4" model="ur_data.ur_data"> |
||||
|
<field name="name">Object 4</field> |
||||
|
<field name="value">40</field> |
||||
|
</record> |
||||
|
--> |
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,3 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
|
||||
|
from . import models |
Binary file not shown.
Binary file not shown.
@ -0,0 +1,18 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
|
||||
|
# from odoo import models, fields, api |
||||
|
|
||||
|
|
||||
|
# class ur_data(models.Model): |
||||
|
# _name = 'ur_data.ur_data' |
||||
|
# _description = 'ur_data.ur_data' |
||||
|
|
||||
|
# name = fields.Char() |
||||
|
# value = fields.Integer() |
||||
|
# value2 = fields.Float(compute="_value_pc", store=True) |
||||
|
# description = fields.Text() |
||||
|
# |
||||
|
# @api.depends('value') |
||||
|
# def _value_pc(self): |
||||
|
# for record in self: |
||||
|
# record.value2 = float(record.value) / 100 |
|
After Width: | Height: | Size: 7.9 KiB |
@ -0,0 +1,24 @@ |
|||||
|
<odoo> |
||||
|
<data> |
||||
|
<!-- |
||||
|
<template id="listing"> |
||||
|
<ul> |
||||
|
<li t-foreach="objects" t-as="object"> |
||||
|
<a t-attf-href="#{ root }/objects/#{ object.id }"> |
||||
|
<t t-esc="object.display_name"/> |
||||
|
</a> |
||||
|
</li> |
||||
|
</ul> |
||||
|
</template> |
||||
|
<template id="object"> |
||||
|
<h1><t t-esc="object.display_name"/></h1> |
||||
|
<dl> |
||||
|
<t t-foreach="object._fields" t-as="field"> |
||||
|
<dt><t t-esc="field"/></dt> |
||||
|
<dd><t t-esc="object[field]"/></dd> |
||||
|
</t> |
||||
|
</dl> |
||||
|
</template> |
||||
|
--> |
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,60 @@ |
|||||
|
<odoo> |
||||
|
<data> |
||||
|
<!-- explicit list view definition --> |
||||
|
<!-- |
||||
|
<record model="ir.ui.view" id="ur_data.list"> |
||||
|
<field name="name">ur_data list</field> |
||||
|
<field name="model">ur_data.ur_data</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree> |
||||
|
<field name="name"/> |
||||
|
<field name="value"/> |
||||
|
<field name="value2"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
--> |
||||
|
|
||||
|
<!-- actions opening views on models --> |
||||
|
<!-- |
||||
|
<record model="ir.actions.act_window" id="ur_data.action_window"> |
||||
|
<field name="name">ur_data window</field> |
||||
|
<field name="res_model">ur_data.ur_data</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
</record> |
||||
|
--> |
||||
|
|
||||
|
<!-- server action to the one above --> |
||||
|
<!-- |
||||
|
<record model="ir.actions.server" id="ur_data.action_server"> |
||||
|
<field name="name">ur_data server</field> |
||||
|
<field name="model_id" ref="model_ur_data_ur_data"/> |
||||
|
<field name="state">code</field> |
||||
|
<field name="code"> |
||||
|
action = { |
||||
|
"type": "ir.actions.act_window", |
||||
|
"view_mode": "tree,form", |
||||
|
"res_model": model._name, |
||||
|
} |
||||
|
</field> |
||||
|
</record> |
||||
|
--> |
||||
|
|
||||
|
<!-- Top menu item --> |
||||
|
<!-- |
||||
|
<menuitem name="ur_data" id="ur_data.menu_root"/> |
||||
|
--> |
||||
|
<!-- menu categories --> |
||||
|
<!-- |
||||
|
<menuitem name="Menu 1" id="ur_data.menu_1" parent="ur_data.menu_root"/> |
||||
|
<menuitem name="Menu 2" id="ur_data.menu_2" parent="ur_data.menu_root"/> |
||||
|
--> |
||||
|
<!-- actions --> |
||||
|
<!-- |
||||
|
<menuitem name="List" id="ur_data.menu_1_list" parent="ur_data.menu_1" |
||||
|
action="ur_data.action_window"/> |
||||
|
<menuitem name="Server to list" id="ur_data" parent="ur_data.menu_2" |
||||
|
action="ur_data.action_server"/> |
||||
|
--> |
||||
|
</data> |
||||
|
</odoo> |
Loading…
Reference in new issue