Skip to content

Commit

Permalink
Merge branch '14.0' into merge-to-14
Browse files Browse the repository at this point in the history
  • Loading branch information
danimaribeiro authored Aug 31, 2021
2 parents 887b69c + 0b95ce0 commit 698a1aa
Show file tree
Hide file tree
Showing 36 changed files with 350 additions and 84 deletions.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Comportamento Esperado

## Comportamento Atual

## Passos Para Reprodução do Problema

1.
1.
1.

## Screenshots/Log de Erros

## Ambiente

- Versão:
- Plataforma:
20 changes: 20 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Triggers a new docker image build

on:
push:
branches: [ 14.0 ]

jobs:
trigger-build:
runs-on: ubuntu-latest
steps:
- name: Trigger a dispatch action to docker-odoo repository
run: |
curl -X POST https://api.github.com/repos/Trust-Code/docker-odoo/actions/workflows/main.yml/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-u ${{ secrets.ACCESS_TOKEN }} \
--data '{"ref": "14.0"}'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.vim/
*.swp
.vscode/
pyrightconfig.json
2 changes: 1 addition & 1 deletion br_coa_me_epp/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'summary': "Plano de Contas para Microempresa e Empresa de Pequeno Porte",
'description': """Plano de Contas para Microempresa e EPP""",
'version': '13.0.1.0.0',
'category': 'Localization',
'category': 'Accounting/Localizations/Account Charts',
'author': 'Trustcode',
'license': 'AGPL-3',
'website': 'http://www.trustcode.com.br',
Expand Down
74 changes: 38 additions & 36 deletions br_coa_me_epp/data/account_group.xml
Original file line number Diff line number Diff line change
@@ -1,216 +1,218 @@
<odoo>
<data noupdate="1">

<record id="account_group_1" model="account.group">
<field name="code_prefix">1</field>
<field name="code_prefix_start">1</field>
<field name="name">Ativo</field>
</record>

<record id="account_group_1_1" model="account.group">
<field name="code_prefix">1.1</field>
<field name="code_prefix_start">1.1</field>
<field name="name">Ativo Circulante</field>
<field name="parent_id" ref="account_group_1"/>
</record>

<record id="account_group_1_1_1" model="account.group">
<field name="code_prefix">1.1.1</field>
<field name="code_prefix_start">1.1.1</field>
<field name="name">Caixa e Equivalentes de Caixa</field>
<field name="parent_id" ref="account_group_1_1"/>
</record>

<record id="account_group_1_1_2" model="account.group">
<field name="code_prefix">1.1.2</field>
<field name="code_prefix_start">1.1.2</field>
<field name="name">Contas a Receber</field>
<field name="parent_id" ref="account_group_1_1"/>
</record>

<record id="account_group_1_1_3" model="account.group">
<field name="code_prefix">1.1.3</field>
<field name="code_prefix_start">1.1.3</field>
<field name="name">Estoque</field>
<field name="parent_id" ref="account_group_1_1"/>
</record>

<record id="account_group_1_1_4" model="account.group">
<field name="code_prefix">1.1.4</field>
<field name="code_prefix_start">1.1.4</field>
<field name="name">Outros Créditos</field>
<field name="parent_id" ref="account_group_1_1"/>
</record>

<record id="account_group_1_3" model="account.group">
<field name="code_prefix">1.3</field>
<field name="code_prefix_start">1.3</field>
<field name="name">Ativo Não Circulante</field>
<field name="parent_id" ref="account_group_1"/>
</record>

<record id="account_group_1_3_1" model="account.group">
<field name="code_prefix">1.3.1</field>
<field name="code_prefix_start">1.3.1</field>
<field name="name">Realizável a Longo Prazo</field>
<field name="parent_id" ref="account_group_1_3"/>
</record>

<record id="account_group_1_3_2" model="account.group">
<field name="code_prefix">1.3.2</field>
<field name="code_prefix_start">1.3.2</field>
<field name="name">Investimentos</field>
<field name="parent_id" ref="account_group_1_3"/>
</record>

<record id="account_group_1_3_3" model="account.group">
<field name="code_prefix">1.3.3</field>
<field name="code_prefix_start">1.3.3</field>
<field name="name">Imobilizado</field>
<field name="parent_id" ref="account_group_1_3"/>
</record>

<record id="account_group_1_3_4" model="account.group">
<field name="code_prefix">1.3.4</field>
<field name="code_prefix_start">1.3.4</field>
<field name="name">Intangível</field>
<field name="parent_id" ref="account_group_1_3"/>
</record>

<record id="account_group_2" model="account.group">
<field name="code_prefix">2</field>
<field name="code_prefix_start">2</field>
<field name="name">Passivo e Patrimônio Líquido</field>
</record>

<record id="account_group_2_1" model="account.group">
<field name="code_prefix">2.1</field>
<field name="code_prefix_start">2.1</field>
<field name="name">Passivo Circulante</field>
<field name="parent_id" ref="account_group_2"/>
</record>

