[IMP] addons: use the magic methods signal_XXX() instead of signal_workflow('XXX')
authorRaphael Collet <rco@openerp.com>
Mon, 7 Jul 2014 07:42:27 +0000 (09:42 +0200)
committerRaphael Collet <rco@openerp.com>
Mon, 7 Jul 2014 07:42:27 +0000 (09:42 +0200)
38 files changed:
addons/account/wizard/account_invoice_refund.py
addons/account/wizard/account_invoice_state.py
addons/account/wizard/account_state_open.py
addons/account_anglo_saxon/test/anglo_saxon.yml
addons/account_anglo_saxon/test/anglo_saxon_avg_fifo.yml
addons/account_followup/tests/test_account_followup.py
addons/account_payment/account_payment.py
addons/account_voucher/account_voucher.py
addons/account_voucher/test/case1_usd_usd.yml
addons/account_voucher/test/case1_usd_usd_payment_rate.yml
addons/account_voucher/test/case2_suppl_usd_eur.yml
addons/account_voucher/test/case2_usd_eur_debtor_in_eur.yml
addons/account_voucher/test/case2_usd_eur_debtor_in_usd.yml
addons/account_voucher/test/case3_eur_eur.yml
addons/account_voucher/test/case4_cad_chf.yml
addons/account_voucher/test/sales_payment.yml
addons/account_voucher/test/sales_receipt.yml
addons/hr_holidays/test/test_hr_holiday.yml
addons/hr_holidays/tests/test_holidays_flow.py
addons/hr_payroll/hr_payroll.py
addons/hr_payroll_account/test/hr_payroll_account.yml
addons/hr_timesheet_sheet/hr_timesheet_sheet.py
addons/l10n_in_hr_payroll/l10n_in_hr_payroll.py
addons/membership/membership_demo.yml
addons/membership/test/test_membership.yml
addons/mrp_operations/mrp_operations.py
addons/mrp_operations/test/workcenter_operations.yml
addons/mrp_repair/wizard/make_invoice.py
addons/point_of_sale/point_of_sale.py
addons/point_of_sale/wizard/pos_confirm.py
addons/point_of_sale/wizard/pos_payment.py
addons/point_of_sale/wizard/pos_session_opening.py
addons/purchase/test/process/rfq2order2done.yml
addons/purchase_requisition/purchase_requisition.py
addons/purchase_requisition/test/purchase_requisition.yml
addons/sale/sale.py
addons/sale/test/cancel_order.yml
addons/sale/test/manual_order_policy.yml

index 0d6d739..883a370 100644 (file)
@@ -168,7 +168,7 @@ class account_invoice_refund(osv.osv_memory):
                             to_reconcile_ids.setdefault(line.account_id.id, []).append(line.id)
                         if line.reconcile_id:
                             line.reconcile_id.unlink()
-                    refund.signal_workflow('invoice_open')
+                    refund.signal_invoice_open()
                     refund = inv_obj.browse(cr, uid, refund_id[0], context=context)
                     for tmpline in  refund.move_id.line_id:
                         if tmpline.account_id.id == inv.account_id.id:
index 75b4802..dc2b744 100644 (file)
@@ -39,7 +39,7 @@ class account_invoice_confirm(osv.osv_memory):
         for record in proxy.browse(cr, uid, active_ids, context=context):
             if record.state not in ('draft', 'proforma', 'proforma2'):
                 raise osv.except_osv(_('Warning!'), _("Selected invoice(s) cannot be confirmed as they are not in 'Draft' or 'Pro-Forma' state."))
-            record.signal_workflow('invoice_open')
+            record.signal_invoice_open()
             
         return {'type': 'ir.actions.act_window_close'}
 
@@ -62,7 +62,7 @@ class account_invoice_cancel(osv.osv_memory):
         for record in proxy.browse(cr, uid, active_ids, context=context):
             if record.state in ('cancel','paid'):
                 raise osv.except_osv(_('Warning!'), _("Selected invoice(s) cannot be cancelled as they are already in 'Cancelled' or 'Done' state."))
-            record.signal_workflow('invoice_cancel')
+            record.signal_invoice_cancel()
         return {'type': 'ir.actions.act_window_close'}
 
 
index e622a1e..0c3acdb 100644 (file)
@@ -36,7 +36,7 @@ class account_state_open(osv.osv_memory):
             invoice = proxy.browse(cr, uid, active_ids[0], context=context)
             if invoice.reconciled:
                 raise osv.except_osv(_('Warning!'), _('Invoice is already reconciled.'))
-            invoice.signal_workflow('open_test')
+            invoice.signal_open_test()
         return {'type': 'ir.actions.act_window_close'}
 
 
