[IMP] sale_stock: for yml use the new signal_xxx methods instead of trg_validate.
bzr revid: cha@tinyerp.com-20130131061533-ivbzasitl9a2mi04
This commit is contained in:
@@ -23,7 +23,6 @@ from datetime import datetime, timedelta
|
||||
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT, DATETIME_FORMATS_MAP, float_compare
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from openerp.osv import fields, osv
|
||||
from openerp import netsvc
|
||||
from openerp.tools.translate import _
|
||||
|
||||
class sale_shop(osv.osv):
|
||||
|
||||
@@ -17,11 +17,9 @@
|
||||
Now I cancel latest shipment.
|
||||
-
|
||||
!python {model: stock.picking}: |
|
||||
import netsvc
|
||||
delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))])
|
||||
last_delivery_order_id = delivery_orders[0]
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'stock.picking', last_delivery_order_id, 'button_cancel', cr)
|
||||
self.pool.get('stock.picking').signal_button_cancel(cr, uid, [last_delivery_order_id])
|
||||
-
|
||||
I run the scheduler.
|
||||
-
|
||||
@@ -50,11 +48,9 @@
|
||||
To cancel the sale order from Invoice Exception, I have to cancel the invoice of sale order.
|
||||
-
|
||||
!python {model: sale.order}: |
|
||||
import netsvc
|
||||
invoice_ids = self.browse(cr, uid, ref("sale.sale_order_8")).invoice_ids
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
first_invoice_id = invoice_ids[0]
|
||||
wf_service.trg_validate(uid, 'account.invoice', first_invoice_id.id, 'invoice_cancel', cr)
|
||||
self.pool.get('account.invoice').signal_invoice_cancel(cr, uid, [first_invoice_id.id])
|
||||
-
|
||||
I check order status in "Invoice Exception" and related invoice is in cancel state.
|
||||
-
|
||||
|
||||
@@ -132,11 +132,9 @@
|
||||
I open the Invoice.
|
||||
-
|
||||
!python {model: sale.order}: |
|
||||
import netsvc
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
so = self.browse(cr, uid, ref("sale.sale_order_6"))
|
||||
for invoice in so.invoice_ids:
|
||||
wf_service.trg_validate(uid, 'account.invoice', invoice.id, 'invoice_open', cr)
|
||||
self.pool.get('account.invoice').signal_invoice_open(cr, uid, [invoice.id])
|
||||
-
|
||||
I pay the invoice
|
||||
-
|
||||
|
||||
Reference in New Issue
Block a user