<record id="account_group_2_1_1" model="account.group">
<field name="code_prefix">2.1.1</field>
<field name="code_prefix_start">2.1.1</field>
<field name="name">Fornecedores Nacionais</field>
<field name="parent_id" ref="account_group_2_1"/>
</record>

<record id="account_group_2_1_2" model="account.group">
<field name="code_prefix">2.1.2</field>
<field name="code_prefix_start">2.1.2</field>
<field name="name">Empréstimos e Financiamentos</field>
<field name="parent_id" ref="account_group_2_1"/>
</record>

<record id="account_group_2_1_3" model="account.group">
<field name="code_prefix">2.1.3</field>
<field name="code_prefix_start">2.1.3</field>
<field name="name">Obrigações Fiscais</field>
<field name="parent_id" ref="account_group_2_1"/>
</record>

<record id="account_group_2_1_4" model="account.group">
<field name="code_prefix">2.1.4</field>
<field name="code_prefix_start">2.1.4</field>
<field name="name">Obrigações Trabalhistas e Sociais</field>
<field name="parent_id" ref="account_group_2_1"/>
</record>

<record id="account_group_2_1_5" model="account.group">
<field name="code_prefix">2.1.5</field>
<field name="code_prefix_start">2.1.5</field>
<field name="name">Contas a Pagar</field>
<field name="parent_id" ref="account_group_2_1"/>
</record>

<record id="account_group_2_1_6" model="account.group">
<field name="code_prefix">2.1.6</field>
<field name="code_prefix_start">2.1.6</field>
<field name="name">Provisões</field>
<field name="parent_id" ref="account_group_2_1"/>
</record>

<record id="account_group_2_2" model="account.group">
<field name="code_prefix">2.2</field>
<field name="code_prefix_start">2.2</field>
<field name="name">Passivo Não Circulante</field>
<field name="parent_id" ref="account_group_2"/>
</record>

<record id="account_group_2_2_1" model="account.group">
<field name="code_prefix">2.2.1</field>
<field name="code_prefix_start">2.2.1</field>
<field name="name">Financiamentos</field>
<field name="parent_id" ref="account_group_2_2"/>
</record>

<record id="account_group_2_2_2" model="account.group">
<field name="code_prefix">2.2.2</field>
<field name="code_prefix_start">2.2.2</field>
<field name="name">Outras Contas a Pagar</field>
<field name="parent_id" ref="account_group_2_2"/>
</record>

<record id="account_group_2_3" model="account.group">
<field name="code_prefix">2.3</field>
<field name="code_prefix_start">2.3</field>
<field name="name">Patrimônio Líquido</field>
<field name="parent_id" ref="account_group_2"/>
</record>

<record id="account_group_2_3_1" model="account.group">
<field name="code_prefix">2.3.1</field>
<field name="code_prefix_start">2.3.1</field>
<field name="name">Capital Social</field>
<field name="parent_id" ref="account_group_2_3"/>
</record>

<record id="account_group_2_3_2" model="account.group">
<field name="code_prefix">2.3.2</field>
<field name="code_prefix_start">2.3.2</field>
<field name="name">Reservas</field>
<field name="parent_id" ref="account_group_2_3"/>
</record>

<record id="account_group_2_3_3" model="account.group">
<field name="code_prefix">2.3.3</field>
<field name="code_prefix_start">2.3.3</field>
<field name="name">Passivo Circulante</field>
<field name="parent_id" ref="account_group_2_3"/>
</record>

<record id="account_group_3" model="account.group">
<field name="code_prefix">3</field>
<field name="code_prefix_start">3</field>
<field name="name">Receitas, Custos e Despesas (Contas de Resultado)</field>
</record>

<record id="account_group_3_1" model="account.group">
<field name="code_prefix">3.1</field>
<field name="code_prefix_start">3.1</field>
<field name="name">Receita</field>
<field name="parent_id" ref="account_group_3"/>
</record>

<record id="account_group_3_1_1" model="account.group">
<field name="code_prefix">3.1.1</field>
<field name="code_prefix_start">3.1.1</field>
<field name="name">Receitas de Venda</field>
<field name="parent_id" ref="account_group_3_1"/>
</record>

<record id="account_group_3_1_2" model="account.group">
<field name="code_prefix">3.1.2</field>
<field name="code_prefix_start">3.1.2</field>
<field name="name">Receitas Financeiras</field>
<field name="parent_id" ref="account_group_3_1"/>
</record>

<record id="account_group_3_1_3" model="account.group">
<field name="code_prefix">3.1.3</field>
<field name="code_prefix_start">3.1.3</field>
<field name="name">Outras Receitas Operacionais</field>
<field name="parent_id" ref="account_group_3_1"/>
</record>

<record id="account_group_3_2" model="account.group">
<field name="code_prefix">3.2</field>
<field name="code_prefix_start">3.2</field>
<field name="name">Custos e Despesas</field>
<field name="parent_id" ref="account_group_3"/>
</record>

<record id="account_group_3_2_1" model="account.group">
<field name="code_prefix">3.2.1</field>
<field name="code_prefix_start">3.2.1</field>
<field name="name">Custos dos Produtos, Mercadorias e Serviços Vendidos</field>
<field name="parent_id" ref="account_group_3_2"/>
</record>

