Skip to content

Commit

Permalink
Merge pull request #696 from OCA/12.0
Browse files Browse the repository at this point in the history
Semana 22
  • Loading branch information
mileo authored May 31, 2021
2 parents 72fada4 + b6695f8 commit 4d0a2ed
Show file tree
Hide file tree
Showing 176 changed files with 1,985 additions and 918 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ addon | version | summary
[l10n_br_account](l10n_br_account/) | 12.0.5.1.0 | Brazilian Localization Account
[l10n_br_account_bank_statement_import_cnab](l10n_br_account_bank_statement_import_cnab/) | 12.0.1.0.0 | Importação de Extrato Bancário CNAB 240 - Segmento E
[l10n_br_account_payment_order](l10n_br_account_payment_order/) | 12.0.1.0.0 | Brazilian Payment Order
[l10n_br_base](l10n_br_base/) | 12.0.3.1.0 | Customization of base module for implementations in Brazil.
[l10n_br_base](l10n_br_base/) | 12.0.3.2.0 | Customization of base module for implementations in Brazil.
[l10n_br_coa](l10n_br_coa/) | 12.0.3.1.0 | Base Brasilian Localization for the Chart of Accounts
[l10n_br_coa_complete](l10n_br_coa_complete/) | 12.0.1.0.0 | Plano de Contas Completo para empresas Simples, Presumido, Real, SA, Consolidação
[l10n_br_coa_generic](l10n_br_coa_generic/) | 12.0.4.1.0 | Plano de Contas para empresas do Regime normal (Micro e pequenas empresas)
Expand All @@ -88,7 +88,7 @@ addon | version | summary
[l10n_br_crm](l10n_br_crm/) | 12.0.1.0.0 | Brazilian Localization CRM
[l10n_br_currency_rate_update](l10n_br_currency_rate_update/) | 12.0.1.0.0 | Update exchange rates using OCA modules for Brazil
[l10n_br_delivery](l10n_br_delivery/) | 12.0.3.0.0 | This module changes the delivery model strategy to match brazilian standards.
[l10n_br_fiscal](l10n_br_fiscal/) | 12.0.13.2.0 | Brazilian fiscal core module.
[l10n_br_fiscal](l10n_br_fiscal/) | 12.0.13.3.0 | Brazilian fiscal core module.
[l10n_br_hr](l10n_br_hr/) | 12.0.1.0.0 | Brazilian Localization HR
[l10n_br_hr_contract](l10n_br_hr_contract/) | 12.0.1.1.0 | Brazilian Localization HR Contract
[l10n_br_mis_report](l10n_br_mis_report/) | 12.0.1.2.0 | Templates de relatórios contábeis brasileiros: Balanço Patrimonial e DRE
Expand All @@ -97,13 +97,14 @@ addon | version | summary
[l10n_br_nfse](l10n_br_nfse/) | 12.0.4.1.0 | NFS-e
[l10n_br_nfse_ginfes](l10n_br_nfse_ginfes/) | 12.0.3.0.0 | NFS-e (Ginfes)
[l10n_br_nfse_issnet](l10n_br_nfse_issnet/) | 12.0.3.0.0 | NFS-e (ISSNet)
[l10n_br_nfse_paulistana](l10n_br_nfse_paulistana/) | 12.0.1.0.0 | NFS-e (Nota Paulistana)
[l10n_br_portal](l10n_br_portal/) | 12.0.1.2.0 | Campos Brasileiros no Portal
[l10n_br_purchase](l10n_br_purchase/) | 12.0.4.3.0 | Brazilian Localization Purchase
[l10n_br_purchase_stock](l10n_br_purchase_stock/) | 12.0.2.0.0 | Brazilian Localization Purchase Stock
[l10n_br_repair](l10n_br_repair/) | 12.0.5.1.0 | Brazilian Localization Repair
[l10n_br_resource](l10n_br_resource/) | 12.0.1.1.0 | This module extend core resource to create important brazilian informations. Define a Brazilian calendar and some tools to compute dates used in financial and payroll modules
[l10n_br_sale](l10n_br_sale/) | 12.0.5.3.0 | Brazilian Localization Sale
[l10n_br_sale_stock](l10n_br_sale_stock/) | 12.0.5.2.2 | Brazilian Localization Sales and Warehouse
[l10n_br_sale](l10n_br_sale/) | 12.0.5.4.0 | Brazilian Localization Sale
[l10n_br_sale_stock](l10n_br_sale_stock/) | 12.0.5.3.0 | Brazilian Localization Sales and Warehouse
[l10n_br_stock](l10n_br_stock/) | 12.0.1.0.0 | Brazilian Localization Warehouse
[l10n_br_stock_account](l10n_br_stock_account/) | 12.0.4.0.0 | Brazilian Localization WMS Accounting
[l10n_br_website_sale](l10n_br_website_sale/) | 12.0.1.2.0 | Website sale localização brasileira.
Expand Down
2 changes: 1 addition & 1 deletion l10n_br_account/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"category": "Localisation",
"license": "AGPL-3",
"author": "Akretion, Odoo Community Association (OCA)",
"website": "http://github.com/OCA/l10n-brazil",
"website": "https://github.com/OCA/l10n-brazil",
"version": "12.0.5.1.0",
"depends": ["account_cancel", "l10n_br_coa", "l10n_br_fiscal"],
"data": [
Expand Down
12 changes: 6 additions & 6 deletions l10n_br_account/i18n/l10n_br_account.pot
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ msgid "Document Type"
msgstr ""

#. module: l10n_br_account
#: code:addons/l10n_br_account/wizards/account_invoice_refund.py:70
#: code:addons/l10n_br_account/wizards/account_invoice_refund.py:69
#, python-format
msgid "Document line without Operation !"
msgstr ""

#. module: l10n_br_account
#: code:addons/l10n_br_account/wizards/account_invoice_refund.py:40
#: code:addons/l10n_br_account/wizards/account_invoice_refund.py:39
#, python-format
msgid "Document without Operation !"
msgstr ""
Expand Down Expand Up @@ -221,8 +221,8 @@ msgid "Fiscal Operation Line"
msgstr ""

#. module: l10n_br_account
#: code:addons/l10n_br_account/wizards/account_invoice_refund.py:48
#: code:addons/l10n_br_account/wizards/account_invoice_refund.py:77
#: code:addons/l10n_br_account/wizards/account_invoice_refund.py:47
#: code:addons/l10n_br_account/wizards/account_invoice_refund.py:76
#, python-format
msgid "Fiscal Operation: There is not Return Operation for %s !"
msgstr ""
Expand Down Expand Up @@ -457,13 +457,13 @@ msgid "You can find a contact by its Name, TIN, Email or Internal Reference."
msgstr ""

#. module: l10n_br_account
#: code:addons/l10n_br_account/models/account_invoice.py:426
#: code:addons/l10n_br_account/models/account_invoice.py:413
#, python-format
msgid "You can't set this document number: {} to draft because this document is cancelled in SEFAZ"
msgstr ""

#. module: l10n_br_account
#: code:addons/l10n_br_account/models/fiscal_document.py:27
#: code:addons/l10n_br_account/models/fiscal_document.py:26
#, python-format
msgid "You cannot delete a fiscal document which is not draft state."
msgstr ""
Expand Down
19 changes: 0 additions & 19 deletions l10n_br_account/models/account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,10 @@ class AccountInvoice(models.Model):
stored=True,
)

