Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

15.0 add a atribute to describe the service code #1190

Open
wants to merge 2 commits into
base: 15.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions l10n_br_account/models/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class ProductTemplate(models.Model):
'account.ncm', string="Classificação Fiscal (NCM)")
service_type_id = fields.Many2one('account.service.type', 'Tipo de Serviço')
service_code = fields.Char(string='Código no Município')
service_code_description = fields.Char(string='Descrição Código do Município')

l10n_br_cest = fields.Char(string="CEST", size=10, help="Código Especificador da Substituição Tributária")
l10n_br_fiscal_category_id = fields.Many2one('product.fiscal.category', string='Categoria Fiscal')
Expand Down
1 change: 1 addition & 0 deletions l10n_br_account/views/product.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<field name="l10n_br_fiscal_benefit" attrs="{'invisible': [('type', '=', 'service')]}" />
<field name="service_type_id" attrs="{'invisible': [('type', '!=', 'service')]}" domain="[('internal_type', '=', 'normal')]"/>
<field name="service_code" attrs="{'invisible': [('type', '!=', 'service')]}" />
<field name="service_code_description" attrs="{'invisible': [('type', '!=', 'service')]}" />
</group>
</group>
</field>
Expand Down
1 change: 1 addition & 0 deletions l10n_br_eletronic_document/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ def get_eletronic_line_vals(self):
# - ISS -
'item_lista_servico': self.product_id.service_type_id.code,
'codigo_servico_municipio': self.product_id.service_code,
'descricao_codigo_municipio': self.product_id.service_code_description,
'iss_aliquota': iss.amount or 0,
'iss_base_calculo': self.price_subtotal if iss.amount else 0,
'iss_valor': round(self.price_subtotal * iss.amount / 100, 2),
Expand Down
3 changes: 3 additions & 0 deletions l10n_br_eletronic_document/models/eletronic_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,7 @@ def generate_dict_values(self):
'codigo_servico': line.item_lista_servico,
'cnae_servico': line.codigo_cnae,
'codigo_servico_municipio': line.codigo_servico_municipio,
'descricao_codigo_municipio': line.descricao_codigo_municipio,
'aliquota': aliquota,
'base_calculo': round(line.iss_base_calculo, 2),
'valor_unitario': unitario,
Expand Down Expand Up @@ -1068,6 +1069,8 @@ class EletronicDocumentLine(models.Model):
string="Código do serviço", size=10, readonly=True, states=STATE)
codigo_servico_municipio = fields.Char(
string='Código NFSe', size=20, readonly=True, states=STATE)
descricao_codigo_municipio = fields.Char(
string='Descrição Código Serviço', size=100, readonly=True, states=STATE)
# Florianopolis
codigo_cnae = fields.Char(string="CNAE", size=10,
readonly=True, states=STATE)
Expand Down
7 changes: 6 additions & 1 deletion l10n_br_eletronic_document/reports/danfse_bh.xml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,12 @@
</div>
<div class="col-12">
<span t-field="doc.document_line_ids[0].codigo_servico_municipio" /> -
<span t-field="doc.document_line_ids[0].product_id.service_type_id.name" />
<t t-if="doc.document_line_ids[0].descricao_codigo_municipio">
<span t-field="doc.document_line_ids[0].descricao_codigo_municipio"/>
</t>
<t t-else="">
<span t-field="doc.document_line_ids[0].product_id.service_type_id.name"/>
</t>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<group>
<field name="item_lista_servico" />
<field name="codigo_servico_municipio" />

<field name="descricao_codigo_municipio" />
<field name="codigo_cnae" />
<field name="codigo_servico_paulistana_nome" />
</group>
Expand Down