-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ # pylint: disable=C8101,C8103 | ||
'name': "Importação DI", | ||
|
||
'summary': "Gerenciamento da Declaração de Importação (DI)", | ||
|
||
'description': "", | ||
'author': "Trustcode", | ||
'website': "http://www.trustcode.com.br", | ||
'category': 'purchase', | ||
'version': '12.0.1.0.0', | ||
'license': 'AGPL-3', | ||
'contributors': [ | ||
'Mackilem Van der Laan <mack.vdl@gmail.com>', | ||
], | ||
'depends': ['purchase'], | ||
'data': [ | ||
'views/declaracao_importacao.xml', | ||
'security/ir.model.access.csv'], | ||
'installable': True, | ||
'application': False, | ||
'auto_install': False, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import declaracao_importacao |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# © 2019 Mackilem Van der Laan, Trustcode | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class DeclaracaoImportacao(models.Model): | ||
_name = "declaracao.importacao" | ||
_description = "Declaração da Importação (DI)" | ||
|
||
name = fields.Char( | ||
string="Número da DI", ) | ||
date_registro = fields.Date( | ||
string="Data Registro", ) | ||
sequence = fields.Integer( | ||
string="Sequence") | ||
tag_ids = fields.Many2many( | ||
string="Marcadores", | ||
comodel_name="declaracao.tags", | ||
ondelete="set null", | ||
help="Explain your field.",) | ||
declaracao_line_ids = fields.One2many( | ||
string="Adições", | ||
comodel_name="declaracao.importacao.line", | ||
inverse_name="declaracao_id") | ||
|
||
|
||
class DeclaracaoImportacaoLines(models.Model): | ||
_name = "declaracao.importacao.line" | ||
|
||
declaracao_id = fields.Many2one( | ||
string="Declaração", | ||
comodel_name="declaracao.importacao") | ||
product_id = fields.Many2one( | ||
string="Produto", | ||
comodel_name="product.product", | ||
ondelete="restrict") | ||
quantity = fields.Float(string="Quantidade") | ||
|
||
|
||
class DeclaracaoTags(models.Model): | ||
_name = "declaracao.tags" | ||
_description = "Marcadores para DI" | ||
|
||
name = fields.Char(string="Descrição", ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
access_di_manager,di.manager,model_declaracao_importacao,purchase.group_purchase_manager,1,1,1,1 | ||
access_di_user,di.user,model_declaracao_importacao,purchase.group_purchase_user,1,0,0,0 | ||
access_di_tags_user,di.tags.user,model_declaracao_tags,hr.group_hr_user,1,1,1,1 | ||
access_di_lines_user,di.lines.user,model_declaracao_importacao_line,hr.group_hr_user,1,1,1,1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<record id="declaracao_importacao_view_tree" model="ir.ui.view"> | ||
<field name="name">declaracao.importacao.tree</field> | ||
<field name="model">declaracao.importacao</field> | ||
<field name="arch" type="xml"> | ||
<tree string="Declaração Importação" default_order="sequence,name desc"> | ||
<field name="name" required="1"/> | ||
<field name="date_registro"/> | ||
<field name="sequence" /> | ||
</tree> | ||
</field> | ||
</record> | ||
|
||
<record id="declaracao_importacao_view_form" model="ir.ui.view"> | ||
<field name="name">declaracao.importacao.form</field> | ||
<field name="model">declaracao.importacao</field> | ||
<field name="arch" type="xml"> | ||
<form string="Declaração Importação"> | ||
<sheet> | ||
<group> | ||
<group> | ||
<field name="name" required="1"/> | ||
</group> | ||
<group> | ||
<field name="sequence" /> | ||
<field name="tag_ids" widget="many2many_tags" /> | ||
</group> | ||
</group> | ||
</sheet> | ||
<sheet> | ||
<notebook> | ||
<page string="Adições"> | ||
<group> | ||
<field name="declaracao_line_ids" nolabel="1" > | ||
<tree editable="bottom"> | ||
<field name="product_id" /> | ||
<field name="quantity" /> | ||
</tree> | ||
</field> | ||
</group> | ||
</page> | ||
<page string="Bolo de Banana" > | ||
<group> | ||
<field name="date_registro"/> | ||
</group> | ||
</page> | ||
</notebook> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record id="declaracao_importacao_action_form" model="ir.actions.act_window"> | ||
<field name="name">Declaração Importação</field> | ||
<field name="res_model">declaracao.importacao</field> | ||
<field name="view_mode">tree,form</field> | ||
<field name="help" type="html"> | ||
<p class="oe_view_nocontent_create"> | ||
<b>Registre aqui suas declarações de importação.</b> | ||
</p> | ||
<p> | ||
<i>Você pode importar da DI em formato de xml.</i> | ||
</p> | ||
</field> | ||
</record> | ||
|
||
<menuitem id="menu_declaracao_importacao" | ||
name="Declaração Importação (DI)" | ||
parent="purchase.menu_purchase_control" | ||
action="declaracao_importacao_action_form" | ||
sequence="3"/> | ||
|
||
|
||
</odoo> |