@api.multi
def _get_amount_lines(self):
"""Get object lines instaces used to compute fields"""
return self.mapped('invoice_line_ids')

@api.multi
@api.depends('move_id.line_ids', 'move_id.state')
def _compute_financial(self):
for invoice in self:
Expand All @@ -125,15 +123,13 @@ def _shadowed_fields(self):
from the parent."""
return SHADOWED_FIELDS

@api.multi
def _prepare_shadowed_fields_dict(self, default=False):
self.ensure_one()
vals = self._convert_to_write(self.read(self._shadowed_fields())[0])
if default: # in case you want to use new rather than write later
return {'default_%s' % (k,): vals[k] for k in vals.keys()}
return vals

@api.multi
def _write_shadowed_fields(self):
dummy_doc = self.env.ref('l10n_br_fiscal.fiscal_document_dummy')
for invoice in self:
Expand Down Expand Up @@ -201,21 +197,18 @@ def create(self, values):
invoice._write_shadowed_fields()
return invoice

@api.multi
def write(self, values):
result = super().write(values)
self._write_shadowed_fields()
return result

@api.multi
def unlink(self):
"""Allows delete a draft or cancelled invoices"""
self.filtered(lambda i: i.state in ('draft', 'cancel')).write(
{'move_name': False}
)
return super().unlink()

@api.multi
@api.returns('self', lambda value: value.id)
def copy(self, default=None):
default = default or {}
Expand Down Expand Up @@ -294,7 +287,6 @@ def tax_line_move_line_get(self):
# new_tax_lines_dict.append(new_tax)
return tax_lines_dict

@api.multi
def finalize_invoice_move_lines(self, move_lines):
lines = super().finalize_invoice_move_lines(move_lines)
dummy_doc = self.env.ref('l10n_br_fiscal.fiscal_document_dummy')
Expand All @@ -316,7 +308,6 @@ def finalize_invoice_move_lines(self, move_lines):
count += 1
return lines

@api.multi
def get_taxes_values(self):
# uncomment these lines
# dummy_doc = self.env.ref('l10n_br_fiscal.fiscal_document_dummy')
Expand Down Expand Up @@ -372,7 +363,6 @@ def _onchange_fiscal_operation_id(self):
if self.fiscal_operation_id and self.fiscal_operation_id.journal_id:
self.journal_id = self.fiscal_operation_id.journal_id

@api.multi
def open_fiscal_document(self):
if self.env.context.get('type', '') == 'out_invoice':
action = self.env.ref(
Expand All @@ -394,7 +384,6 @@ def open_fiscal_document(self):
action['res_id'] = self.id
return action

@api.multi
def action_date_assign(self):
"""Usamos esse método para definir a data de emissão do documento
fiscal e numeração do documento fiscal para ser usado nas linhas
Expand All @@ -407,15 +396,13 @@ def action_date_assign(self):
invoice.fiscal_document_id._document_date()
invoice.fiscal_document_id._document_number()

