Skip to content

Commit

Permalink
Included fields to be filled on create invoice from stock moves.
Browse files Browse the repository at this point in the history
  • Loading branch information
renatonlima authored and mbcosta committed Aug 27, 2018
1 parent 7d40426 commit 3acd781
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions l10n_br_stock_account/models/stock_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ def _create_invoice_from_picking(self, picking, vals):
result['fiscal_category_id'] = picking.fiscal_category_id.id
result['fiscal_position'] = picking.fiscal_position.id

if not picking.fiscal_category_id.property_journal.revenue_expense:
result['partner_bank_id'] = False
result['payment_mode_id'] = False
result['payment_term'] = False
result['type_nf_payment'] = '90'
else:
if picking.sale_id and picking.sale_id.payment_mode_id:
result['type_nf_payment'] = (
picking.sale_id.payment_mode_id.type_nf_payment)
else:
result['type_nf_payment'] = '99'

if picking.fiscal_category_id.journal_type in ('sale_refund',
'purchase_refund'):
result['nfe_purpose'] = '4'
Expand Down

0 comments on commit 3acd781

Please sign in to comment.