Skip to content

Commit

Permalink
add fgts fields in voucher
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaGD committed Dec 3, 2018
1 parent 63c367f commit 671ebc6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion br_payment_cnab_voucher/models/account_voucher.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class AccountVoucher(models.Model):
('06', 'DARF Normal'),
('07', 'DARF Simples'),
('08', 'FGTS'),
('09', 'ICMS')],
('09', 'ICMS'),
('10', 'FGTS com Código de Barras')],
string="Tipo de Operação", readonly=True,
states={'draft': [('readonly', False)]})
bank_account_id = fields.Many2one(
Expand All @@ -48,6 +49,11 @@ class AccountVoucher(models.Model):
fine_value = fields.Float(
'Fine Value', readonly=True, states={'draft': [('readonly', False)]})

conec_social_fgts = fields.Char(
string='Lacre Conectividade Social', size=16)
conec_social_dv_fgts = fields.Char(
string='Dígito do Lacre CS', size=9)

_sql_constraints = [
('account_voucher_barcode_uniq', 'unique (barcode)',
_('O código de barras deve ser único!'))
Expand Down
4 changes: 3 additions & 1 deletion br_payment_cnab_voucher/views/account_voucher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
<field name="company_id" position="after">
<field name="payment_mode_id" domain="[('type', '=', 'payable')]" />
<field name="payment_type" invisible="1" />
<field name='conec_social_fgts' attrs="{'invisible': [('payment_type', '!=', '10')]}"/>
<field name='conec_social_dv_fgts' attrs="{'invisible': [('payment_type', '!=', '10')]}"/>
<field name="bank_account_id" attrs="{'invisible': [('payment_type', 'not in', ('01', '02'))]}" domain="[('partner_id', '=', partner_id)]"/>
</field>
<field name="tax_amount" position="before">
<field name="interest_value" widget="monetary"/>
<field name="fine_value" widget="monetary"/>
</field>
<group position="inside">
<h3 attrs="{'invisible': [('payment_type', 'not in', ('03', '04'))]}">
<h3 attrs="{'invisible': [('payment_type', 'not in', ('03', '04', '10'))]}">
<strong><label string="Linha Digitável" /></strong>
<field name="linha_digitavel" />
</h3>
Expand Down

0 comments on commit 671ebc6

Please sign in to comment.