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:
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'}
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'}
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'}
-
!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.
-
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.
-
'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")
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):
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):
-
!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
-
-
!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
-
-
!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
-
!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
-
-
!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
-
-
!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
-
!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
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
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
-
-
!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.
-
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')
'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)
_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')
_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')
_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')
'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])
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
-
!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.
-
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
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):
!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],
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.
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:
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):
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):
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):
"""
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):
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
-
!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.
# 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
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)
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)
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)
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):
-
!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.
-
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
-
!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.
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):
# 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)
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'})
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')
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)
!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.
-
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.
-