<record id="account_group_3_2_2" model="account.group">
<field name="code_prefix">3.2.2</field>
<field name="code_prefix_start">3.2.2</field>
<field name="name">Despesas Operacionais</field>
<field name="parent_id" ref="account_group_3_2"/>
</record>

<record id="account_group_3_2_3" model="account.group">
<field name="code_prefix">3.2.3</field>
<field name="code_prefix_start">3.2.3</field>
<field name="name">Despesas Financeiras</field>
<field name="parent_id" ref="account_group_3_2"/>
</record>

<record id="account_group_3_2_4" model="account.group">
<field name="code_prefix">3.2.4</field>
<field name="code_prefix_start">3.2.4</field>
<field name="name">Outras Despesas Operacionais</field>
<field name="parent_id" ref="account_group_3_2"/>
</record>

</data>
</odoo>
2 changes: 1 addition & 1 deletion l10n_br_account/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ def post_init(cr, registry):

filename = 'data/account.ncm.csv'
convert_file(cr, 'l10n_br_account', filename, None,
mode='init', noupdate=True, kind='init', report=None)
mode='init', noupdate=True, kind='init')
1 change: 1 addition & 0 deletions l10n_br_account/security/ir.model.access.csv
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ access_br_account_fiscal_category_invoice,access_br_account_fiscal_category,mode
access_account_ncm,access_account_ncm,model_account_ncm,account.group_account_manager,1,1,1,1
access_account_ncm_user,access_account_ncm,model_account_ncm,account.group_account_user,1,0,0,0
access_account_ncm_invoice,access_account_ncm,model_account_ncm,account.group_account_invoice,1,0,0,0
access_payment_account_move_line,access_wizard_payment_account_move_line,model_payment_account_move_line,account.group_account_invoice,1,1,1,0
27 changes: 13 additions & 14 deletions l10n_br_account/wizard/payment_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class PaymentAccountMoveLine(models.TransientModel):
amount_residual = fields.Monetary(
string="Saldo", readonly=True, related="move_line_id.amount_residual"
)
amount = fields.Monetary(string="Valor do Pagamento", required=True,)
amount = fields.Monetary(string="Valor do Pagamento", required=True, )

@api.model
def default_get(self, fields):
Expand All @@ -67,7 +67,7 @@ def default_get(self, fields):
if move_line[0].move_id:
rec.update({"move_id": move_line[0].move_id.id})
rec.update(
{"amount": amount,}
{"amount": amount, }
)

return rec
Expand All @@ -78,9 +78,9 @@ def _get_payment_vals(self):
"""
payment_type = "inbound" if self.move_line_id.debit else "outbound"
payment_methods = (
payment_type == "inbound"
and self.journal_id.inbound_payment_method_ids
or self.journal_id.outbound_payment_method_ids
payment_type == "inbound"
and self.journal_id.inbound_payment_method_ids
or self.journal_id.outbound_payment_method_ids
)
payment_method_id = payment_methods and payment_methods[0].id or False
if not payment_method_id:
Expand All @@ -90,11 +90,11 @@ def _get_payment_vals(self):
)
vals = {
"partner_id": self.partner_id.id,
"move_line_ids": [(4, 0, self.move_line_id.id)],
"destination_account_id": self.move_line_id.account_id.id,
"journal_id": self.journal_id.id,
"communication": self.communication,
"ref": self.communication,
"amount": self.amount,
"payment_date": self.payment_date,
"date": self.payment_date,
"payment_type": payment_type,
"payment_method_id": payment_method_id,
"currency_id": self.currency_id.id,
Expand All @@ -107,14 +107,13 @@ def action_confirm_payment(self):
"""
payment = self.env["account.payment"]
vals = self._get_payment_vals()
pay = payment.with_context(
force_counterpart_account=self.move_line_id.account_id.id
).create(vals)
pay.post()
pay = payment.create(vals)
pay.action_post()
move_line = self.env["account.move.line"].browse(
vals["move_line_ids"][0][2]
self.move_line_id.id
)
lines_to_reconcile = (pay.move_line_ids + move_line).filtered(

lines_to_reconcile = (pay.line_ids + move_line).filtered(
lambda l: l.account_id == move_line.account_id
)
lines_to_reconcile.reconcile()
1 change: 1 addition & 0 deletions l10n_br_automated_payment/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},
'data': [
'data/verify_transaction_cron.xml',
'security/ir.model.access.csv',
'views/res_company.xml',
'views/account_move.xml',
'views/account_journal.xml',
Expand Down
3 changes: 3 additions & 0 deletions l10n_br_automated_payment/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_wizard_new_payment_invoice,access_wizard_new_payment_invoice,model_wizard_new_payment_invoice,account.group_account_invoice,1,1,1,0
access_wizard_change_iugu_invoice,access_wizard_change_iugu_invoice,model_wizard_change_iugu_invoice,account.group_account_invoice,1,1,1,0
Loading

0 comments on commit 698a1aa

Please sign in to comment.