On 05/09/13 17:00 +0200, Sergi Almacellas Abellana wrote:
> Hi devs,
>
> I amb writing a test that creates timesheet_lines but I always get a
> domain error on the work field. That's because I'm not able to save a
> True value on timesheet_available field from work.
>
> Here is a snippet of my code:
>
> work = self.work(company=company, name='Python Programming')
> work.timesheet_available = True #Have tried 1 also
> work.save()
> task = self.project(type='task', work=work.id)
> task.save()
> line = self.line(date=date, employee=employee, work=work,
> hours=1.0, company=company)
> line.save()
>
> The following expcetion is thrown:
>
> UserError: ('UserError', (u'The value of the field "Work" on
> "Timesheet Line" is not valid according to its domain.', ''))
>
>
> Any tips?
I see 2 possibilities:
- work is not a timesheet.work but a project.work
- the date of the line is not compatible with the one on the work
--
Cédric Krier
B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/
pgpqopnt6rIys.pgp
Description: PGP signature
