def test_subtask_log_timesheet(self): """ Test parent task takes into account the timesheets of its sub-tasks. Test Case: ---------- 1) Create parent task 2) Create child/subtask task 3) Enter the 8 hour timesheet in the child task 4) Check subtask Effective hours in parent task """ self.task1.child_ids = [Command.set([self.task2.id])] self.env['account.analytic.line'].create({ 'name': 'FirstTimeSheet', 'project_id': self.project_customer.id, 'task_id': self.task2.id, 'unit_amount': 8.0, 'employee_id': self.empl_employee2.id, }) self.assertEqual( self.task1.subtask_effective_hours, 8, 'Hours Spent on Sub-tasks should be 8 hours in Parent Task') self.task1.child_ids = [Command.clear()]
def _onchange_authorize_payment_method_type(self): if self.authorize_payment_method_type == 'bank_account': self.display_as = _("Bank (powered by Authorize)") self.payment_icon_ids = [Command.clear()] else: self.display_as = _("Credit Card (powered by Authorize)") self.payment_icon_ids = [Command.set([self.env.ref(icon_xml_id).id for icon_xml_id in ( 'payment.payment_icon_cc_maestro', 'payment.payment_icon_cc_mastercard', 'payment.payment_icon_cc_discover', 'payment.payment_icon_cc_diners_club_intl', 'payment.payment_icon_cc_jcb', 'payment.payment_icon_cc_visa', )])]
def button_clear(self): """"删除所有作者""" self.authors = [Command.clear()]