Revert "[IMP] addons: use the magic methods signal_XXX() instead of signal_workflow('XXX')"

This reverts commit beea451e54.
This commit is contained in:
Raphael Collet 2014-07-07 11:23:06 +02:00
parent 7a7ac59aef
commit acb1420fb9
38 changed files with 81 additions and 81 deletions

View 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_invoice_open()
refund.signal_workflow('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:

View 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_invoice_open()
record.signal_workflow('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_invoice_cancel()
record.signal_workflow('invoice_cancel')
return {'type': 'ir.actions.act_window_close'}

View 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_open_test()
invoice.signal_workflow('open_test')
return {'type': 'ir.actions.act_window_close'}

View File

@ -144,7 +144,7 @@
-
!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_invoice_open(cr, uid, invoice_ids)
self.pool.get('account.invoice').signal_workflow(cr, uid, invoice_ids, 'invoice_open')
-
I check the Stock Interim account (Received) is debited sucessfully when Invoice validated.
-
@ -166,7 +166,7 @@
!python {model: purchase.order}: |
po = self.browse(cr, uid, ref("purchase_order_001"))
for invoice in po.invoice_ids:
invoice.signal_invoice_open()
invoice.signal_workflow('invoice_open')
-
I pay the invoice.
-
@ -252,7 +252,7 @@
!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_invoice_open(cr, uid, account_invoice)
self.pool.get('account.invoice').signal_workflow(cr, uid, account_invoice, 'invoice_open')
-
I check Income Account is Credited sucessfully when Invoice validated.
-

View File

@ -154,7 +154,7 @@
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_invoice_open(cr, uid, invoice_ids)
self.pool.get('account.invoice').signal_workflow(cr, uid, invoice_ids, 'invoice_open')
-
I check the Stock Interim account (Received) is debited sucessfully when Invoice validated.
-
@ -257,7 +257,7 @@
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_invoice_open(cr, uid, account_invoice)
self.pool.get('account.invoice').signal_workflow(cr, uid, account_invoice, 'invoice_open')
-
I check Income Account is Credited sucessfully when Invoice validated.
-

View File

@ -42,7 +42,7 @@ class TestAccountFollowup(TransactionCase):
'quantity': 5,
'price_unit':200
})]})
self.registry('account.invoice').signal_invoice_open(cr, uid, [self.invoice_id])
self.registry('account.invoice').signal_workflow(cr, uid, [self.invoice_id], 'invoice_open')
self.voucher = self.registry("account.voucher")

View 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_done(cr, uid, ids)
self.signal_workflow(cr, uid, ids, 'done')
return True
def write(self, cr, uid, ids, vals, context=None):

View File

@ -926,7 +926,7 @@ class account_voucher(osv.osv):
return vals
def button_proforma_voucher(self, cr, uid, ids, context=None):
self.signal_proforma_voucher(cr, uid, ids)
self.signal_workflow(cr, uid, ids, 'proforma_voucher')
return {'type': 'ir.actions.act_window_close'}
def proforma_voucher(self, cr, uid, ids, context=None):

View File

@ -182,7 +182,7 @@
-
!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_proforma_voucher(cr, uid, voucher)
self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
-
I check that the move of my first voucher is valid
-
@ -276,7 +276,7 @@
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 1'), ('partner_id', '=', ref('base.res_partner_19'))])
self.signal_proforma_voucher(cr, uid, voucher)
self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
-
I check that the move of my second voucher is valid
-

View File

@ -191,7 +191,7 @@
-
!python {model: account.voucher}: |
voucher = ref('account_voucher_1_case1_payment_rate')
self.signal_proforma_voucher(cr, uid, [voucher])
self.signal_workflow(cr, uid, [voucher], 'proforma_voucher')
-
I check that the move of my first voucher is valid
-

View File

