active_model = context.get('active_model', False) or False
active_ids = context.get('active_ids', []) or []
- records = self.pool.get(active_model).browse(cr, uid, active_ids, context=context)
+ records = self.pool[active_model].browse(cr, uid, active_ids, context=context)
- return self._run(cr, uid, ids, records, context=None)
+ return self._run(cr, uid, ids, records, context=context)
def _run(self, cr, uid, ids, records, context=None):
for box in self.browse(cr, uid, ids, context=context):
<field name="model">res.partner</field>
<field name="priority" eval="20"/>
<field name="arch" type="xml">
- <tree string="Customer Followup">
+ <tree string="Customer Followup" create="false" delete="false">
- <field name="name"/>
+ <field name="display_name"/>
<field name="payment_next_action_date"/>
<field name="payment_next_action"/>
<field name="user_id" invisible="1"/>
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]
+ last_delivery_order_id = delivery_orders[-1]
- 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.
-
if coltype in ttypes and colinfo.column._obj not in models:
relation_model_id = model_obj.search(cr, UID_ROOT, [('model','=',coldef._obj)])[0]
relation_model_browse = model_obj.browse(cr, UID_ROOT, relation_model_id, context=context)
- relation_osv = self.pool.get(coldef._obj)
+ relation_osv = self.pool[coldef._obj]
- if coltype == 'one2many':
+ #skip virtual one2many fields (related, ...) as there is no reverse relationship
+ if coltype == 'one2many' and hasattr(coldef, '_fields_id'):
# don't record reverse path if it's not a real m2o (that happens, but rarely)
dest_model_ci = relation_osv._all_columns
reverse_rel = coldef._fields_id