@api.multi
def action_move_create(self):
result = super().action_move_create()
dummy_doc = self.env.ref('l10n_br_fiscal.fiscal_document_dummy')
self.mapped('fiscal_document_id').filtered(
lambda d: d != dummy_doc).action_document_confirm()
return result

@api.multi
def action_invoice_draft(self):
dummy_doc = self.env.ref('l10n_br_fiscal.fiscal_document_dummy')
for i in self.filtered(lambda d: d.fiscal_document_id != dummy_doc):
Expand All @@ -429,7 +416,6 @@ def action_invoice_draft(self):
i.fiscal_document_id.action_document_back2draft()
return super().action_invoice_draft()

@api.multi
def action_document_send(self):
dummy_doc = self.env.ref('l10n_br_fiscal.fiscal_document_dummy')
invoices = self.filtered(lambda d: d.fiscal_document_id != dummy_doc)
Expand All @@ -438,25 +424,21 @@ def action_document_send(self):
for invoice in invoices:
invoice.move_id.post(invoice=invoice)

@api.multi
def action_document_cancel(self):
dummy_doc = self.env.ref('l10n_br_fiscal.fiscal_document_dummy')
for i in self.filtered(lambda d: d.fiscal_document_id != dummy_doc):
return i.fiscal_document_id.action_document_cancel()

@api.multi
def action_document_correction(self):
dummy_doc = self.env.ref('l10n_br_fiscal.fiscal_document_dummy')
for i in self.filtered(lambda d: d.fiscal_document_id != dummy_doc):
return i.fiscal_document_id.action_document_correction()

@api.multi
def action_document_invalidate(self):
dummy_doc = self.env.ref('l10n_br_fiscal.fiscal_document_dummy')
for i in self.filtered(lambda d: d.fiscal_document_id != dummy_doc):
return i.fiscal_document_id.action_document_invalidate()

@api.multi
def action_document_back2draft(self):
"""Sets fiscal document to draft state and cancel and set to draft
the related invoice for both documents remain equivalent state."""
Expand All @@ -465,7 +447,6 @@ def action_document_back2draft(self):
i.action_cancel()
i.action_invoice_draft()