@ -161,7 +161,7 @@
-
!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_proforma_voucher(cr, uid, voucher)
self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
-
I check that the move of my voucher is valid
-
@ -263,7 +263,7 @@
-
!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_proforma_voucher(cr, uid, voucher)
self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
-
I check that my voucher state is posted
-

View File

@ -182,7 +182,7 @@
!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_proforma_voucher(cr, uid, voucher)
self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
-
I check that the move of my voucher is valid
-
@ -257,7 +257,7 @@
!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_proforma_voucher(cr, uid, voucher)
self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
-
I check that my voucher state is posted
-

View File

@ -179,7 +179,7 @@
-
!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_proforma_voucher(cr, uid, voucher)
self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
-
I check that the move of my voucher is valid
-
@ -266,7 +266,7 @@
-
!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_proforma_voucher(cr, uid, voucher)
self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
-
I check that my voucher state is posted
-

View File

@ -141,7 +141,7 @@
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 3'),('partner_id', '=', ref('base.res_partner_19'))])
self.signal_proforma_voucher(cr, uid, voucher)
self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
-
I check that the move of my first voucher is valid
-
@ -228,7 +228,7 @@
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'Second payment: Case 3'), ('partner_id', '=', ref('base.res_partner_19'))])
self.signal_proforma_voucher(cr, uid, voucher)
self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
-
I check that the move of my second voucher is valid

View File

@ -144,7 +144,7 @@
-
!python {model: account.voucher}: |
voucher = self.search(cr, uid, [('name', '=', 'First payment: Case 4'), ('partner_id', '=', ref('base.res_partner_19'))])
self.signal_proforma_voucher(cr, uid, voucher)
self.signal_workflow(cr, uid, voucher, 'proforma_voucher')
-
I check that the move of my voucher is valid

View 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_proforma_voucher()
voucher_id.signal_workflow('proforma_voucher')
-
Finally i will Confirm the state of the invoice is paid

View 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_proforma_voucher()
voucher_id.signal_workflow('proforma_voucher')
-
I check that move lines are reconciled meaning voucher is paid
-

View File

@ -19,7 +19,7 @@
-
!python {model: hr.holidays}: |
self.holidays_reset(cr, uid, [ref('hr_holidays_employee1_cl')])
self.signal_confirm(cr, uid, [ref('hr_holidays_employee1_cl')])
self.signal_workflow(cr, uid, [ref('hr_holidays_employee1_cl')], 'confirm')
-
I validate the holiday request by clicking on "To Approve" button.
-

View 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_validate(cr, self.user_employee_id, [hol1_id])
self.hr_holidays.signal_workflow(cr, self.user_employee_id, [hol1_id], 'validate')
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_validate(cr, self.user_hrmanager_id, [hol1_id])
self.hr_holidays.signal_workflow(cr, self.user_hrmanager_id, [hol1_id], 'validate')
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_validate(cr, self.user_hruser_id, [aloc1_id])
self.hr_holidays.signal_second_validate(cr, self.user_hruser_id, [aloc1_id])
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')
# 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_validate(cr, self.user_hruser_id, [hol2_id])
self.hr_holidays.signal_workflow(cr, self.user_hruser_id, [hol2_id], 'validate')
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_second_validate(cr, self.user_hruser_id, [hol2_id])
self.hr_holidays.signal_workflow(cr, self.user_hruser_id, [hol2_id], 'second_validate')
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_refuse(cr, self.user_hrmanager_id, [hol2_id])
self.hr_holidays.signal_workflow(cr, self.user_hrmanager_id, [hol2_id], 'refuse')
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_reset(cr, self.user_hruser_id, [hol2_id])
self.hr_holidays.signal_workflow(cr, self.user_hruser_id, [hol2_id], 'reset')
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_reset(cr, self.user_hrmanager_id, [hol2_id])
self.hr_holidays.signal_workflow(cr, self.user_hrmanager_id, [hol2_id], 'reset')
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_confirm(cr, self.user_hrmanager_id, [hol2_id])
self.hr_holidays.signal_workflow(cr, self.user_hrmanager_id, [hol2_id], 'confirm')

