Initial commit of hr_expense_lead for 11.0

This commit is contained in:
Jared Kipe
2018-05-16 10:08:45 -07:00
parent 85ebbe80d0
commit a6da310548
9 changed files with 104 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
from odoo.tests import common
class TestCheckVendor(common.TransactionCase):
def test_fields(self):
lead = self.env['crm.lead'].create({'name': 'Test Lead'})
expense = self.env['hr.expense'].create({
'name': 'Test Expense',
'product_id': self.env['product.product'].search([('can_be_expensed', '=', True)], limit=1).id,
'unit_amount': 34.0,
})
self.assertFalse(lead.expense_ids)
self.assertEqual(lead.expense_total_amount, 0.0)
expense.lead_id = lead
self.assertTrue(lead.expense_ids)
self.assertEqual(lead.expense_total_amount, 34.0)