index c98de7c..ddae478 100644 (file)
 -
   !python {model: purchase.order}: |
     invoice_ids = [x.id for x in self.browse(cr, uid, ref("purchase_order_001")).invoice_ids]
-    self.pool.get('account.invoice').signal_workflow(cr, uid, invoice_ids, 'invoice_open')
+    self.pool.get('account.invoice').signal_invoice_open(cr, uid, invoice_ids)
 -
   I check the Stock Interim account (Received) is debited sucessfully when Invoice validated.
 -
   !python {model: purchase.order}: |
     po = self.browse(cr, uid, ref("purchase_order_001"))
     for invoice in po.invoice_ids:
-      invoice.signal_workflow('invoice_open')
+      invoice.signal_invoice_open()
 -
   I pay the invoice.
 -
   !python {model: stock.picking}: |
     move_name = self.pool.get('stock.picking').browse(cr, uid, ref('stock_picking_out001')).name
     account_invoice = self.pool.get('account.invoice').search(cr, uid, [('origin', '=', move_name)])
-    self.pool.get('account.invoice').signal_workflow(cr, uid, account_invoice, 'invoice_open')
+    self.pool.get('account.invoice').signal_invoice_open(cr, uid, account_invoice)
 -
   I check Income Account is Credited sucessfully when Invoice validated.
 -
index 0344226..8d7dac9 100644 (file)
     invoice_ids = [x.id for x in self.browse(cr, uid, ref("purchase_order_001_fifo")).invoice_ids]
     line_ids = self.pool.get('account.invoice.line').search(cr, uid, [('invoice_id', 'in', invoice_ids)])
     self.pool.get('account.invoice.line').write(cr, uid, line_ids, {'price_unit': 10})
-    self.pool.get('account.invoice').signal_workflow(cr, uid, invoice_ids, 'invoice_open')
+    self.pool.get('account.invoice').signal_invoice_open(cr, uid, invoice_ids)
 -
   I check the Stock Interim account (Received) is debited sucessfully when Invoice validated.
 -
     account_invoice_line = self.pool.get('account.invoice.line').search(cr, uid, [('invoice_id', 'in', account_invoice)])
     self.pool.get('account.invoice.line').write(cr, uid, account_invoice_line, {'invoice_line_tax_id': [(6, 0, [])]})
     self.pool.get('account.invoice').button_reset_taxes(cr, uid, account_invoice)
-    self.pool.get('account.invoice').signal_workflow(cr, uid, account_invoice, 'invoice_open')
+    self.pool.get('account.invoice').signal_invoice_open(cr, uid, account_invoice)
 -
   I check Income Account is Credited sucessfully when Invoice validated.
 -
index 697fb43..10dfe5b 100644 (file)
@@ -42,7 +42,7 @@ class TestAccountFollowup(TransactionCase):
                                                                             'quantity': 5, 
                                                                             'price_unit':200
                                                                                  })]})
-        self.registry('account.invoice').signal_workflow(cr, uid, [self.invoice_id], 'invoice_open')
+        self.registry('account.invoice').signal_invoice_open(cr, uid, [self.invoice_id])
         
         self.voucher = self.registry("account.voucher")
         
index de72960..b7bbabc 100644 (file)
@@ -132,7 +132,7 @@ class payment_order(osv.osv):
 
     def set_done(self, cr, uid, ids, *args):
         self.write(cr, uid, ids, {'date_done': time.strftime('%Y-%m-%d')})
-        self.signal_workflow(cr, uid, ids, 'done')
+        self.signal_done(cr, uid, ids)
         return True
 
     def write(self, cr, uid, ids, vals, context=None):
index 275e002..7e1fe32 100644 (file)
@@ -926,7 +926,7 @@ class account_voucher(osv.osv):
         return vals
 
     def button_proforma_voucher(self, cr, uid, ids, context=None):
-        self.signal_workflow(cr, uid, ids, 'proforma_voucher')
+        self.signal_proforma_voucher(cr, uid, ids)
         return {'type': 'ir.actions.act_window_close'}
 
     def proforma_voucher(self, cr, uid, ids, context=None):
index 84ae118..4426910 100644 (file)
 -
   !python {model: account.voucher}: |
     voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 1 USD/USD'), ('partner_id', '=', ref('base.res_partner_19'))])
-    self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
+    self.signal_proforma_voucher(cr, uid, voucher)
 -
   I check that the move of my first voucher is valid
 -
 -
   !python {model: account.voucher}: |
     voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 1'), ('partner_id', '=', ref('base.res_partner_19'))])
-    self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
+    self.signal_proforma_voucher(cr, uid, voucher)
 -
   I check that the move of my second voucher is valid
 -
