Commit 87747252 by irul

menambahkan model, menu, form, authorization sudut_pandang

1 parent 4ff9ecd5
......@@ -5,72 +5,3 @@ from . import controllers
from . import models
from . import wizard
from . import report
from odoo import api, SUPERUSER_ID
SYSCOHADA_LIST = ['BJ', 'BF', 'CM', 'CF', 'KM', 'CG', 'CI', 'GA', 'GN', 'GW',
'GQ', 'ML', 'NE', 'CD', 'SN', 'TD', 'TG']
def _set_fiscal_country(env):
""" Sets the fiscal country on existing companies when installing the module.
That field is an editable computed field. It doesn't automatically get computed
on existing records by the ORM when installing the module, so doing that by hand
ensures existing records will get a value for it if needed.
"""
env['res.company'].search([]).compute_pad_tax_fiscal_country()
def _auto_install_l10n(env):
pass
# check the country of the main company (only) and eventually load some module needed in that country
# country_code = env.company.country_id.code
# if country_code:
# # auto install localization module(s) if available
# to_install_l10n = env['ir.module.module'].search_count([
# ('category_id', '=', env.ref('base.module_category_pading_localizations_pad_charts').id),
# ('state', '=', 'to install'),
# ])
# module_list = []
# if to_install_l10n:
# # We don't install a CoA if one was passed in the command line
# # or has been selected to install
# pass
# elif country_code in SYSCOHADA_LIST:
# # countries using OHADA Chart of pads
# module_list.append('l10n_syscohada')
# elif country_code == 'GB':
# module_list.append('l10n_uk')
# elif country_code == 'DE':
# module_list.append('l10n_de_skr03')
# module_list.append('l10n_de_skr04')
# else:
# if env['ir.module.module'].search([('name', '=', 'l10n_' + country_code.lower())]):
# module_list.append('l10n_' + country_code.lower())
# else:
# module_list.append('l10n_generic_coa')
# if country_code == 'US':
# module_list.append('pad_plaid')
# if country_code in ['US', 'CA']:
# module_list.append('pad_check_printing')
# if country_code in ['US', 'AU', 'NZ', 'CA', 'CO', 'EC', 'ES', 'FR', 'IN', 'MX', 'GB']:
# module_list.append('pad_yodlee')
# if country_code in SYSCOHADA_LIST + [
# 'AT', 'BE', 'CA', 'CO', 'DE', 'EC', 'ES', 'ET', 'FR', 'GR', 'IT', 'LU', 'MX', 'NL', 'NO',
# 'PL', 'PT', 'RO', 'SI', 'TR', 'GB', 'VE', 'VN'
# ]:
# module_list.append('base_vat')
# if country_code == 'MX':
# module_list.append('l10n_mx_edi')
# if country_code == 'IT':
# module_list.append('l10n_it_edi_sdicoop')
#
# module_ids = env['ir.module.module'].search([('name', 'in', module_list), ('state', '=', 'uninstalled')])
# module_ids.sudo().button_install()
def _pad_post_init(cr, registry):
pass
# env = api.Environment(cr, SUPERUSER_ID, {})
# _auto_install_l10n(env)
# _set_fiscal_country(env)
......@@ -22,14 +22,16 @@ Menydiakan module untuk followup Wajib Pajak/Retribusi.
'data': [
'views/view_config.xml',
'views/objek_pajak.xml',
'views/sudut_pandang.xml',
'views/pdl_kab_menus.xml',
'security/account_security.xml',
'security/ir.model.access.csv',
],
'demo': [],
'qweb': [],
'installable': True,
'application': True,
'auto_install': False,
'post_init_hook': '_pad_post_init',
'license': 'LGPL-3',
'module': 'pajak'
}
from . import partner
from . import pdl_sudut_pandang
\ No newline at end of file
import time
import logging
from psycopg2 import sql, DatabaseError
from odoo import api, fields, models, _
class PdlSudutPandang(models.Model):
_name = 'pdl.sudut.pandang'
_description = 'Sudut Pandang'
code = fields.Char(String='Kode', width=32)
name = fields.Char(index=True, String='Nama', width=64)
value = fields.Float(String='Nilai')
_sql_constraints = [
('code_uniq', 'unique (code)', 'Kode harus unik')
]
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<record model="ir.module.category" id="pdl_kab">
<field name="name">PDL</field>
<field name="description">PDL</field>
<field name="sequence">1</field>
</record>
<record model="ir.module.category" id="pdl_kab_admin">
<field name="name">Administrator</field>
<field name="description">Administrator</field>
<field name="sequence">2</field>
<field name="parent_id" ref="pdl_kab"/>
</record>
<record id="group_pdl_konfigurasi" model="res.groups">
<field name="name">Mengubah konfigurasi</field>
<field name="comment">Mengubah konfigurasi</field>
<field name="category_id" ref="pdl_kab_admin"/>
</record>
</data>
</odoo>
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_sudut_pandang_config","access.sudut.pandang.config","model_pdl_sudut_pandang","base.group_system",1,1,1,1
"access_sudut_pandang_config_pdl_admin","access.sudut.pandang.config.pdl.admin","model_pdl_sudut_pandang","group_pdl_konfigurasi",1,1,1,1
......@@ -49,4 +49,17 @@
parent="config_pdl_kab_menu"
action="action_tax_config_pdl_kab"
sequence="2"/>
<menuitem id="provinsi_config_pdl_kab_menu"
name="Provinsi"
parent="config_pdl_kab_menu"
action="action_provinsi_config_pdl_kab"
sequence="3"/>
<menuitem id="pdl_sudut_pandang_config_pdl_kab_menu"
name="Sudut Pandang"
parent="config_pdl_kab_menu"
action="action_pdl_sudut_pandang"
sequence="4"/>
</odoo>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="pdl_sudut_pandang_tree" model="ir.ui.view">
<field name="name">pdl.sudut.pandang.tree</field>
<field name="model">pdl.sudut.pandang</field>
<field name="arch" type="xml">
<tree string="Sudut Pandang" sample="1" create="1" delete="1" multi_edit="0">
<field name="code" string="Kode"/>
<field name="name" string="Nama"/>
<field name="value" string="Nilai"/>
</tree>
</field>
</record>
<record id="pdl_sudut_pandang_form" model="ir.ui.view">
<field name="name">pdl.sudut.pandang.form</field>
<field name="model">pdl.sudut.pandang</field>
<field name="arch" type="xml">
<form string="Sudut Pandang" sample="1">
<sheet>
<h1>
<field name="name" string="Nama"/>
</h1>
<group>
<field name="code" string="Kode"/>
<field name="value" string="Nilai"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="action_pdl_sudut_pandang" model="ir.actions.act_window">
<field name="name">Sudut Pandang</field>
<field name="res_model">pdl.sudut.pandang</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_id" ref="pdl_sudut_pandang_tree"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Sudut Pandang
</p>
</field>
</record>
</data>
</odoo>
\ No newline at end of file
......@@ -196,6 +196,13 @@
<field name="view_mode">tree,form</field>
</record>
<record id="action_provinsi_config_pdl_kab" model="ir.actions.act_window">
<field name="name">Provinsi</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.country.state</field>
<field name="view_mode">tree,form</field>
</record>
</data>
</odoo>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!