@api.multi
def action_invoice_cancel(self):
dummy_doc = self.env.ref('l10n_br_fiscal.fiscal_document_dummy')
for i in self.filtered(lambda d: d.fiscal_document_id != dummy_doc):
Expand Down
3 changes: 0 additions & 3 deletions l10n_br_account/models/account_invoice_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ def _shadowed_fields(self):
from the parent."""
return SHADOWED_FIELDS

@api.multi
def _prepare_shadowed_fields_dict(self, default=False):
self.ensure_one()
vals = self._convert_to_write(self.read(self._shadowed_fields())[0])
Expand Down Expand Up @@ -203,7 +202,6 @@ def create(self, values):
line.fiscal_document_line_id.write(shadowed_fiscal_vals)
return line

@api.multi
def write(self, values):
dummy_line = self.env.ref('l10n_br_fiscal.fiscal_document_line_dummy')
if values.get('invoice_id'):
Expand All @@ -217,7 +215,6 @@ def write(self, values):
line.fiscal_document_line_id.write(shadowed_fiscal_vals)
return result

@api.multi
def unlink(self):
dummy_doc_line_id = self.env.ref(
'l10n_br_fiscal.fiscal_document_line_dummy').id
Expand Down
3 changes: 1 addition & 2 deletions l10n_br_account/models/account_move.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2021 - TODAY Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import api, models
from odoo import models

from odoo.addons.l10n_br_fiscal.constants.fiscal import (
SITUACAO_EDOC_AUTORIZADA,
Expand All @@ -12,7 +12,6 @@
class AccountMove(models.Model):
_inherit = 'account.move'

@api.multi
def post(self, invoice=False):
dummy_doc = self.env.ref('l10n_br_fiscal.fiscal_document_dummy')
result = super().post(invoice)
Expand Down
3 changes: 1 addition & 2 deletions l10n_br_account/models/account_tax.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2009 - TODAY Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import api, fields, models
from odoo import fields, models


class AccountTax(models.Model):
Expand All @@ -15,7 +15,6 @@ class AccountTax(models.Model):
string='Fiscal Taxes',
)

@api.multi
def compute_all(
self,
price_unit,
Expand Down
3 changes: 1 addition & 2 deletions l10n_br_account/models/account_tax_template.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2013 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import api, fields, models
from odoo import fields, models


class AccountTaxTemplate(models.Model):
Expand All @@ -15,7 +15,6 @@ class AccountTaxTemplate(models.Model):
string='Fiscal Taxes',
)

@api.multi
def _generate_tax(self, company):
mapping = super()._generate_tax(company)
taxes_template = self.browse(mapping.get('tax_template_to_tax').keys())
Expand Down
3 changes: 1 addition & 2 deletions l10n_br_account/models/fiscal_document.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (C) 2009 - TODAY Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import _, api, models, fields
from odoo import _, models, fields
from odoo.exceptions import UserError

from odoo.addons.l10n_br_fiscal.constants.fiscal import (
Expand All @@ -18,7 +18,6 @@ class FiscalDocument(models.Model):
string="Invoices",
)

@api.multi
def unlink(self):
non_draft_documents = self.filtered(
lambda d: d.state != SITUACAO_EDOC_EM_DIGITACAO)
Expand Down
5 changes: 1 addition & 4 deletions l10n_br_account/models/fiscal_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (C) 2019 - TODAY Raphaël Valyi - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import api, fields, models
from odoo import fields, models
from odoo.addons.account.models.account_invoice import TYPE2JOURNAL

FISCAL_TYPE_INVOICE = {
Expand Down Expand Up @@ -34,7 +34,6 @@ class Operation(models.Model):
company_dependent=True,
)

@api.multi
def _change_action_view(self, action):
fiscal_op_type = action.get('context')
if fiscal_op_type == 'out':
Expand All @@ -57,7 +56,6 @@ def _change_action_view(self, action):
new_action['domain'] = action.get('domain', {})
return new_action.read()[0]

@api.multi
def action_create_new(self):
action = super().action_create_new()
action['res_model'] = 'account.invoice'
Expand All @@ -66,7 +64,6 @@ def action_create_new(self):
action['context'] = self._change_action_view(action)['context']
return action

@api.multi
def open_action(self):
action = super().open_action()
return self._change_action_view(action)
Expand Down
4 changes: 0 additions & 4 deletions l10n_br_account/models/fiscal_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
class FiscalTax(models.Model):
_inherit = 'l10n_br_fiscal.tax'

@api.multi
def account_taxes(self, user_type='sale'):
account_taxes = self.env['account.tax']
for fiscal_tax in self:
Expand All @@ -16,7 +15,6 @@ def account_taxes(self, user_type='sale'):
lambda t: t.type_tax_use == user_type and t.active)
return account_taxes

@api.multi
def _account_taxes(self):
self.ensure_one()
account_tax_group = self.tax_group_id.account_tax_group()
Expand All @@ -25,7 +23,6 @@ def _account_taxes(self):
('active', '=', True)]
)

@api.multi
def _create_account_tax(self):
for fiscal_tax in self:
account_taxes = fiscal_tax._account_taxes()
Expand Down Expand Up @@ -54,7 +51,6 @@ def create(self, values):
fiscal_taxes._create_account_tax()
return fiscal_taxes

@api.multi
def unlink(self):
for fiscal_tax in self:
account_taxes = fiscal_tax._account_taxes()
Expand Down
3 changes: 1 addition & 2 deletions l10n_br_account/models/fiscal_tax_group.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Copyright (C) 2009 - TODAY Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import api, models
from odoo import models


class FiscalTaxGroup(models.Model):
_inherit = 'l10n_br_fiscal.tax.group'

@api.multi
def account_tax_group(self):
self.ensure_one()
return self.env['account.tax.group'].search(
Expand Down
Loading

0 comments on commit 4d0a2ed

Please sign in to comment.