Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[IMP] 完善 tax_invoice_in 测试数据
  • Loading branch information
USI-SHRD committed Jun 13, 2018
1 parent 5d8d16b commit 2fc1ffd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tax_invoice_in/models/tax_invoice_in.py
Expand Up @@ -58,9 +58,9 @@ def _compute_tax_amount(self):
total = 0
for line in self.line_ids:
if line.is_deductible:
total = total + 0
total += 0
else:
total = total +line.invoice_tax
total = total + line.invoice_tax
self.tax_amount = total

#由发票生成采购订单
Expand Down Expand Up @@ -101,7 +101,7 @@ def tax_invoice_draft(self):
def tax_invoice_done(self):
for line in self.line_ids:
if not line.buy_id:
raise UserError(u'发票号码:%s未下推生成采购订单!'%line.name)
raise UserError(u'发票号码:%s未下推生成采购订单!' % line.name)
self.state = 'done'


Expand All @@ -125,7 +125,7 @@ def create_cn_account_invoice(self):
table = xls_data.sheets()[0]
ncows = table.nrows
ncols = 0
colnames = table.row_values(0)
colnames = table.row_values(0)
list =[]
#数据读入,过滤没有开票日期的行
for rownum in range(1,ncows):
Expand Down
Binary file modified tax_invoice_in/tests/201805_3.xls
Binary file not shown.
9 changes: 9 additions & 0 deletions tax_invoice_in/tests/test_tax_invoice_in.py
Expand Up @@ -42,6 +42,15 @@ def test_invoice_to_buy(self):
self.env.ref('core.supplier_category_1').id)
self.tax_invoice_in.invoice_to_buy()

# test: _compute_tax_amount
for line in self.tax_invoice_in.line_ids:
line.is_deductible = True
break

def test_write(self):
''' Test: Write '''
self.tax_invoice_in.name = self.env.ref('finance.period_201604').id

def test_tax_invoice_done(self):
''' Test: tax_invoice_done '''
self.invoice_wizard.with_context({'active_id': self.tax_invoice_in.id}).create_cn_account_invoice()
Expand Down

0 comments on commit 2fc1ffd

Please sign in to comment.