Skip to content

Commit

Permalink
[ADD] Added l10n_co_dian_resolution module
Browse files Browse the repository at this point in the history
  • Loading branch information
svazquezco committed Dec 13, 2018
1 parent 3a19f7a commit 0229d83
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 0 deletions.
1 change: 1 addition & 0 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
1 change: 1 addition & 0 deletions __manifiest__.py → __manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

],
'data': [
'views/l10n_co_dian_resolution.xml',

],
'installable': True
Expand Down
1 change: 1 addition & 0 deletions models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import l10n_co_dian_resolution
Empty file removed static/__init__.py
Empty file.
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import test_dian_resolution
28 changes: 28 additions & 0 deletions tests/test_dian_resolution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from odoo import fields

from odoo.tests.common import TransactionCase
from odoo.exceptions import UserError


class TestL10nCoDianResolution(TransactionCase):

def setUp(self):
self.dian_resolution = self.env.ref('l10n.co.dian.resolution')
self.resolution_fe = self.dian_resolution.create({
'name': 'Resolution FE',
'document_type': 'fe',
'technical_key': 'abc123455',
'prefix': 'PRE',
'range_from': '1',
'range_to': '100',
'next_number': 1,
'start_date': fields.Date.today(),
'end_date': fields.Date.today(),
})







75 changes: 75 additions & 0 deletions views/l10n_co_dian_resolution.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="l10n_co_dian_resolution_tree" model="ir.ui.view">
<field name="name">l10n.co.dian.resolution.tree</field>
<field name="model">l10n.co.dian.resolution</field>
<field name="arch" type="xml">
<tree string="DIAN - Resolutions">
<field name="name"/>
<field name="company_id"/>
<field name="document_type"/>
<field name="resolution_number"/>
<field name="technical_key"/>
<field name="prefix"/>
<field name="range_from"/>
<field name="range_to"/>
<field name="next_number"/>
<field name="start_date"/>
<field name="end_date"/>
<field name="active"/>
</tree>
</field>
</record>

<record id="l10n_co_dian_resolution_form" model="ir.ui.view">
<field name="name">l10n.co.dian.resolution.form</field>
<field name="model">l10n.co.dian.resolution</field>
<field name="arch" type="xml">
<form string="DIAN - Resolutions">
<group>
<field name="name"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_open': True, 'no_create': True}"/>
<field name="document_type"/>
<field name="resolution_number"/>
<field name="technical_key"/>
<field name="prefix"/>
<field name="range_from"/>
<field name="range_to"/>
<field name="next_number"/>
<field name="start_date"/>
<field name="end_date"/>
<field name="active"/>
</group>
</form>
</field>
</record>

<record id="l10n_co_dian_resolution_search" model="ir.ui.view">
<field name="name">l10n.co.dian.resolution.search</field>
<field name="model">l10n.co.dian.resolution</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="resolution_number"/>
<field name="technical_key"/>
<field name="document_type"/>
</search>
</field>
</record>

<record id="action_l10n_co_dian_resolution" model="ir.actions.act_window">
<field name="name">DIAN - Resolutions</field>
<field name="res_model">l10n.co.dian.resolution</field>
<field name="view_mode">tree,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="l10n_co_dian_resolution_tree"/>
</record>


<menuitem action="action_l10n_co_dian_resolution"
name="DIAN - Resolutions"
id="l10n_co_dian_resolution"
parent="account.menu_finance_configuration"/>

</odoo>

0 comments on commit 0229d83

Please sign in to comment.