View 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_hr_verify_sheet(cr, uid, [id_copy])
self.signal_process_sheet(cr, uid, [id_copy])
self.signal_workflow(cr, uid, [id_copy], 'hr_verify_sheet')
self.signal_workflow(cr, uid, [id_copy], 'process_sheet')
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

View File

@ -104,7 +104,7 @@
-
!python {model: hr.payslip}: |
self.cancel_sheet(cr, uid, [ref("hr_payslip_0")], None)
self.signal_draft(cr, uid, [ref("hr_payslip_0")])
self.signal_workflow(cr, uid, [ref("hr_payslip_0")], 'draft')
-
Then I click on the "Confirm" button.
-

View 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_confirm()
sheet.signal_workflow('confirm')
else:
raise osv.except_osv(_('Warning!'), _('Please verify that the total difference of the sheet is lower than %.2f.') %(di,))
return True

View 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_hr_verify_sheet(cr, uid, [slip_id.id])
payslip_pool.signal_process_sheet(cr, uid, [slip_id.id])
payslip_pool.signal_workflow(cr, uid, [slip_id.id], 'hr_verify_sheet')
payslip_pool.signal_workflow(cr, uid, [slip_id.id], 'process_sheet')
slip_ids.append(slip_id.id)
for slip in payslip_pool.browse(cr, uid, slip_ids, context=context):