index c0aa617..037fc14 100644 (file)
 -
   !python {model: account.voucher}: |
     voucher = ref('account_voucher_1_case1_payment_rate') 
-    self.signal_workflow(cr, uid, [voucher], 'proforma_voucher')
+    self.signal_proforma_voucher(cr, uid, [voucher])
 -
   I check that the move of my first voucher is valid
 -
index 836bee3..c13bfcb 100644 (file)
 -
   !python {model: account.voucher}: |
     voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_19'))])
-    self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
+    self.signal_proforma_voucher(cr, uid, voucher)
 -
   I check that the move of my voucher is valid
 -
 -
   !python {model: account.voucher}: |
     voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR'), ('partner_id', '=', ref('base.res_partner_19'))])
-    self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
+    self.signal_proforma_voucher(cr, uid, voucher)
 -
   I check that my voucher state is posted
 -
index 45c86eb..f523e31 100644 (file)
   !python {model: account.voucher}: |
     from openerp import netsvc
     voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 USD/EUR DR EUR'), ('partner_id', '=', ref('base.res_partner_19'))])
-    self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
+    self.signal_proforma_voucher(cr, uid, voucher)
 -
   I check that the move of my voucher is valid
 -
   !python {model: account.voucher}: |
     from openerp import netsvc
     voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR EUR'), ('partner_id', '=', ref('base.res_partner_19'))])
-    self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
+    self.signal_proforma_voucher(cr, uid, voucher)
 -
   I check that my voucher state is posted
 -
index f353cd8..52c416e 100644 (file)
 -
   !python {model: account.voucher}: |
     voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 2 USD/EUR DR USD'), ('partner_id', '=', ref('base.res_partner_19'))])
-    self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
+    self.signal_proforma_voucher(cr, uid, voucher)
 -
   I check that the move of my voucher is valid
 -
 -
   !python {model: account.voucher}: |
     voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 2 SUPPL USD/EUR DR USD'), ('partner_id', '=', ref('base.res_partner_19'))])
-    self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
+    self.signal_proforma_voucher(cr, uid, voucher)
 -
   I check that my voucher state is posted
 -
index 064b79e..54a8ed0 100644 (file)
 -
   !python {model: account.voucher}: |
     voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 3'),('partner_id', '=', ref('base.res_partner_19'))])
-    self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
+    self.signal_proforma_voucher(cr, uid, voucher)
 -
   I check that the move of my first voucher is valid
 -
 -
   !python {model: account.voucher}: |
     voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 3'), ('partner_id', '=', ref('base.res_partner_19'))])
-    self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
+    self.signal_proforma_voucher(cr, uid, voucher)
 
 -
   I check that the move of my second voucher is valid
index 476a22c..d8136f1 100644 (file)
 -
   !python {model: account.voucher}: |
     voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 4'), ('partner_id', '=', ref('base.res_partner_19'))])
-    self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
+    self.signal_proforma_voucher(cr, uid, voucher)
 
 -
   I check that the move of my voucher is valid
index 7bd0e18..6d1015e 100644 (file)
@@ -68,7 +68,7 @@
     voucher_id = self.browse(cr, uid, id)
     assert (voucher_id.writeoff_amount == 0.0), "Writeoff amount is not 0.0"
     assert (voucher_id.state=='draft'), "Voucher is not in draft state"
-    voucher_id.signal_workflow('proforma_voucher')
+    voucher_id.signal_proforma_voucher()
 
 -
   Finally i will Confirm the state of the invoice is paid
index 9bae2c3..3a84e05 100644 (file)
@@ -69,7 +69,7 @@
     id = self.create(cr, uid, vals)
     voucher_id = self.browse(cr, uid, id)
     assert (voucher_id.state=='draft'), "Voucher is not in draft state"
-    voucher_id.signal_workflow('proforma_voucher')
+    voucher_id.signal_proforma_voucher()
 -
   I check that move lines are reconciled meaning voucher is paid
 -
index 1c00692..7bedd33 100644 (file)
@@ -19,7 +19,7 @@
 -
   !python {model: hr.holidays}: |
      self.holidays_reset(cr, uid, [ref('hr_holidays_employee1_cl')])
-     self.signal_workflow(cr, uid, [ref('hr_holidays_employee1_cl')], 'confirm')
+     self.signal_confirm(cr, uid, [ref('hr_holidays_employee1_cl')])
 -
   I validate the holiday request by clicking on "To Approve" button.
 -
index 96ab20f..1f042ed 100644 (file)
@@ -97,12 +97,12 @@ class TestHolidaysFlow(TestHrHolidaysBase):
         self.assertEqual(hol1.state, 'confirm', 'hr_holidays: newly created leave request should be in confirm state')
 
         # Employee validates its leave request -> should not work
-        self.hr_holidays.signal_workflow(cr, self.user_employee_id, [hol1_id], 'validate')
+        self.hr_holidays.signal_validate(cr, self.user_employee_id, [hol1_id])
         hol1.refresh()
         self.assertEqual(hol1.state, 'confirm', 'hr_holidays: employee should not be able to validate its own leave request')
 
         # HrUser validates the employee leave request
-        self.hr_holidays.signal_workflow(cr, self.user_hrmanager_id, [hol1_id], 'validate')
+        self.hr_holidays.signal_validate(cr, self.user_hrmanager_id, [hol1_id])
         hol1.refresh()
         self.assertEqual(hol1.state, 'validate', 'hr_holidays: validates leave request should be in validate state')
 
@@ -144,8 +144,8 @@ class TestHolidaysFlow(TestHrHolidaysBase):
             'number_of_days_temp': 2,
         })
         # HrUser validates the allocation request
-        self.hr_holidays.signal_workflow(cr, self.user_hruser_id, [aloc1_id], 'validate')
-        self.hr_holidays.signal_workflow(cr, self.user_hruser_id, [aloc1_id], 'second_validate')
+        self.hr_holidays.signal_validate(cr, self.user_hruser_id, [aloc1_id])
+        self.hr_holidays.signal_second_validate(cr, self.user_hruser_id, [aloc1_id])
         # Checks Employee has effectively some days left
         hol_status_2 = self.hr_holidays_status.browse(cr, self.user_employee_id, self.holidays_status_2)
         _check_holidays_status(hol_status_2, 2.0, 0.0, 2.0, 2.0)
@@ -165,13 +165,13 @@ class TestHolidaysFlow(TestHrHolidaysBase):
         _check_holidays_status(hol_status_2, 2.0, 0.0, 2.0, 1.0)
 
         # HrUser validates the first step
-        self.hr_holidays.signal_workflow(cr, self.user_hruser_id, [hol2_id], 'validate')
+        self.hr_holidays.signal_validate(cr, self.user_hruser_id, [hol2_id])
         hol2.refresh()
         self.assertEqual(hol2.state, 'validate1',
                          'hr_holidays: first validation should lead to validate1 state')
 
         # HrUser validates the second step
-        self.hr_holidays.signal_workflow(cr, self.user_hruser_id, [hol2_id], 'second_validate')
+        self.hr_holidays.signal_second_validate(cr, self.user_hruser_id, [hol2_id])
         hol2.refresh()
         self.assertEqual(hol2.state, 'validate',
                          'hr_holidays: second validation should lead to validate state')
@@ -180,7 +180,7 @@ class TestHolidaysFlow(TestHrHolidaysBase):
         _check_holidays_status(hol_status_2, 2.0, 1.0, 1.0, 1.0)
 
         # HrManager finds an error: he refuses the leave request
-        self.hr_holidays.signal_workflow(cr, self.user_hrmanager_id, [hol2_id], 'refuse')
+        self.hr_holidays.signal_refuse(cr, self.user_hrmanager_id, [hol2_id])
         hol2.refresh()
         self.assertEqual(hol2.state, 'refuse',
                          'hr_holidays: refuse should lead to refuse state')
@@ -189,12 +189,12 @@ class TestHolidaysFlow(TestHrHolidaysBase):
         _check_holidays_status(hol_status_2, 2.0, 0.0, 2.0, 2.0)
 
         # Annoyed, HrUser tries to fix its error and tries to reset the leave request -> does not work, only HrManager
-        self.hr_holidays.signal_workflow(cr, self.user_hruser_id, [hol2_id], 'reset')
+        self.hr_holidays.signal_reset(cr, self.user_hruser_id, [hol2_id])
         self.assertEqual(hol2.state, 'refuse',
                          'hr_holidays: hr_user should not be able to reset a refused leave request')
 
         # HrManager resets the request
-        self.hr_holidays.signal_workflow(cr, self.user_hrmanager_id, [hol2_id], 'reset')
+        self.hr_holidays.signal_reset(cr, self.user_hrmanager_id, [hol2_id])
         hol2.refresh()
         self.assertEqual(hol2.state, 'draft',
                          'hr_holidays: resetting should lead to draft state')
@@ -206,4 +206,4 @@ class TestHolidaysFlow(TestHrHolidaysBase):
             'number_of_days_temp': 4,
         })
         with self.assertRaises(except_orm):