View 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_invoice_open(cr, uid, invoice_ids)
invoice_pool.signal_workflow(cr, uid, invoice_ids, 'invoice_open')
for id in invoice_ids[-4:]:
pay = invoice_pool.pay_and_reconcile(cr, uid, [id],

View 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_invoice_open()
membership_line.account_invoice_id.signal_workflow('invoice_open')
- |
I'm checking "Current membership state" of "Seagate". It is an "Invoiced Member" or not.

View 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_button_produce(cr, uid, [prod_obj.id])
prod_obj_pool.signal_workflow(cr, uid, [prod_obj.id], 'button_produce')
elif prod_obj.state =='ready':
prod_obj_pool.signal_button_produce(cr, uid, [prod_obj.id])
prod_obj_pool.signal_workflow(cr, uid, [prod_obj.id], 'button_produce')
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_button_produce_done(cr, uid, [oper_obj.production_id.id])
prod_obj_pool.signal_workflow(cr, uid, [oper_obj.production_id.id], 'button_produce_done')
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_button_start_working()
workcenter_line.signal_button_done()
workcenter_line.signal_workflow('button_start_working')
workcenter_line.signal_workflow('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_button_start_working(cr, uid, [prod.workcenter_lines[0].id])
workcenter_pool.signal_workflow(cr, uid, [prod.workcenter_lines[0].id], 'button_start_working')
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_button_cancel(cr, uid, [record.id for record in obj.workcenter_lines])
workcenter_pool.signal_workflow(cr, uid, [record.id for record in obj.workcenter_lines], 'button_cancel')
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_button_start_working(cr, uid, [wc_op_id[0]])
workcenter_pool.signal_workflow(cr, uid, [wc_op_id[0]], 'button_start_working')
if code.start_stop=='done':
workcenter_pool.action_done(cr,uid,wc_op_id)
workcenter_pool.signal_button_done(cr, uid, [wc_op_id[0]])
workcenter_pool.signal_workflow(cr, uid, [wc_op_id[0]], 'button_done')
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_button_pause(cr, uid, [wc_op_id[0]])
workcenter_pool.signal_workflow(cr, uid, [wc_op_id[0]], 'button_pause')
if code.start_stop=='resume':
workcenter_pool.action_resume(cr,uid,wc_op_id)
workcenter_pool.signal_button_resume(cr, uid, [wc_op_id[0]])
workcenter_pool.signal_workflow(cr, uid, [wc_op_id[0]], 'button_resume')
if code.start_stop=='cancel':
workcenter_pool.action_cancel(cr,uid,wc_op_id)
workcenter_pool.signal_button_cancel(cr, uid, [wc_op_id[0]])
workcenter_pool.signal_workflow(cr, uid, [wc_op_id[0]], 'button_cancel')
if not self.check_operation(cr, uid, vals):
return

View File

@ -58,47 +58,47 @@
-
!python {model: mrp.production}: |
order = self.browse(cr, uid, ref("mrp.mrp_production_1"), context=context)
order.workcenter_lines[0].signal_button_start_working()
order.workcenter_lines[0].signal_workflow('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_button_pause()
order.workcenter_lines[0].signal_workflow('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_button_resume()
order.workcenter_lines[0].signal_workflow('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_button_cancel()
order.workcenter_lines[0].signal_workflow('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_button_draft()
order.workcenter_lines[0].signal_button_start_working()
order.workcenter_lines[0].signal_workflow('button_draft')
order.workcenter_lines[0].signal_workflow('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_button_done()
order.workcenter_lines[0].signal_workflow('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_button_start_working()
work_line.signal_button_done()
work_line.signal_workflow('button_start_working')
work_line.signal_workflow('button_done')
-
I check that the production order is now done.

View 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_action_invoice_create(cr, uid, context['active_ids'])
order_obj.signal_workflow(cr, uid, context['active_ids'], 'action_invoice_create')
form_res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_form')
form_id = form_res and form_res[1] or False

View 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_open()
this_record.signal_workflow('open')
context.update(active_id=this_record.id)

View File

@ -36,7 +36,7 @@ class pos_confirm(osv.osv_memory):
todo = False
break
if todo:
order.signal_done()
order.signal_workflow('done')
# Check if there is orders to reconcile their invoices
ids = order_obj.search(cr, uid, [('state','=','invoiced'),('invoice_id.state','=','open')], context=context)

View 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_paid(cr, uid, [active_id])
order_obj.signal_workflow(cr, uid, [active_id], 'paid')
return {'type' : 'ir.actions.act_window_close' }
return self.launch_payment(cr, uid, ids, context=context)

View 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_cashbox_control()
wizard.pos_session_id.signal_workflow('cashbox_control')
return self.open_session_cb(cr, uid, ids, context)
def open_session_cb(self, cr, uid, ids, context=None):

View 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_invoice_open()
invoice.signal_workflow('invoice_open')
-
I check that purchase order is invoiced.
-

View 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_purchase_cancel()
order.signal_workflow('purchase_cancel')
po.requisition_id.tender_done(context=context)
return res

View File

@ -79,7 +79,7 @@
-
!python {model: purchase.order}: |
purchase = self.browse(cr, uid, ref('rfq2'), context=context)
purchase.signal_purchase_confirm()
purchase.signal_workflow('purchase_confirm')
-
I check status of requisition after confirmed best RFQ.

View 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_quotation_sent(cr, uid, ids)
self.signal_workflow(cr, uid, ids, 'quotation_sent')
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_manual_invoice(cr, uid, ids)
self.signal_workflow(cr, uid, ids, 'manual_invoice')
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_invoice_cancel()
inv.signal_workflow('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_order_confirm(cr, uid, ids)
self.signal_workflow(cr, uid, ids, 'order_confirm')
# 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_quotation_sent(cr, uid, [context['default_res_id']])
self.pool.get('sale.order').signal_workflow(cr, uid, [context['default_res_id']], 'quotation_sent')
return super(mail_compose_message, self).send_mail(cr, uid, ids, context=context)

View 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_invoice_cancel()
invoice.signal_workflow('invoice_cancel')
-
I check order status in "Invoice Exception" and related invoice is in cancel state.
-

View 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_invoice_open()
invoice.signal_workflow('invoice_open')
-
I pay the invoice.
-