-            self.hr_holidays.signal_workflow(cr, self.user_hrmanager_id, [hol2_id], 'confirm')
+            self.hr_holidays.signal_confirm(cr, self.user_hrmanager_id, [hol2_id])
index 4dea994..eead78e 100644 (file)
@@ -323,8 +323,8 @@ class hr_payslip(osv.osv):
         for payslip in self.browse(cr, uid, ids, context=context):
             id_copy = self.copy(cr, uid, payslip.id, {'credit_note': True, 'name': _('Refund: ')+payslip.name}, context=context)
             self.compute_sheet(cr, uid, [id_copy], context=context)
-            self.signal_workflow(cr, uid, [id_copy], 'hr_verify_sheet')
-            self.signal_workflow(cr, uid, [id_copy], 'process_sheet')
+            self.signal_hr_verify_sheet(cr, uid, [id_copy])
+            self.signal_process_sheet(cr, uid, [id_copy])
             
         form_id = mod_obj.get_object_reference(cr, uid, 'hr_payroll', 'view_hr_payslip_form')
         form_res = form_id and form_id[1] or False
index 0dda2f6..c637b5f 100644 (file)
 -
   !python {model: hr.payslip}: |
     self.cancel_sheet(cr, uid, [ref("hr_payslip_0")], None)
-    self.signal_workflow(cr, uid, [ref("hr_payslip_0")], 'draft')
+    self.signal_draft(cr, uid, [ref("hr_payslip_0")])
 -
   Then I click on the "Confirm" button.
 -
index a284517..e872b54 100644 (file)
@@ -123,7 +123,7 @@ class hr_timesheet_sheet(osv.osv):
             self.check_employee_attendance_state(cr, uid, sheet.id, context=context)
             di = sheet.user_id.company_id.timesheet_max_difference
             if (abs(sheet.total_difference) < di) or not di:
-                sheet.signal_workflow('confirm')
+                sheet.signal_confirm()
             else:
                 raise osv.except_osv(_('Warning!'), _('Please verify that the total difference of the sheet is lower than %.2f.') %(di,))
         return True
index 0af3535..7b4e62a 100644 (file)
@@ -192,8 +192,8 @@ class hr_payslip_run(osv.osv):
             slip_ids = []
             for slip_id in run.slip_ids:
                 # TODO is it necessary to interleave the calls ?
-                payslip_pool.signal_workflow(cr, uid, [slip_id.id], 'hr_verify_sheet')
-                payslip_pool.signal_workflow(cr, uid, [slip_id.id], 'process_sheet')
+                payslip_pool.signal_hr_verify_sheet(cr, uid, [slip_id.id])
+                payslip_pool.signal_process_sheet(cr, uid, [slip_id.id])
                 slip_ids.append(slip_id.id)
 
             for slip in payslip_pool.browse(cr, uid, slip_ids, context=context):
index 439666a..e21d70f 100644 (file)
@@ -4,7 +4,7 @@
   !python {model: res.partner}: |
     invoice_ids = self.create_membership_invoice(cr, uid, [ref("base.res_partner_1"),ref("base.res_partner_14"),ref("base.res_partner_24"),ref("base.res_partner_19"),ref("base.res_partner_8"),ref("base.res_partner_5"),ref("base.res_partner_21"),ref("base.res_partner_6"),ref("base.res_partner_16"),ref("base.res_partner_10")], product_id=ref("membership_1"), datas={"amount":80.00})
     invoice_pool = self.pool.get('account.invoice')
-    invoice_pool.signal_workflow(cr, uid, invoice_ids, 'invoice_open')
+    invoice_pool.signal_invoice_open(cr, uid, invoice_ids)
 
     for id in invoice_ids[-4:]:
         pay = invoice_pool.pay_and_reconcile(cr, uid, [id],
index 49c4f64..87273de 100644 (file)
@@ -40,7 +40,7 @@
         membership_lines = membership_line_pool.browse(cr, uid, membership_line_ids)
         assert membership_lines, 'Membership is not registrated.'
         membership_line = membership_lines[0]
-        membership_line.account_invoice_id.signal_workflow('invoice_open')
+        membership_line.account_invoice_id.signal_invoice_open()
 
 - |
   I'm checking "Current membership state" of "Seagate". It is an "Invoiced Member" or not.
index c14b755..afcc40d 100644 (file)
@@ -113,9 +113,9 @@ class mrp_production_workcenter_line(osv.osv):
         if action == 'start':
             if prod_obj.state =='confirmed':
                 prod_obj_pool.force_production(cr, uid, [prod_obj.id])
-                prod_obj_pool.signal_workflow(cr, uid, [prod_obj.id], 'button_produce')
+                prod_obj_pool.signal_button_produce(cr, uid, [prod_obj.id])
             elif prod_obj.state =='ready':
-                prod_obj_pool.signal_workflow(cr, uid, [prod_obj.id], 'button_produce')
+                prod_obj_pool.signal_button_produce(cr, uid, [prod_obj.id])
             elif prod_obj.state =='in_production':
                 return
             else:
@@ -128,7 +128,7 @@ class mrp_production_workcenter_line(osv.osv):
                 for production in prod_obj_pool.browse(cr, uid, [prod_obj.id], context= None):
                     if production.move_lines or production.move_created_ids:
                         prod_obj_pool.action_produce(cr,uid, production.id, production.product_qty, 'consume_produce', context = None)
-                prod_obj_pool.signal_workflow(cr, uid, [oper_obj.production_id.id], 'button_produce_done')
+                prod_obj_pool.signal_button_produce_done(cr, uid, [oper_obj.production_id.id])
         return
 
     def write(self, cr, uid, ids, vals, context=None, update=True):
@@ -216,8 +216,8 @@ class mrp_production(osv.osv):
         workcenter_pool = self.pool.get('mrp.production.workcenter.line')
         for workcenter_line in obj.workcenter_lines:
             if workcenter_line.state == 'draft':
-                workcenter_line.signal_workflow('button_start_working')
-            workcenter_line.signal_workflow('button_done')
+                workcenter_line.signal_button_start_working()
+            workcenter_line.signal_button_done()
         return super(mrp_production,self).action_production_end(cr, uid, ids)
 
     def action_in_production(self, cr, uid, ids):
@@ -227,7 +227,7 @@ class mrp_production(osv.osv):
         workcenter_pool = self.pool.get('mrp.production.workcenter.line')
         for prod in self.browse(cr, uid, ids):
             if prod.workcenter_lines:
-                workcenter_pool.signal_workflow(cr, uid, [prod.workcenter_lines[0].id], 'button_start_working')
+                workcenter_pool.signal_button_start_working(cr, uid, [prod.workcenter_lines[0].id])
         return super(mrp_production,self).action_in_production(cr, uid, ids)
     
     def action_cancel(self, cr, uid, ids, context=None):
@@ -236,7 +236,7 @@ class mrp_production(osv.osv):
         """
         workcenter_pool = self.pool.get('mrp.production.workcenter.line')
         obj = self.browse(cr, uid, ids,context=context)[0]
-        workcenter_pool.signal_workflow(cr, uid, [record.id for record in obj.workcenter_lines], 'button_cancel')
+        workcenter_pool.signal_button_cancel(cr, uid, [record.id for record in obj.workcenter_lines])
         return super(mrp_production,self).action_cancel(cr,uid,ids,context=context)
 
     def _compute_planned_workcenter(self, cr, uid, ids, context=None, mini=False):
@@ -494,24 +494,24 @@ class mrp_operations_operation(osv.osv):
                 wc_op_id.append(workcenter_pool.create(cr,uid,{'production_id':vals['production_id'],'name':production_obj.product_id.name,'workcenter_id':vals['workcenter_id']}))
             if code.start_stop=='start':
                 workcenter_pool.action_start_working(cr,uid,wc_op_id)
-                workcenter_pool.signal_workflow(cr, uid, [wc_op_id[0]], 'button_start_working')
+                workcenter_pool.signal_button_start_working(cr, uid, [wc_op_id[0]])
 
             if code.start_stop=='done':
                 workcenter_pool.action_done(cr,uid,wc_op_id)
-                workcenter_pool.signal_workflow(cr, uid, [wc_op_id[0]], 'button_done')
+                workcenter_pool.signal_button_done(cr, uid, [wc_op_id[0]])
                 self.pool.get('mrp.production').write(cr,uid,vals['production_id'],{'date_finished':datetime.now().strftime('%Y-%m-%d %H:%M:%S')})
 
             if code.start_stop=='pause':
                 workcenter_pool.action_pause(cr,uid,wc_op_id)
-                workcenter_pool.signal_workflow(cr, uid, [wc_op_id[0]], 'button_pause')
+                workcenter_pool.signal_button_pause(cr, uid, [wc_op_id[0]])
 
             if code.start_stop=='resume':
                 workcenter_pool.action_resume(cr,uid,wc_op_id)
-                workcenter_pool.signal_workflow(cr, uid, [wc_op_id[0]], 'button_resume')
+                workcenter_pool.signal_button_resume(cr, uid, [wc_op_id[0]])
 
             if code.start_stop=='cancel':
                 workcenter_pool.action_cancel(cr,uid,wc_op_id)
-                workcenter_pool.signal_workflow(cr, uid, [wc_op_id[0]], 'button_cancel')
+                workcenter_pool.signal_button_cancel(cr, uid, [wc_op_id[0]])
 
         if not self.check_operation(cr, uid, vals):
             return
index a31c3fb..fe96ca0 100644 (file)
 -
   !python {model: mrp.production}: |
     order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context)
-    order.workcenter_lines[0].signal_workflow('button_start_working')
+    order.workcenter_lines[0].signal_button_start_working()
 -
   Now I pause first work operation due to technical fault of work center.
 -
   !python {model: mrp.production}: |
     order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context)
-    order.workcenter_lines[0].signal_workflow('button_pause')
+    order.workcenter_lines[0].signal_button_pause()
 -
   I resume first work operation.
 -
   !python {model: mrp.production}: |
     order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context)
-    order.workcenter_lines[0].signal_workflow('button_resume')
+    order.workcenter_lines[0].signal_button_resume()
     
 -
   I cancel first work operation.
 -
   !python {model: mrp.production}: |
     order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context)
-    order.workcenter_lines[0].signal_workflow('button_cancel')
+    order.workcenter_lines[0].signal_button_cancel()
 -
   I reset first work operation and start after resolving techninal fault of work center.
 -
   !python {model: mrp.production}: |
     order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context)
-    order.workcenter_lines[0].signal_workflow('button_draft')
-    order.workcenter_lines[0].signal_workflow('button_start_working')
+    order.workcenter_lines[0].signal_button_draft()
+    order.workcenter_lines[0].signal_button_start_working()
 -
   I close first work operation as this work center completed its process.
 -
   !python {model: mrp.production}: |
     order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context)
-    order.workcenter_lines[0].signal_workflow('button_done')
+    order.workcenter_lines[0].signal_button_done()
 -
   Now I close other operations one by one which are in start state.
 -
   !python {model: mrp.production}: |
     order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context)
     for work_line in order.workcenter_lines[1:]:
-      work_line.signal_workflow('button_start_working')
-      work_line.signal_workflow('button_done')
+      work_line.signal_button_start_working()
+      work_line.signal_button_done()
 
 -
   I check that the production order is now done.
index e23d6a5..f9c84cb 100644 (file)
@@ -49,7 +49,7 @@ class make_invoice(osv.osv_memory):
         # We have to trigger the workflow of the given repairs, otherwise they remain 'to be invoiced'.
         # Note that the signal 'action_invoice_create' will trigger another call to the method 'action_invoice_create',
         # but that second call will not do anything, since the repairs are already invoiced.
-        order_obj.signal_workflow(cr, uid, context['active_ids'], 'action_invoice_create')
+        order_obj.signal_action_invoice_create(cr, uid, context['active_ids'])
 
         form_res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_form')
         form_id = form_res and form_res[1] or False
index 1eec3cb..1a787ec 100644 (file)
@@ -408,7 +408,7 @@ class pos_session(osv.osv):
             ids = [ids]
 
         this_record = self.browse(cr, uid, ids[0], context=context)
-        this_record.signal_workflow('open')
+        this_record.signal_open()
 
         context.update(active_id=this_record.id)
 
index 909463f..ff4b3f1 100644 (file)
@@ -36,7 +36,7 @@ class pos_confirm(osv.osv_memory):
                     todo = False
                     break
             if todo:
-                order.signal_workflow('done')
+                order.signal_done()
 
         # Check if there is orders to reconcile their invoices
         ids = order_obj.search(cr, uid, [('state','=','invoiced'),('invoice_id.state','=','open')], context=context)
index efd2682..d4c2a3d 100644 (file)
@@ -65,7 +65,7 @@ class pos_make_payment(osv.osv_memory):
             order_obj.add_payment(cr, uid, active_id, data, context=context)
 
         if order_obj.test_paid(cr, uid, [active_id]):
-            order_obj.signal_workflow(cr, uid, [active_id], 'paid')
+            order_obj.signal_paid(cr, uid, [active_id])
             return {'type' : 'ir.actions.act_window_close' }
 
         return self.launch_payment(cr, uid, ids, context=context)
index 5389fb3..8076cbf 100644 (file)
@@ -35,7 +35,7 @@ class pos_session_opening(osv.osv_memory):
 
     def open_existing_session_cb_close(self, cr, uid, ids, context=None):
         wizard = self.browse(cr, uid, ids[0], context=context)
-        wizard.pos_session_id.signal_workflow('cashbox_control')
+        wizard.pos_session_id.signal_cashbox_control()
         return self.open_session_cb(cr, uid, ids, context)
 
     def open_session_cb(self, cr, uid, ids, context=None):
index bf48e33..c032e87 100644 (file)
@@ -59,7 +59,7 @@
 -
   !python {model: purchase.order}: |
     for invoice in self.browse(cr, uid, ref('purchase_order_1'), context=context).invoice_ids:
-      invoice.signal_workflow('invoice_open')
+      invoice.signal_invoice_open()
 -
   I check that purchase order is invoiced.
 -
index a4908f2..d84a25a 100644 (file)
@@ -339,7 +339,7 @@ class purchase_order(osv.osv):
                         proc_ids = proc_obj.search(cr, uid, [('purchase_id', '=', order.id)])
                         if proc_ids and po.state == 'confirmed':
                             proc_obj.write(cr, uid, proc_ids, {'purchase_id': po.id})
-                        order.signal_workflow('purchase_cancel')
+                        order.signal_purchase_cancel()
                     po.requisition_id.tender_done(context=context)
         return res
 
index af5aade..7cb2682 100644 (file)
@@ -79,7 +79,7 @@
 -
   !python {model: purchase.order}: |
     purchase = self.browse(cr, uid, ref('rfq2'), context=context)
-    purchase.signal_workflow('purchase_confirm')
+    purchase.signal_purchase_confirm()
 
 -
   I check status of requisition after confirmed best RFQ.
index 8881e91..9b42109 100644 (file)
@@ -434,7 +434,7 @@ class sale_order(osv.osv):
         This function prints the sales order and mark it as sent, so that we can see more easily the next step of the workflow
         '''
         assert len(ids) == 1, 'This option should only be used for a single id at a time'
-        self.signal_workflow(cr, uid, ids, 'quotation_sent')
+        self.signal_quotation_sent(cr, uid, ids)
         return self.pool['report'].get_action(cr, uid, ids, 'sale.report_saleorder', context=context)
 
     def manual_invoice(self, cr, uid, ids, context=None):
@@ -445,7 +445,7 @@ class sale_order(osv.osv):
         
         # create invoices through the sales orders' workflow
         inv_ids0 = set(inv.id for sale in self.browse(cr, uid, ids, context) for inv in sale.invoice_ids)
-        self.signal_workflow(cr, uid, ids, 'manual_invoice')
+        self.signal_manual_invoice(cr, uid, ids)
         inv_ids1 = set(inv.id for sale in self.browse(cr, uid, ids, context) for inv in sale.invoice_ids)
         # determine newly created invoices
         new_inv_ids = list(inv_ids1 - inv_ids0)
@@ -580,7 +580,7 @@ class sale_order(osv.osv):
                     raise osv.except_osv(
                         _('Cannot cancel this sales order!'),
                         _('First cancel all invoices attached to this sales order.'))
-                inv.signal_workflow('invoice_cancel')
+                inv.signal_invoice_cancel()
             sale_order_line_obj.write(cr, uid, [l.id for l in  sale.order_line],
                     {'state': 'cancel'})
         self.write(cr, uid, ids, {'state': 'cancel'})
@@ -588,7 +588,7 @@ class sale_order(osv.osv):
 
     def action_button_confirm(self, cr, uid, ids, context=None):
         assert len(ids) == 1, 'This option should only be used for a single id at a time.'
-        self.signal_workflow(cr, uid, ids, 'order_confirm')
+        self.signal_order_confirm(cr, uid, ids)
 
         # redisplay the record as a sales order
         view_ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'sale', 'view_order_form')
@@ -1205,7 +1205,7 @@ class mail_compose_message(osv.Model):
         context = context or {}
         if context.get('default_model') == 'sale.order' and context.get('default_res_id') and context.get('mark_so_as_sent'):
             context = dict(context, mail_post_autofollow=True)
-            self.pool.get('sale.order').signal_workflow(cr, uid, [context['default_res_id']], 'quotation_sent')
+            self.pool.get('sale.order').signal_quotation_sent(cr, uid, [context['default_res_id']])
         return super(mail_compose_message, self).send_mail(cr, uid, ids, context=context)
 
 
index 268e1ce..1615531 100644 (file)
@@ -58,7 +58,7 @@
   !python {model: sale.order}: |
     invoice_ids = self.browse(cr, uid, ref("sale_order_8")).invoice_ids
     for invoice in invoice_ids:
-      invoice.signal_workflow('invoice_cancel')
+      invoice.signal_invoice_cancel()
 -
   I check order status in "Invoice Exception" and related invoice is in cancel state.
 -
index d2a1ff0..ab00b5f 100644 (file)
@@ -44,7 +44,7 @@
     so = self.browse(cr, uid, ref("sale_order_2"))
     account_invoice_obj = self.pool.get('account.invoice')
     for invoice in so.invoice_ids:
-      invoice.signal_workflow('invoice_open')
+      invoice.signal_invoice_open()
 -
   I pay the invoice.
 -