bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] account_ids = [int(str(x/max_user - (x%max_user == 0 and 1 or 0))) for x in ids] user_ids = [int(str(x-((x/max_user - (x%max_user == 0 and 1 or 0)) *max_user))) for x in ids] parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) if parent_ids: cr.execute('SELECT id, unit_amount ' \ 'FROM account_analytic_analysis_summary_user ' \ 'WHERE account_id IN %s ' \ 'AND "user" IN %s',(parent_ids, user_ids,)) for sum_id, unit_amount in cr.fetchall(): res[sum_id] = unit_amount for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in account_obj.search(cr, uid, [('parent_id', 'child_of', [int(str(obj_id/max_user - (obj_id%max_user == 0 and 1 or 0)))])]): if child_id != int(str(obj_id/max_user - (obj_id%max_user == 0 and 1 or 0))): res[obj_id] += res.get((child_id * max_user) + obj_id -((obj_id/max_user - (obj_id%max_user == 0 and 1 or 0)) * max_user), 0.0) for id in ids: res[id] = round(res.get(id, 0.0), 2) return res
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] account_ids = [int(str(x/max_user - (x%max_user == 0 and 1 or 0))) for x in ids] user_ids = [int(str(x-((x/max_user - (x%max_user == 0 and 1 or 0)) *max_user))) for x in ids] parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) if parent_ids: cr.execute('SELECT id, unit_amount ' \ 'FROM account_analytic_analysis_summary_user ' \ 'WHERE account_id IN %s ' \ 'AND "user" IN %s',(parent_ids, user_ids,)) for sum_id, unit_amount in cr.fetchall(): res[sum_id] = unit_amount for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in account_obj.search(cr, uid, [('parent_id', 'child_of', [int(str(obj_id/max_user - (obj_id%max_user == 0 and 1 or 0)))])]): if child_id != int(str(obj_id/max_user - (obj_id%max_user == 0 and 1 or 0))): res[obj_id] += res.get((child_id * max_user) + obj_id -((obj_id/max_user - (obj_id%max_user == 0 and 1 or 0)) * max_user), 0.0) for id in ids: res[id] = round(res.get(id, 0.0), 2) return res
469,300
def _read_flat(self, cr, user, ids, fields, context=None, load='_classic_read'): if not context: context={} if not ids: return []
def _read_flat(self, cr, user, ids, fields, context=None, load='_classic_read'): if not context: context={} if not ids: return []
469,301
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') account_ids = [int(str(int(x))[:-6]) for x in ids] month_ids = [int(str(int(x))[-6:]) for x in ids] parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) if parent_ids: cr.execute('SELECT id, unit_amount ' \ 'FROM account_analytic_analysis_summary_month ' \ 'WHERE account_id IN %s ' \ 'AND month_id IN %s ',(parent_ids, month_ids,)) for sum_id, unit_amount in cr.fetchall(): res[sum_id] = unit_amount for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in account_obj.search(cr, uid, [('parent_id', 'child_of', [int(str(int(obj_id))[:-6])])]): if child_id != int(str(int(obj_id))[:-6]): res[obj_id] += res.get(int(child_id * 1000000 + int(str(int(obj_id))[-6:])), 0.0) for id in ids: res[id] = round(res.get(id, 0.0), 2) return res
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') account_ids = [int(str(int(x))[:-6]) for x in ids] month_ids = [int(str(int(x))[-6:]) for x in ids] parent_ids = tuple(account_obj.search(cr, uid, [('parent_id', 'child_of', account_ids)])) if parent_ids: cr.execute('SELECT id, unit_amount ' \ 'FROM account_analytic_analysis_summary_month ' \ 'WHERE account_id IN %s ' \ 'AND month_id IN %s ',(parent_ids, month_ids,)) for sum_id, unit_amount in cr.fetchall(): res[sum_id] = unit_amount for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in account_obj.search(cr, uid, [('parent_id', 'child_of', [int(str(int(obj_id))[:-6])])]): if child_id != int(str(int(obj_id))[:-6]): res[obj_id] += res.get(int(child_id * 1000000 + int(str(int(obj_id))[-6:])), 0.0) for id in ids: res[id] = round(res.get(id, 0.0), 2) return res
469,302
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') account_ids = [int(str(int(x))[:-6]) for x in ids] month_ids = [int(str(int(x))[-6:]) for x in ids] parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) if parent_ids: cr.execute('SELECT id, unit_amount ' \ 'FROM account_analytic_analysis_summary_month ' \ 'WHERE account_id IN %s ' \ 'AND month_id IN %s ',(parent_ids, month_ids,)) for sum_id, unit_amount in cr.fetchall(): res[sum_id] = unit_amount for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in account_obj.search(cr, uid, [('parent_id', 'child_of', [int(str(int(obj_id))[:-6])])]): if child_id != int(str(int(obj_id))[:-6]): res[obj_id] += res.get(int(child_id * 1000000 + int(str(int(obj_id))[-6:])), 0.0) for id in ids: res[id] = round(res.get(id, 0.0), 2) return res
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') account_ids = [int(str(int(x))[:-6]) for x in ids] month_ids = [int(str(int(x))[-6:]) for x in ids] parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) if parent_ids: cr.execute('SELECT id, unit_amount ' \ 'FROM account_analytic_analysis_summary_month ' \ 'WHERE account_id IN %s ' \ 'AND month_id IN %s ',(parent_ids, tuple(month_ids),)) for sum_id, unit_amount in cr.fetchall(): res[sum_id] = unit_amount for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in account_obj.search(cr, uid, [('parent_id', 'child_of', [int(str(int(obj_id))[:-6])])]): if child_id != int(str(int(obj_id))[:-6]): res[obj_id] += res.get(int(child_id * 1000000 + int(str(int(obj_id))[-6:])), 0.0) for id in ids: res[id] = round(res.get(id, 0.0), 2) return res
469,303
def _read_flat(self, cr, user, ids, fields, context=None, load='_classic_read'): if not context: context={} if not ids: return []
def _read_flat(self, cr, user, ids, fields, context=None, load='_classic_read'): if not context: context={} if not ids: return []
469,304
def _read_flat(self, cr, user, ids, fields, context=None, load='_classic_read'): if not context: context={} if not ids: return []
def _read_flat(self, cr, user, ids, fields, context=None, load='_classic_read'): if not context: context={} if not ids: return []
469,305
def rg(ids, table, parent): if not ids: return [] ids2 = table.search(cr, uid, [(parent, 'in', ids)], context=context) return ids + rg(ids2, table, parent)
def rg(ids, table, parent): if not ids: return [] ids2 = table.search(cr, uid, [(parent, 'in', ids)], context=context) return ids + rg(ids2, table, parent)
469,306
def rg(ids, table, parent): if not ids: return [] ids2 = table.search(cr, uid, [(parent, 'in', ids)], context=context) return ids + rg(ids2, table, parent)
def rg(ids, table, parent): if not ids: return [] ids2 = table.search(cr, uid, [(parent, 'in', ids)], context=context) return ids + rg(ids2, table, parent)
469,307
def action_done(self, cr, uid, ids, context={}): """ Makes the move done and if all moves are done, it will finish the picking. @return: """ track_flag = False picking_ids = [] product_uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') product_obj=self.pool.get('product.product') move_obj = self.pool.get('account.move') for move in self.browse(cr, uid, ids): if move.picking_id: picking_ids.append(move.picking_id.id) if move.move_dest_id.id and (move.state != 'done'): cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)', (move.id, move.move_dest_id.id)) if move.move_dest_id.state in ('waiting', 'confirmed'): self.write(cr, uid, [move.move_dest_id.id], {'state': 'assigned'}) if move.move_dest_id.picking_id: wf_service = netsvc.LocalService("workflow") wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr) else: pass # self.action_done(cr, uid, [move.move_dest_id.id]) if move.move_dest_id.auto_validate: self.action_done(cr, uid, [move.move_dest_id.id], context=context)
def action_done(self, cr, uid, ids, context={}): """ Makes the move done and if all moves are done, it will finish the picking. @return: """ track_flag = False picking_ids = [] product_uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') product_obj=self.pool.get('product.product') move_obj = self.pool.get('account.move') for move in self.browse(cr, uid, ids): if move.picking_id: picking_ids.append(move.picking_id.id) if move.move_dest_id.id and (move.state != 'done'): cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)', (move.id, move.move_dest_id.id)) if move.move_dest_id.state in ('waiting', 'confirmed'): self.write(cr, uid, [move.move_dest_id.id], {'state': 'assigned'}) if move.move_dest_id.picking_id: wf_service = netsvc.LocalService("workflow") wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr) else: pass # self.action_done(cr, uid, [move.move_dest_id.id]) if move.move_dest_id.auto_validate: self.action_done(cr, uid, [move.move_dest_id.id], context=context)
469,308
def export_data(self, cr, uid, ids, fields_to_export, context=None): if not context: context = {} data_l = self.read(cr, uid, ids, ['sql_query'], context) final_datas = [] #start Loop for i in data_l: datas = [] for key, value in i.items(): if key not in fields_to_export: continue if isinstance(value, tuple): datas.append(str(value[1])) else: datas.append(str(value)) final_datas += [datas] #End Loop return {'datas': final_datas}
def export_data(self, cr, uid, ids, fields_to_export, context=None): if not context: context = {} data_l = self.read(cr, uid, ids, ['sql_query'], context) final_datas = [] #start Loop for i in data_l: datas = [] for key, value in i.items(): if key not in fields_to_export: continue if isinstance(value, tuple): datas.append(ustr(value[1])) else: datas.append(ustr(value)) final_datas += [datas] #End Loop return {'datas': final_datas}
469,309
def _amount_total(self, cr, uid, ids, field_name, arg, context): """ Calculates total amount. @param field_name: Name of field. @param arg: Argument @return: Dictionary of values. """ res = {} untax = self._amount_untaxed(cr, uid, ids, field_name, arg, context) tax = self._amount_tax(cr, uid, ids, field_name, arg, context) cur_obj = self.pool.get('res.currency') for id in ids: repair = self.browse(cr, uid, [id])[0] cur = repair.pricelist_id.currency_id res[id] = cur_obj.round(cr, uid, cur, untax.get(id, 0.0) + tax.get(id, 0.0)) return res
def _amount_total(self, cr, uid, ids, field_name, arg, context): """ Calculates total amount. @param field_name: Name of field. @param arg: Argument @return: Dictionary of values. """ res = {} untax = self._amount_untaxed(cr, uid, ids, field_name, arg, context) tax = self._amount_tax(cr, uid, ids, field_name, arg, context) cur_obj = self.pool.get('res.currency') for id in ids: repair = self.browse(cr, uid, [id])[0] cur = repair.pricelist_id.currency_id res[id] = cur_obj.round(cr, uid, cur, untax.get(id, 0.0) + tax.get(id, 0.0)) return res
469,310
def action_invoice_create(self, cr, uid, ids, group=False, context=None): """ Creates invoice(s) for repair order. @param group: It is set to true when group invoice is to be generated. @return: Invoice Ids. """ res = {} invoices_group = {} inv_line_obj = self.pool.get('account.invoice.line') inv_obj = self.pool.get('account.invoice') repair_line_obj = self.pool.get('mrp.repair.line') repair_fee_obj = self.pool.get('mrp.repair.fee') for repair in self.browse(cr, uid, ids, context=context): res[repair.id] = False if repair.state in ('draft','cancel') or repair.invoice_id: continue if not (repair.partner_id.id and repair.partner_invoice_id.id): raise osv.except_osv(_('No partner !'),_('You have to select a Partner Invoice Address in the repair form !')) comment = repair.quotation_notes if (repair.invoice_method != 'none'): if group and repair.partner_invoice_id.id in invoices_group: inv_id = invoices_group[repair.partner_invoice_id.id] invoice = inv_obj.browse(cr, uid, inv_id) invoice_vals = { 'name': invoice.name +', '+repair.name, 'origin': invoice.origin+', '+repair.name, 'comment':(comment and (invoice.comment and invoice.comment+"\n"+comment or comment)) or (invoice.comment and invoice.comment or ''), } inv_obj.write(cr, uid, [inv_id], invoice_vals, context=context) else: if not repair.partner_id.property_account_receivable: raise osv.except_osv(_('Error !'), _('No account defined for partner "%s".') % repair.partner_id.name ) account_id = repair.partner_id.property_account_receivable.id inv = { 'name': repair.name, 'origin':repair.name, 'type': 'out_invoice', 'account_id': account_id, 'partner_id': repair.partner_id.id, 'address_invoice_id': repair.address_id.id, 'currency_id': repair.pricelist_id.currency_id.id, 'comment': repair.quotation_notes, 'fiscal_position': repair.partner_id.property_account_position.id } inv_id = inv_obj.create(cr, uid, inv) invoices_group[repair.partner_invoice_id.id] = inv_id self.write(cr, uid, repair.id, {'invoiced': True, 'invoice_id': inv_id})
def action_invoice_create(self, cr, uid, ids, group=False, context=None): """ Creates invoice(s) for repair order. @param group: It is set to true when group invoice is to be generated. @return: Invoice Ids. """ res = {} invoices_group = {} inv_line_obj = self.pool.get('account.invoice.line') inv_obj = self.pool.get('account.invoice') repair_line_obj = self.pool.get('mrp.repair.line') repair_fee_obj = self.pool.get('mrp.repair.fee') for repair in self.browse(cr, uid, ids, context=context): res[repair.id] = False if repair.state in ('draft','cancel') or repair.invoice_id: continue if not (repair.partner_id.id and repair.partner_invoice_id.id): raise osv.except_osv(_('No partner !'),_('You have to select a Partner Invoice Address in the repair form !')) comment = repair.quotation_notes if (repair.invoice_method != 'none'): if group and repair.partner_invoice_id.id in invoices_group: inv_id = invoices_group[repair.partner_invoice_id.id] invoice = inv_obj.browse(cr, uid, inv_id) invoice_vals = { 'name': invoice.name +', '+repair.name, 'origin': invoice.origin+', '+repair.name, 'comment':(comment and (invoice.comment and invoice.comment+"\n"+comment or comment)) or (invoice.comment and invoice.comment or ''), } inv_obj.write(cr, uid, [inv_id], invoice_vals, context=context) else: if not repair.partner_id.property_account_receivable: raise osv.except_osv(_('Error !'), _('No account defined for partner "%s".') % repair.partner_id.name ) account_id = repair.partner_id.property_account_receivable.id inv = { 'name': repair.name, 'origin':repair.name, 'type': 'out_invoice', 'account_id': account_id, 'partner_id': repair.partner_id.id, 'address_invoice_id': repair.address_id.id, 'currency_id': repair.pricelist_id.currency_id.id, 'comment': repair.quotation_notes, 'fiscal_position': repair.partner_id.property_account_position.id } inv_id = inv_obj.create(cr, uid, inv) invoices_group[repair.partner_invoice_id.id] = inv_id self.write(cr, uid, repair.id, {'invoiced': True, 'invoice_id': inv_id})
469,311
def action_invoice_create(self, cr, uid, ids, group=False, context=None): """ Creates invoice(s) for repair order. @param group: It is set to true when group invoice is to be generated. @return: Invoice Ids. """ res = {} invoices_group = {} inv_line_obj = self.pool.get('account.invoice.line') inv_obj = self.pool.get('account.invoice') repair_line_obj = self.pool.get('mrp.repair.line') repair_fee_obj = self.pool.get('mrp.repair.fee') for repair in self.browse(cr, uid, ids, context=context): res[repair.id] = False if repair.state in ('draft','cancel') or repair.invoice_id: continue if not (repair.partner_id.id and repair.partner_invoice_id.id): raise osv.except_osv(_('No partner !'),_('You have to select a Partner Invoice Address in the repair form !')) comment = repair.quotation_notes if (repair.invoice_method != 'none'): if group and repair.partner_invoice_id.id in invoices_group: inv_id = invoices_group[repair.partner_invoice_id.id] invoice = inv_obj.browse(cr, uid, inv_id) invoice_vals = { 'name': invoice.name +', '+repair.name, 'origin': invoice.origin+', '+repair.name, 'comment':(comment and (invoice.comment and invoice.comment+"\n"+comment or comment)) or (invoice.comment and invoice.comment or ''), } inv_obj.write(cr, uid, [inv_id], invoice_vals, context=context) else: if not repair.partner_id.property_account_receivable: raise osv.except_osv(_('Error !'), _('No account defined for partner "%s".') % repair.partner_id.name ) account_id = repair.partner_id.property_account_receivable.id inv = { 'name': repair.name, 'origin':repair.name, 'type': 'out_invoice', 'account_id': account_id, 'partner_id': repair.partner_id.id, 'address_invoice_id': repair.address_id.id, 'currency_id': repair.pricelist_id.currency_id.id, 'comment': repair.quotation_notes, 'fiscal_position': repair.partner_id.property_account_position.id } inv_id = inv_obj.create(cr, uid, inv) invoices_group[repair.partner_invoice_id.id] = inv_id self.write(cr, uid, repair.id, {'invoiced': True, 'invoice_id': inv_id})
def action_invoice_create(self, cr, uid, ids, group=False, context=None): """ Creates invoice(s) for repair order. @param group: It is set to true when group invoice is to be generated. @return: Invoice Ids. """ res = {} invoices_group = {} inv_line_obj = self.pool.get('account.invoice.line') inv_obj = self.pool.get('account.invoice') repair_line_obj = self.pool.get('mrp.repair.line') repair_fee_obj = self.pool.get('mrp.repair.fee') for repair in self.browse(cr, uid, ids, context=context): res[repair.id] = False if repair.state in ('draft','cancel') or repair.invoice_id: continue if not (repair.partner_id.id and repair.partner_invoice_id.id): raise osv.except_osv(_('No partner !'),_('You have to select a Partner Invoice Address in the repair form !')) comment = repair.quotation_notes if (repair.invoice_method != 'none'): if group and repair.partner_invoice_id.id in invoices_group: inv_id = invoices_group[repair.partner_invoice_id.id] invoice = inv_obj.browse(cr, uid, inv_id) invoice_vals = { 'name': invoice.name +', '+repair.name, 'origin': invoice.origin+', '+repair.name, 'comment':(comment and (invoice.comment and invoice.comment+"\n"+comment or comment)) or (invoice.comment and invoice.comment or ''), } inv_obj.write(cr, uid, [inv_id], invoice_vals, context=context) else: if not repair.partner_id.property_account_receivable: raise osv.except_osv(_('Error !'), _('No account defined for partner "%s".') % repair.partner_id.name ) account_id = repair.partner_id.property_account_receivable.id inv = { 'name': repair.name, 'origin':repair.name, 'type': 'out_invoice', 'account_id': account_id, 'partner_id': repair.partner_id.id, 'address_invoice_id': repair.address_id.id, 'currency_id': repair.pricelist_id.currency_id.id, 'comment': repair.quotation_notes, 'fiscal_position': repair.partner_id.property_account_position.id } inv_id = inv_obj.create(cr, uid, inv) invoices_group[repair.partner_invoice_id.id] = inv_id self.write(cr, uid, repair.id, {'invoiced': True, 'invoice_id': inv_id})
469,312
def action_repair_ready(self, cr, uid, ids, context=None): """ Writes repair order state to 'Ready' @return: True """ self.write(cr, uid, ids, {'state': 'ready'}) return True
def action_repair_ready(self, cr, uid, ids, context=None): """ Writes repair order state to 'Ready' @return: True """ for repair in self.browse(cr, uid, ids, context=context): self.pool.get('mrp.repair.line').write(cr, uid, [l.id for l in repair.operations], {'state': 'confirmed'}) self.write(cr, uid, [repair.id], {'state': 'ready'}) return True
469,313
def action_repair_start(self, cr, uid, ids, context=None): """ Writes repair order state to 'Under Repair' @return: True """ self.write(cr, uid, ids, {'state': 'under_repair'}) return True
def action_repair_start(self, cr, uid, ids, context=None): """ Writes repair order state to 'Under Repair' @return: True """ for repair in self.browse(cr, uid, ids, context=context): self.pool.get('mrp.repair.line').write(cr, uid, [l.id for l in repair.operations], {'state': 'confirmed'}) self.write(cr, uid, [repair.id], {'state': 'under_repair'}) return True
469,314
def action_repair_done(self, cr, uid, ids, context=None): """ Creates stock move and picking for repair order. @return: Picking ids. """ res = {} move_obj = self.pool.get('stock.move') wf_service = netsvc.LocalService("workflow") repair_line_obj = self.pool.get('mrp.repair.line') seq_obj = self.pool.get('ir.sequence') pick_obj = self.pool.get('stock.picking') for repair in self.browse(cr, uid, ids, context=context): for move in repair.operations: move_id = move_obj.create(cr, uid, { 'name': move.name, 'product_id': move.product_id.id, 'product_qty': move.product_uom_qty, 'product_uom': move.product_uom.id, 'address_id': repair.address_id and repair.address_id.id or False, 'location_id': move.location_id.id, 'location_dest_id': move.location_dest_id.id, 'tracking_id': False, 'state': 'done', }) repair_line_obj.write(cr, uid, [move.id], {'move_id': move_id}) if repair.deliver_bool: pick_name = seq_obj.get(cr, uid, 'stock.picking.out') picking = pick_obj.create(cr, uid, { 'name': pick_name, 'origin': repair.name, 'state': 'draft', 'move_type': 'one', 'address_id': repair.address_id and repair.address_id.id or False, 'note': repair.internal_notes, 'invoice_state': 'none', 'type': 'out', }) move_id = move_obj.create(cr, uid, { 'name': repair.name, 'picking_id': picking, 'product_id': repair.product_id.id, 'product_qty': 1.0, 'product_uom': repair.product_id.uom_id.id, 'prodlot_id': repair.prodlot_id and repair.prodlot_id.id or False, 'address_id': repair.address_id and repair.address_id.id or False, 'location_id': repair.location_id.id, 'location_dest_id': repair.location_dest_id.id, 'tracking_id': False, 'state': 'assigned', }) wf_service.trg_validate(uid, 'stock.picking', picking, 'button_confirm', cr) self.write(cr, uid, [repair.id], {'state': 'done', 'picking_id': picking}) res[repair.id] = picking else: self.write(cr, uid, [repair.id], {'state': 'done'}) return res
def action_repair_done(self, cr, uid, ids, context=None): """ Creates stock move and picking for repair order. @return: Picking ids. """ res = {} move_obj = self.pool.get('stock.move') wf_service = netsvc.LocalService("workflow") repair_line_obj = self.pool.get('mrp.repair.line') seq_obj = self.pool.get('ir.sequence') pick_obj = self.pool.get('stock.picking') for repair in self.browse(cr, uid, ids, context=context): for move in repair.operations: move_id = move_obj.create(cr, uid, { 'name': move.name, 'product_id': move.product_id.id, 'product_qty': move.product_uom_qty, 'product_uom': move.product_uom.id, 'address_id': repair.address_id and repair.address_id.id or False, 'location_id': move.location_id.id, 'location_dest_id': move.location_dest_id.id, 'tracking_id': False, 'state': 'done', }) repair_line_obj.write(cr, uid, [move.id], {'move_id': move_id, 'state': 'done'}) if repair.deliver_bool: pick_name = seq_obj.get(cr, uid, 'stock.picking.out') picking = pick_obj.create(cr, uid, { 'name': pick_name, 'origin': repair.name, 'state': 'draft', 'move_type': 'one', 'address_id': repair.address_id and repair.address_id.id or False, 'note': repair.internal_notes, 'invoice_state': 'none', 'type': 'out', }) move_id = move_obj.create(cr, uid, { 'name': repair.name, 'picking_id': picking, 'product_id': repair.product_id.id, 'product_qty': 1.0, 'product_uom': repair.product_id.uom_id.id, 'prodlot_id': repair.prodlot_id and repair.prodlot_id.id or False, 'address_id': repair.address_id and repair.address_id.id or False, 'location_id': repair.location_id.id, 'location_dest_id': repair.location_dest_id.id, 'tracking_id': False, 'state': 'assigned', }) wf_service.trg_validate(uid, 'stock.picking', picking, 'button_confirm', cr) self.write(cr, uid, [repair.id], {'state': 'done', 'picking_id': picking}) res[repair.id] = picking else: self.write(cr, uid, [repair.id], {'state': 'done'}) return res
469,315
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {}
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {}
469,316
def widget_add(self, cr, uid, ids, context=None): if context is None: context = {} wizard = self.read(cr, uid, ids)[0] self.pool.get('res.widget.user').create(cr, uid, {'user_id':uid, 'widget_id':wizard['widget_id']}) return {}
def add_res_widget(self, cr, uid, ids, context=None): if context is None: context = {} wizard = self.read(cr, uid, ids)[0] self.pool.get('res.widget.user').create(cr, uid, {'user_id':uid, 'widget_id':wizard['widget_id']}) return {}
469,317
def widget_add(self, cr, uid, ids, context=None): if context is None: context = {} wizard = self.read(cr, uid, ids)[0] self.pool.get('res.widget.user').create(cr, uid, {'user_id':uid, 'widget_id':wizard['widget_id']}) return {}
def widget_add(self, cr, uid, ids, context=None): if context is None: context = {} wizard = self.read(cr, uid, ids)[0] self.pool.get('res.widget.user').create(cr, uid, {'user_id':uid, 'widget_id':wizard['widget_id']}) return {}
469,318
def _inherit_apply_rec(result, inherit_id): # get all views which inherit from (ie modify) this view cr.execute('select arch,id from ir_ui_view where inherit_id=%s and model=%s order by priority', (inherit_id, self._name)) sql_inherit = cr.fetchall() for (inherit, id) in sql_inherit: result = _inherit_apply(result, inherit) result = _inherit_apply_rec(result, id) return result
defraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) _inherit_apply_rec(result,raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) inherit_id):raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) #raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) getraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) allraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) viewsraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) whichraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) inheritraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) fromraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) (ieraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) modify)raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) thisraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) viewraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) cr.execute('selectraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) arch,idraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) fromraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) ir_ui_viewraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) whereraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) inherit_id=%sraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) andraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) model=%sraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) orderraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) byraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) priority',raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) (inherit_id,raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) self._name))raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) sql_inheritraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) =raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) cr.fetchall()raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) forraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) (inherit,raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) id)raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) inraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) sql_inherit:raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) resultraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) =raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) _inherit_apply(result,raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) inherit)raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) resultraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) =raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) _inherit_apply_rec(result,raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) id)raise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) returnraise except_orm(_('Invalid Architecture!'),_("There is no view of type '%s' defined for the structure!") % view_type) result
469,319
def load_test(cr, module_name, id_map, mode): cr.commit() if not tools.config.options['test-disable']: try: _load_data(cr, module_name, id_map, mode, 'test') except Exception, e: if tools.config.options['test-continue']: logger.notifyChannel('ERROR', netsvc.LOG_TEST, str(e)) pass else: raise Exception finally: if tools.config.options['test-rollback']: cr.rollback() else: cr.commit()
def load_test(cr, module_name, id_map, mode): cr.commit() if not tools.config.options['test-disable']: try: _load_data(cr, module_name, id_map, mode, 'test') except Exception, e: if tools.config.options['test-continue']: logger.notifyChannel('ERROR', netsvc.LOG_TEST, e) pass else: raise Exception finally: if tools.config.options['test-rollback']: cr.rollback() else: cr.commit()
469,320
def load_test(cr, module_name, id_map, mode): cr.commit() if not tools.config.options['test-disable']: try: _load_data(cr, module_name, id_map, mode, 'test') except Exception, e: if tools.config.options['test-continue']: logger.notifyChannel('ERROR', netsvc.LOG_TEST, str(e)) pass else: raise Exception finally: if tools.config.options['test-rollback']: cr.rollback() else: cr.commit()
def load_test(cr, module_name, id_map, mode): cr.commit() if not tools.config.options['test-disable']: try: _load_data(cr, module_name, id_map, mode, 'test') except Exception, e: if tools.config.options['test-continue']: logger.notifyChannel('ERROR', netsvc.LOG_TEST, str(e)) pass else: raise finally: if tools.config.options['test-rollback']: cr.rollback() else: cr.commit()
469,321
def selection_field(in_field): col_obj = self.pool.get(in_field.keys()[0]) if f[i] in col_obj._columns.keys(): return col_obj._columns[f[i]] elif f[i] in col_obj._inherits.keys(): selection_field(col_obj._inherits) else: return False
def selection_field(in_field): col_obj = self.pool.get(in_field.keys()[0]) if f[i] in col_obj._columns.keys(): return col_obj._columns[f[i]] elif f[i] in col_obj._inherits.keys(): selection_field(col_obj._inherits) else: return False
469,322
def selection_field(in_field): col_obj = self.pool.get(in_field.keys()[0]) if f[i] in col_obj._columns.keys(): return col_obj._columns[f[i]] elif f[i] in col_obj._inherits.keys(): selection_field(col_obj._inherits) else: return False
def selection_field(in_field): col_obj = self.pool.get(in_field.keys()[0]) if f[i] in col_obj._columns.keys(): return col_obj._columns[f[i]] elif f[i] in col_obj._inherits.keys(): selection_field(col_obj._inherits) else: return False
469,323
def sort_result(self, accounts, context={}): # On boucle sur notre rapport result_accounts = [] ind=0 old_level=0 while ind<len(accounts): # account_elem = accounts[ind] #
defsort_result(self,accounts,context={}):#Onbouclesurnotrerapportresult_accounts=[]ind=0old_level=0whileind<len(accounts):#account_elem=accounts[ind]#
469,324
def sort_result(self, accounts, context={}): # On boucle sur notre rapport result_accounts = [] ind=0 old_level=0 while ind<len(accounts): # account_elem = accounts[ind] #
defsort_result(self,accounts,context={}):#Onbouclesurnotrerapportresult_accounts=[]ind=0old_level=0whileind<len(accounts):#account_elem=accounts[ind]#
469,325
def parse_ics(self, cr, uid, child, cal_children=None, context=None): """ parse calendaring and scheduling information @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """
def parse_ics(self, cr, uid, child, cal_children=None, context=None): """ parse calendaring and scheduling information @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """
469,326
def _get_lines(self, cr, uid, ids, name, arg, context=None): res = {} for id in ids: move_lines = self.move_line_id_payment_get(cr, uid, [id]) if not move_lines: res[id] = [] continue res[id] = [] data_lines = self.pool.get('account.move.line').browse(cr, uid, move_lines) partial_ids = []# Keeps the track of ids where partial payments are done with payment terms for line in data_lines: ids_line = [] if line.reconcile_id: ids_line = line.reconcile_id.line_id elif line.reconcile_partial_id: ids_line = line.reconcile_partial_id.line_partial_ids l = map(lambda x: x.id, ids_line) partial_ids.append(line.id) res[id] =[x for x in l if x <> line.id and x not in partial_ids] return res
def _get_lines(self, cr, uid, ids, name, arg, context=None): res = {} for invoice in self.browse(cr, uid, ids, context=context): id = invoice.id res[id] = [] if not invoice.move_id: continue res[id] = [] data_lines = self.pool.get('account.move.line').browse(cr, uid, move_lines) partial_ids = []# Keeps the track of ids where partial payments are done with payment terms for line in data_lines: ids_line = [] if line.reconcile_id: ids_line = line.reconcile_id.line_id elif line.reconcile_partial_id: ids_line = line.reconcile_partial_id.line_partial_ids l = map(lambda x: x.id, ids_line) partial_ids.append(line.id) res[id] =[x for x in l if x <> line.id and x not in partial_ids] return res
469,327
def _get_lines(self, cr, uid, ids, name, arg, context=None): res = {} for id in ids: move_lines = self.move_line_id_payment_get(cr, uid, [id]) if not move_lines: res[id] = [] continue res[id] = [] data_lines = self.pool.get('account.move.line').browse(cr, uid, move_lines) partial_ids = []# Keeps the track of ids where partial payments are done with payment terms for line in data_lines: ids_line = [] if line.reconcile_id: ids_line = line.reconcile_id.line_id elif line.reconcile_partial_id: ids_line = line.reconcile_partial_id.line_partial_ids l = map(lambda x: x.id, ids_line) partial_ids.append(line.id) res[id] =[x for x in l if x <> line.id and x not in partial_ids] return res
def _get_lines(self, cr, uid, ids, name, arg, context=None): res = {} for id in ids: move_lines = self.move_line_id_payment_get(cr, uid, [id]) if not move_lines: res[id] = [] continue res[id] = [] data_lines = self.pool.get('account.move.line').browse(cr, uid, move_lines) partial_ids = []# Keeps the track of ids where partial payments are done with payment terms for line in data_lines: ids_line = [] if line.reconcile_id: ids_line = line.reconcile_id.line_id elif line.reconcile_partial_id: ids_line = line.reconcile_partial_id.line_partial_ids l = map(lambda x: x.id, ids_line) partial_ids.append(line.id) res[id] =[x for x in l if x <> line.id and x not in partial_ids] return res
469,328
def _compute_lines(self, cr, uid, ids, name, args, context=None): result = {} for invoice in self.browse(cr, uid, ids, context): moves = self.move_line_id_payment_get(cr, uid, [invoice.id]) src = [] lines = [] for m in self.pool.get('account.move.line').browse(cr, uid, moves, context): temp_lines = []#Added temp list to avoid duplicate records if m.reconcile_id: temp_lines = map(lambda x: x.id, m.reconcile_id.line_id) elif m.reconcile_partial_id: temp_lines = map(lambda x: x.id, m.reconcile_partial_id.line_partial_ids) lines += [x for x in temp_lines if x not in lines] src.append(m.id)
def _compute_lines(self, cr, uid, ids, name, args, context=None): result = {} for invoice in self.browse(cr, uid, ids, context): src = [] lines = [] for m in self.pool.get('account.move.line').browse(cr, uid, moves, context): temp_lines = []#Added temp list to avoid duplicate records if m.reconcile_id: temp_lines = map(lambda x: x.id, m.reconcile_id.line_id) elif m.reconcile_partial_id: temp_lines = map(lambda x: x.id, m.reconcile_partial_id.line_partial_ids) lines += [x for x in temp_lines if x not in lines] src.append(m.id)
469,329
def _compute_lines(self, cr, uid, ids, name, args, context=None): result = {} for invoice in self.browse(cr, uid, ids, context): moves = self.move_line_id_payment_get(cr, uid, [invoice.id]) src = [] lines = [] for m in self.pool.get('account.move.line').browse(cr, uid, moves, context): temp_lines = []#Added temp list to avoid duplicate records if m.reconcile_id: temp_lines = map(lambda x: x.id, m.reconcile_id.line_id) elif m.reconcile_partial_id: temp_lines = map(lambda x: x.id, m.reconcile_partial_id.line_partial_ids) lines += [x for x in temp_lines if x not in lines] src.append(m.id)
def _compute_lines(self, cr, uid, ids, name, args, context=None): result = {} for invoice in self.browse(cr, uid, ids, context): moves = self.move_line_id_payment_get(cr, uid, [invoice.id]) src = [] lines = [] for m in self.pool.get('account.move.line').browse(cr, uid, moves, context): temp_lines = []#Added temp list to avoid duplicate records if m.reconcile_id: temp_lines = map(lambda x: x.id, m.reconcile_id.line_id) elif m.reconcile_partial_id: temp_lines = map(lambda x: x.id, m.reconcile_partial_id.line_partial_ids) lines += [x for x in temp_lines if x not in lines] src.append(m.id)
469,330
def move_line_id_payment_get(self, cr, uid, ids, *args): res = [] if not ids: return res cr.execute('SELECT l.id '\ 'FROM account_move_line l '\ 'LEFT JOIN account_invoice i ON (i.move_id=l.move_id) '\ 'WHERE i.id IN %s '\ 'AND l.account_id=i.account_id', (tuple(ids),)) res = map(itemgetter(0), cr.fetchall()) return res
def move_line_id_payment_get(self, cr, uid, ids, *args): print '** la' if not ids: return [] result = self.move_line_id_payment_gets(cr, uid, ids, *args) return result.get(ids[0], []) def move_line_id_payment_gets(self, cr, uid, ids, *args): print '** ICI' res = {} if not ids: return res cr.execute('SELECT l.id '\ 'FROM account_move_line l '\ 'LEFT JOIN account_invoice i ON (i.move_id=l.move_id) '\ 'WHERE i.id IN %s '\ 'AND l.account_id=i.account_id', (tuple(ids),)) res = map(itemgetter(0), cr.fetchall()) return res
469,331
def move_line_id_payment_get(self, cr, uid, ids, *args): res = [] if not ids: return res cr.execute('SELECT l.id '\ 'FROM account_move_line l '\ 'LEFT JOIN account_invoice i ON (i.move_id=l.move_id) '\ 'WHERE i.id IN %s '\ 'AND l.account_id=i.account_id', (tuple(ids),)) res = map(itemgetter(0), cr.fetchall()) return res
def move_line_id_payment_get(self, cr, uid, ids, *args): res = [] if not ids: return res cr.execute('SELECT i.id, l.id '\ 'FROM account_move_line l '\ 'LEFT JOIN account_invoice i ON (i.move_id=l.move_id) '\ 'WHERE i.id IN %s '\ 'AND l.account_id=i.account_id', (tuple(ids),)) res = map(itemgetter(0), cr.fetchall()) return res
469,332
def move_line_id_payment_get(self, cr, uid, ids, *args): res = [] if not ids: return res cr.execute('SELECT l.id '\ 'FROM account_move_line l '\ 'LEFT JOIN account_invoice i ON (i.move_id=l.move_id) '\ 'WHERE i.id IN %s '\ 'AND l.account_id=i.account_id', (tuple(ids),)) res = map(itemgetter(0), cr.fetchall()) return res
def move_line_id_payment_get(self, cr, uid, ids, *args): res = [] if not ids: return res cr.execute('SELECT l.id '\ 'FROM account_move_line l '\ 'LEFT JOIN account_invoice i ON (i.move_id=l.move_id) '\ 'WHERE i.id IN %s '\ 'AND l.account_id=i.account_id', (tuple(ids),)) for r in cr.fetchall(): res.setdefault(r[0], []) res[r[0]].append( r[1] ) return res
469,333
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter address @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @param offset: The Number of Results to Pass @param limit: The Number of Results to Return @param context: A standard dictionary for contextual values """ if context is None: context = {} if context.get('address_partner_id',False): args.append(('partner_id', '=', context['address_partner_id'])) return super(res_partner_address, self).search(cr, user, args, offset, limit, order, context, count)
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter address @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @param offset: The Number of Results to Pass @param limit: The Number of Results to Return @param context: A standard dictionary for contextual values """ if context is None: context = {} if context.get('address_partner_id',False): args.append(('partner_id', '=', context['address_partner_id'])) return super(res_partner_address, self).search(cr, user, args, offset, limit, order, context, count)
469,334
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter job @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @param offset: The Number of Results to Pass @param limit: The Number of Results to Return @param context: A standard dictionary for contextual values """
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter job @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @param offset: The Number of Results to Pass @param limit: The Number of Results to Return @param context: A standard dictionary for contextual values """
469,335
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter job @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @param offset: The Number of Results to Pass @param limit: The Number of Results to Return @param context: A standard dictionary for contextual values """
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter job @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @param offset: The Number of Results to Pass @param limit: The Number of Results to Return @param context: A standard dictionary for contextual values """
469,336
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ search parnter job @param self: The object pointer @param cr: the current row, from the database cursor, @param user: the current user @param args: list of tuples of form [(‘name_of_the_field’, ‘operator’, value), ...]. @param offset: The Number of Results to Pass @param limit: The Number of Results to Return @param context: A standard dictionary for contextual values """
def def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} search(self, def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} cr, def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} user, def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} args, def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} offset=0, def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} limit=None, def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} order=None, def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} context=None, def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} count=False): def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} """ def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} search def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} parnter def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} job def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} @param def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} self: def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} The def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} object def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} pointer def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} @param def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} cr: def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} the def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} current def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} row, def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} from def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} the def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} database def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} cursor, def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} @param def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} user: def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} the def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} current def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} user def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} @param def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} args: def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} list def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} of def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} tuples def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} of def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} form def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} [(‘name_of_the_field’, def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} ‘operator’, def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} value), def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} ...]. def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} @param def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} offset: def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} The def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} Number def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} of def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} Results def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} to def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} Pass def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} @param def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} limit: def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} The def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} Number def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} of def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} Results def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} to def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} Return def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} @param def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} context: def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} A def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} standard def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} dictionary def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} for def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} contextual def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} values def onchange_partner(self, cr, uid, _, partner_id, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @partner_id : ID of the Partner selected, @param context: A standard dictionary for contextual values """ return {'value': {'address_id': False}} def onchange_address(self, cr, uid, _, address_id, context=None): """ @@param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user, @param _: List of IDs, @address_id : ID of the Address selected, @param context: A standard dictionary for contextual values """ partner_id = False if address_id: address = self.pool.get('res.partner.address')\ .browse(cr, uid, address_id, context) partner_id = address.partner_id.id return {'value': {'name': partner_id}} """
469,337
def _get_def_storage(self, cr, uid, context=None): if context and context.has_key('default_parent_id'): # Use the same storage as the parent.. diro = self.browse(cr, uid, context['default_parent_id']) if diro.storage_id: return diro.storage_id.id objid=self.pool.get('ir.model.data') try: mid = objid._get_id(cr, uid, 'document', 'storage_default') return objid.browse(cr, uid, mid, context=context).res_id except Exception: return None
def _get_def_storage(self, cr, uid, context=None): if context and context.has_key('default_parent_id'): # Use the same storage as the parent.. diro = self.browse(cr, uid, context['default_parent_id']) if diro.storage_id: return diro.storage_id.id objid=self.pool.get('ir.model.data') try: mid = objid._get_id(cr, uid, 'document', 'storage_default') return objid.browse(cr, uid, mid, context=context).res_id except Exception: return None
469,338
def _get_def_storage(self, cr, uid, context=None): if context and context.has_key('default_parent_id'): # Use the same storage as the parent.. diro = self.browse(cr, uid, context['default_parent_id']) if diro.storage_id: return diro.storage_id.id objid=self.pool.get('ir.model.data') try: mid = objid._get_id(cr, uid, 'document', 'storage_default') return objid.browse(cr, uid, mid, context=context).res_id except Exception: return None
def _get_def_storage(self, cr, uid, context=None): if context and context.has_key('default_parent_id'): # Use the same storage as the parent.. diro = self.browse(cr, uid, context['default_parent_id']) if diro.storage_id: return diro.storage_id.id objid=self.pool.get('ir.model.data') try: mid = objid._get_id(cr, uid, 'document', 'storage_default') return objid.browse(cr, uid, mid, context=context).res_id except Exception: return None
469,339
def _check_recursion(self, cr, uid, ids): level = 100 while len(ids): cr.execute('select distinct parent_id from document_directory where id in ('+','.join(map(str,ids))+')') ids = filter(None, map(lambda x:x[0], cr.fetchall())) if not level: return False level -= 1 return True
def _check_recursion(self, cr, uid, ids): level = 100 while len(ids): cr.execute('select distinct parent_id from document_directory where id in ('+','.join(map(str,ids))+')') ids = filter(None, map(lambda x:x[0], cr.fetchall())) if not level: return False level -= 1 return True
469,340
def get_object(self, cr, uid, uri, context=None): """ Return a node object for the given uri. This fn merely passes the call to node_context """ if not context: context = {} return nodes.get_node_context(cr, uid, context).get_uri(cr, uri)
def get_object(self, cr, uid, uri, context=None): """ Return a node object for the given uri. This fn merely passes the call to node_context """ if not context: context = {} return nodes.get_node_context(cr, uid, context).get_uri(cr, uri)
469,341
def get_dir_permissions(self, cr, uid, ids ): """Check what permission user 'uid' has on directory 'id' """ assert len(ids) == 1 id = ids[0] cr.execute( "SELECT count(dg.item_id) AS needs, count(ug.uid) AS has " \ " FROM document_directory_group_rel dg " \ " LEFT OUTER JOIN res_groups_users_rel ug " \ " ON (dg.group_id = ug.gid AND ug.uid = %s) " \ " WHERE dg.item_id = %s ", (uid, id)) needs, has = cr.fetchone() if needs and not has: return 1 # still allow to descend into. else: return 15
def get_dir_permissions(self, cr, uid, ids ): """Check what permission user 'uid' has on directory 'id' """ assert len(ids) == 1 id = ids[0] cr.execute( "SELECT count(dg.item_id) AS needs, count(ug.uid) AS has " \ " FROM document_directory_group_rel dg " \ " LEFT OUTER JOIN res_groups_users_rel ug " \ " ON (dg.group_id = ug.gid AND ug.uid = %s) " \ " WHERE dg.item_id = %s ", (uid, id)) needs, has = cr.fetchone() if needs and not has: return 1 # still allow to descend into. else: return 15
469,342
def _locate_child(self, cr, uid, root_id, uri,nparent, ncontext): """ try to locate the node in uri, Return a tuple (node_dir, remaining_path) """ return (nodes.node_database(context=ncontext), uri)
def _locate_child(self, cr, uid, root_id, uri,nparent, ncontext): """ try to locate the node in uri, Return a tuple (node_dir, remaining_path) """ return (nodes.node_database(context=ncontext), uri)
469,343
def onchange_currency_id(self, cr, uid, ids, curr_id, company_id): if curr_id: currency = self.pool.get('res.currency').browse(cr, uid, curr_id) if currency.company_id != company_id: raise osv.except_osv(_('Configration Error !'), _('Can not select currency that is not related to current company.\nPlease select accordingly !.')) return {}
def onchange_currency_id(self, cr, uid, ids, curr_id, company_id): if curr_id: currency = self.pool.get('res.currency').browse(cr, uid, curr_id) if currency.company_id.id != company_id: raise osv.except_osv(_('Configration Error !'), _('Can not select currency that is not related to current company.\nPlease select accordingly !.')) return {}
469,344
def _check_module_names(cr, module_names): mod_names = set(module_names) if 'base' in mod_names: # ignore dummy 'all' module mod_names.remove('all') if mod_names: cr.execute("SELECT count(id) AS count FROM ir_module_module WHERE name in %s", (tuple(mod_names),)) if cr.dictfetchone()['count'] != len(mod_names): # find out what module name(s) are incorrect: cr.execute("SELECT name FROM ir_module_module") incorrect_names = mod_names.difference([x['name'] for x in cr.dictfetchall()]) logging.getLogger('init').warning('invalid module names, ignored: %s', ", ".join(incorrect_names))
def _check_module_names(cr, module_names): mod_names = set(module_names) if 'base' in mod_names: # ignore dummy 'all' module if 'all' in mod_names: mod_names.remove('all') if mod_names: cr.execute("SELECT count(id) AS count FROM ir_module_module WHERE name in %s", (tuple(mod_names),)) if cr.dictfetchone()['count'] != len(mod_names): # find out what module name(s) are incorrect: cr.execute("SELECT name FROM ir_module_module") incorrect_names = mod_names.difference([x['name'] for x in cr.dictfetchall()]) logging.getLogger('init').warning('invalid module names, ignored: %s', ", ".join(incorrect_names))
469,345
def on_change_company_id(self, cr, uid, ids, company_id): return { 'value': { 'warning' : _("Please keep in mind that data currently displayed may not be relevant after switching to another company. If you have unsaved changes, please make sure to save and close the forms before switching to a different company (you can click on Cancel now)"), } }
def on_change_company_id(self, cr, uid, ids, company_id): return { 'warning' : { 'title': _("Company Switch Warning"), 'message': _("Please keep in mind that documents currently displayed may not be relevant after switching to another company. If you have unsaved changes, please make sure to save and close all forms before switching to a different company. (You can click on Cancel in the User Preferences now)"), } }
469,346
def dispatch(self, method, auth, params): (db, uid, passwd ) = params[0:3] params = params[3:] if method not in ['execute','exec_workflow','obj_list']: raise KeyError("Method not supported %s" % method) security.check(db,uid,passwd) ls = netsvc.LocalService('object_proxy') fn = getattr(ls, method) res = fn(db, uid, *params) return res
def dispatch(self, method, auth, params): (db, uid, passwd ) = params[0:3] params = params[3:] if method == 'obj_list': raise NameError("obj_list has been discontinued via RPC as of 6.0, please query ir.model directly!") if method not in ['execute','exec_workflow']: raise NameError("Method not available %s" % method) security.check(db,uid,passwd) ls = netsvc.LocalService('object_proxy') fn = getattr(ls, method) res = fn(db, uid, *params) return res
469,347
def _refund_cleanup_lines(self, cr, uid, lines): for line in lines: del line['id'] del line['invoice_id'] if 'account_id' in line: line['account_id'] = line.get('account_id', False) and line['account_id'][0] if 'product_id' in line: line['product_id'] = line.get('product_id', False) and line['product_id'][0] if 'uos_id' in line: line['uos_id'] = line.get('uos_id', False) and line['uos_id'][0] if 'invoice_line_tax_id' in line: line['invoice_line_tax_id'] = [(6,0, line.get('invoice_line_tax_id', [])) ] if 'account_analytic_id' in line: line['account_analytic_id'] = line.get('account_analytic_id', False) and line['account_analytic_id'][0] if 'tax_code_id' in line : if isinstance(line['tax_code_id'],tuple) and len(line['tax_code_id']) >0 : line['tax_code_id'] = line['tax_code_id'][0] if 'base_code_id' in line : if isinstance(line['base_code_id'],tuple) and len(line['base_code_id']) >0 : line['base_code_id'] = line['base_code_id'][0] return map(lambda x: (0,0,x), lines)
def _refund_cleanup_lines(self, cr, uid, lines): for line in lines: del line['id'] del line['invoice_id'] for field in ('company_id', 'partner_id', 'account_id', 'product_id', 'uos_id', 'account_analytic_id', 'tax_code_id', 'base_code_id'): line[field] = line.get(field, False) and line[field][0] if 'invoice_line_tax_id' in line: line['invoice_line_tax_id'] = [(6,0, line.get('invoice_line_tax_id', [])) ] if 'account_analytic_id' in line: line['account_analytic_id'] = line.get('account_analytic_id', False) and line['account_analytic_id'][0] if 'tax_code_id' in line : if isinstance(line['tax_code_id'],tuple) and len(line['tax_code_id']) >0 : line['tax_code_id'] = line['tax_code_id'][0] if 'base_code_id' in line : if isinstance(line['base_code_id'],tuple) and len(line['base_code_id']) >0 : line['base_code_id'] = line['base_code_id'][0] return map(lambda x: (0,0,x), lines)
469,348
def _refund_cleanup_lines(self, cr, uid, lines): for line in lines: del line['id'] del line['invoice_id'] if 'account_id' in line: line['account_id'] = line.get('account_id', False) and line['account_id'][0] if 'product_id' in line: line['product_id'] = line.get('product_id', False) and line['product_id'][0] if 'uos_id' in line: line['uos_id'] = line.get('uos_id', False) and line['uos_id'][0] if 'invoice_line_tax_id' in line: line['invoice_line_tax_id'] = [(6,0, line.get('invoice_line_tax_id', [])) ] if 'account_analytic_id' in line: line['account_analytic_id'] = line.get('account_analytic_id', False) and line['account_analytic_id'][0] if 'tax_code_id' in line : if isinstance(line['tax_code_id'],tuple) and len(line['tax_code_id']) >0 : line['tax_code_id'] = line['tax_code_id'][0] if 'base_code_id' in line : if isinstance(line['base_code_id'],tuple) and len(line['base_code_id']) >0 : line['base_code_id'] = line['base_code_id'][0] return map(lambda x: (0,0,x), lines)
def _refund_cleanup_lines(self, cr, uid, lines): for line in lines: del line['id'] del line['invoice_id'] if 'account_id' in line: line['account_id'] = line.get('account_id', False) and line['account_id'][0] if 'product_id' in line: line['product_id'] = line.get('product_id', False) and line['product_id'][0] if 'uos_id' in line: line['uos_id'] = line.get('uos_id', False) and line['uos_id'][0] if 'invoice_line_tax_id' in line: line['invoice_line_tax_id'] = [(6,0, line.get('invoice_line_tax_id', [])) ] return map(lambda x: (0,0,x), lines)
469,349
def run(self, cr, uid, ids, context=None): logger = logging.getLogger(self._name) if context is None: context = {} for action in self.browse(cr, uid, ids, context): obj_pool = self.pool.get(action.model_id.model) obj = obj_pool.browse(cr, uid, context['active_id'], context=context) cxt = { 'context': dict(context), # copy context to prevent side-effects of eval 'object': obj, 'time':time, 'cr': cr, 'pool' : self.pool, 'uid' : uid } expr = eval(str(action.condition), cxt) if not expr: continue
def run(self, cr, uid, ids, context=None): logger = logging.getLogger(self._name) if context is None: context = {} for action in self.browse(cr, uid, ids, context): obj_pool = self.pool.get(action.model_id.model) obj = obj_pool.browse(cr, uid, context['active_id'], context=context) cxt = { 'context': dict(context), # copy context to prevent side-effects of eval 'object': obj, 'time':time, 'cr': cr, 'pool' : self.pool, 'uid' : uid } expr = eval(str(action.condition), cxt) if not expr: continue
469,350
def _check_product_lot(self, cr, uid, ids): """ Checks whether move is done or not and production lot is assigned to that move. @return: True or False """ for move in self.browse(cr, uid, ids): if move.prodlot_id and move.state == 'done' and (move.prodlot_id.product_id.id != move.product_id.id): return False return True
def _check_product_lot(self, cr, uid, ids): """ Checks whether move is done or not and production lot is assigned to that move. @return: True or False """ for move in self.browse(cr, uid, ids): if move.prodlot_id and move.state == 'done' and (move.prodlot_id.product_id.id != move.product_id.id): return False return True
469,351
def _check_percent(self, cr, uid, ids, context={}): obj = self.browse(cr, uid, ids[0]) if obj.value == 'procent' and ( obj.value_amount < 0.0 or obj.value_amount > 1.0): return False return True
def_check_percent(self,cr,uid,ids,context={}):obj=self.browse(cr,uid,ids[0])ifobj.value=='procent'and(obj.value_amount<0.0orobj.value_amount>1.0):returnFalsereturnTrue
469,352
def execute(self, cr, uid, ids, context=None): obj_multi = self.browse(cr, uid, ids[0]) obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_position_template = self.pool.get('account.fiscal.position.template') obj_fiscal_position = self.pool.get('account.fiscal.position') data_pool = self.pool.get('ir.model.data')
def execute(self, cr, uid, ids, context=None): obj_multi = self.browse(cr, uid, ids[0]) obj_acc = self.pool.get('account.account') obj_acc_tax = self.pool.get('account.tax') obj_journal = self.pool.get('account.journal') obj_sequence = self.pool.get('ir.sequence') obj_acc_template = self.pool.get('account.account.template') obj_fiscal_position_template = self.pool.get('account.fiscal.position.template') obj_fiscal_position = self.pool.get('account.fiscal.position') data_pool = self.pool.get('ir.model.data')
469,353
def write(self, cr, uid, ids, vals, context=None):
def write(self, cr, uid, ids, vals, context=None):
469,354
def getDiff(self, cr, uid, v1, v2, context={}):
def getDiff(self, cr, uid, v1, v2, context={}):
469,355
def _eval_xml(self, node, pool, cr, uid, idref, context=None): if context is None: context = {} if node.tag in ('field','value'): t = node.get('type','char') f_model = node.get('model', '').encode('utf-8') if node.get('search'): f_search = node.get("search",'').encode('utf-8') f_use = node.get("use",'id').encode('utf-8') f_name = node.get("name",'').encode('utf-8') q = unsafe_eval(f_search, idref) ids = pool.get(f_model).search(cr, uid, q) if f_use != 'id': ids = map(lambda x: x[f_use], pool.get(f_model).read(cr, uid, ids, [f_use])) _cols = pool.get(f_model)._columns if (f_name in _cols) and _cols[f_name]._type=='many2many': return ids f_val = False if len(ids): f_val = ids[0] if isinstance(f_val, tuple): f_val = f_val[0] return f_val a_eval = node.get('eval','') if a_eval: idref2 = dict(idref, time=time, DateTime=datetime, timedelta=timedelta, version=release.major_version, ref=lambda x: self.id_get(cr, False, x), pytz=pytz) if len(f_model): idref2['obj'] = _obj(self.pool, cr, uid, f_model, context=context) try: return unsafe_eval(a_eval, idref2) except Exception: logger = logging.getLogger('init') logger.warning('could not eval(%s) for %s in %s' % (a_eval, node.get('name'), context), exc_info=True) return "" if t == 'xml': def _process(s, idref): m = re.findall('[^%]%\((.*?)\)[ds]', s) for id in m: if not id in idref: idref[id]=self.id_get(cr, False, id) return s % idref _fix_multiple_roots(node) return '<?xml version="1.0"?>\n'\ +_process("".join([etree.tostring(n, encoding='utf-8') for n in node]), idref) if t in ('char', 'int', 'float'): d = node.text if t == 'int': d = d.strip() if d == 'None': return None else: return int(d.strip()) elif t == 'float': return float(d.strip()) return d elif t in ('list','tuple'): res=[] for n in node.findall('./value'): res.append(_eval_xml(self,n,pool,cr,uid,idref)) if t=='tuple': return tuple(res) return res elif node.tag == "getitem": for n in node: res=_eval_xml(self,n,pool,cr,uid,idref) if not res: raise LookupError elif node.get('type') in ("int", "list"): return res[int(node.get('index'))] else: return res[node.get('index','').encode("utf8")] elif node.tag == "function": args = [] a_eval = node.get('eval','') if a_eval: idref['ref'] = lambda x: self.id_get(cr, False, x) args = unsafe_eval(a_eval, idref) for n in node: return_val = _eval_xml(self,n, pool, cr, uid, idref, context) if return_val is not None: args.append(return_val) model = pool.get(node.get('model','')) method = node.get('name','') res = getattr(model, method)(cr, uid, *args) return res elif node.tag == "test": return node.text
def _eval_xml(self, node, pool, cr, uid, idref, context=None): if context is None: context = {} if node.tag in ('field','value'): t = node.get('type','char') f_model = node.get('model', '').encode('utf-8') if node.get('search'): f_search = node.get("search",'').encode('utf-8') f_use = node.get("use",'id').encode('utf-8') f_name = node.get("name",'').encode('utf-8') idref2 = {} if f_search: idref2 = _get_idref(self, cr, uid, f_model, context, idref) q = unsafe_eval(f_search, idref2) ids = pool.get(f_model).search(cr, uid, q) if f_use != 'id': ids = map(lambda x: x[f_use], pool.get(f_model).read(cr, uid, ids, [f_use])) _cols = pool.get(f_model)._columns if (f_name in _cols) and _cols[f_name]._type=='many2many': return ids f_val = False if len(ids): f_val = ids[0] if isinstance(f_val, tuple): f_val = f_val[0] return f_val a_eval = node.get('eval','') idref2 = {} if a_eval: idref2 = _get_idref(self, cr, uid, f_model, context, idref) try: return unsafe_eval(a_eval, idref2) except Exception: logger = logging.getLogger('init') logger.warning('could not eval(%s) for %s in %s' % (a_eval, node.get('name'), context), exc_info=True) return "" if t == 'xml': def _process(s, idref): m = re.findall('[^%]%\((.*?)\)[ds]', s) for id in m: if not id in idref: idref[id]=self.id_get(cr, False, id) return s % idref _fix_multiple_roots(node) return '<?xml version="1.0"?>\n'\ +_process("".join([etree.tostring(n, encoding='utf-8') for n in node]), idref) if t in ('char', 'int', 'float'): d = node.text if t == 'int': d = d.strip() if d == 'None': return None else: return int(d.strip()) elif t == 'float': return float(d.strip()) return d elif t in ('list','tuple'): res=[] for n in node.findall('./value'): res.append(_eval_xml(self,n,pool,cr,uid,idref)) if t=='tuple': return tuple(res) return res elif node.tag == "getitem": for n in node: res=_eval_xml(self,n,pool,cr,uid,idref) if not res: raise LookupError elif node.get('type') in ("int", "list"): return res[int(node.get('index'))] else: return res[node.get('index','').encode("utf8")] elif node.tag == "function": args = [] a_eval = node.get('eval','') if a_eval: idref['ref'] = lambda x: self.id_get(cr, False, x) args = unsafe_eval(a_eval, idref) for n in node: return_val = _eval_xml(self,n, pool, cr, uid, idref, context) if return_val is not None: args.append(return_val) model = pool.get(node.get('model','')) method = node.get('name','') res = getattr(model, method)(cr, uid, *args) return res elif node.tag == "test": return node.text
469,356
def _tag_delete(self, cr, rec, data_node=None): d_model = rec.get("model",'') d_search = rec.get("search",'') d_id = rec.get("id",'') ids = [] if d_search: ids = self.pool.get(d_model).search(cr, self.uid, unsafe_eval(d_search)) if d_id: try: ids.append(self.id_get(cr, d_model, d_id)) except: # d_id cannot be found. doesn't matter in this case pass if ids: self.pool.get(d_model).unlink(cr, self.uid, ids) self.pool.get('ir.model.data')._unlink(cr, self.uid, d_model, ids)
def _tag_delete(self, cr, rec, data_node=None): d_model = rec.get("model",'') d_search = rec.get("search",'').encode('utf-8') d_id = rec.get("id",'') ids = [] if d_search: ids = self.pool.get(d_model).search(cr, self.uid, unsafe_eval(d_search)) if d_id: try: ids.append(self.id_get(cr, d_model, d_id)) except: # d_id cannot be found. doesn't matter in this case pass if ids: self.pool.get(d_model).unlink(cr, self.uid, ids) self.pool.get('ir.model.data')._unlink(cr, self.uid, d_model, ids)
469,357
def _tag_delete(self, cr, rec, data_node=None): d_model = rec.get("model",'') d_search = rec.get("search",'') d_id = rec.get("id",'') ids = [] if d_search: ids = self.pool.get(d_model).search(cr, self.uid, unsafe_eval(d_search)) if d_id: try: ids.append(self.id_get(cr, d_model, d_id)) except: # d_id cannot be found. doesn't matter in this case pass if ids: self.pool.get(d_model).unlink(cr, self.uid, ids) self.pool.get('ir.model.data')._unlink(cr, self.uid, d_model, ids)
def _tag_delete(self, cr, rec, data_node=None): d_model = rec.get("model",'') d_search = rec.get("search",'') d_id = rec.get("id",'') ids = [] if d_search: idref = _get_idref(self, cr, self.uid, d_model, context={}, idref={}) ids = self.pool.get(d_model).search(cr, self.uid, unsafe_eval(d_search, idref)) if d_id: try: ids.append(self.id_get(cr, d_model, d_id)) except: # d_id cannot be found. doesn't matter in this case pass if ids: self.pool.get(d_model).unlink(cr, self.uid, ids) self.pool.get('ir.model.data')._unlink(cr, self.uid, d_model, ids)
469,358
def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') access_pool = self.pool.get('ir.model.access') can_see = any(access_pool.check_groups(cr, user, group) for group in groups) if not can_see: node.set('invisible', '1') if 'attrs' in node.attrib: del(node.attrib['attrs']) #avoid making field visible later del(node.attrib['groups']) return can_see else: return True
def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') access_pool = self.pool.get('ir.model.access') can_see = any(access_pool.check_groups(cr, user, group) for group in groups) if not can_see: node.set('invisible', '1') if 'attrs' in node.attrib: del(node.attrib['attrs']) #avoid making field visible later del(node.attrib['groups']) return can_see else: return True
469,359
def _find(node, node2): if node2.tag == 'xpath': res = node.xpath(node2.get('expr')) if res: return res[0] else: return None else: for n in node.getiterator(node2.tag): res = True if node2.tag == 'field': # only compare field names, a field can be only once in a given view # at a given level (and for multilevel expressions, we should use xpath # inheritance spec anyway) if node2.get('name') == n.get('name'): return n else: continue for attr in node2.attrib: if attr == 'position': continue if n.get(attr): if n.get(attr) == node2.get(attr): continue res = False if res: return n return None
def _find(node, node2): if node2.tag == 'xpath': res = node.xpath(node2.get('expr')) if res: return res[0] else: return None else: for n in node.getiterator(node2.tag): res = True if node2.tag == 'field': # only compare field names, a field can be only once in a given view # at a given level (and for multilevel expressions, we should use xpath # inheritance spec anyway) if node2.get('name') == n.get('name'): return n else: continue for attr in node2.attrib: if attr == 'position': continue if n.get(attr): if n.get(attr) == node2.get(attr): continue res = False if res: return n return None
469,360
def _find(node, node2): if node2.tag == 'xpath': res = node.xpath(node2.get('expr')) if res: return res[0] else: return None else: for n in node.getiterator(node2.tag): res = True if node2.tag == 'field': # only compare field names, a field can be only once in a given view # at a given level (and for multilevel expressions, we should use xpath # inheritance spec anyway) if node2.get('name') == n.get('name'): return n else: continue for attr in node2.attrib: if attr == 'position': continue if n.get(attr): if n.get(attr) == node2.get(attr): continue res = False if res: return n return None
def _find(node, node2): if node2.tag == 'xpath': res = node.xpath(node2.get('expr')) if res: return res[0] else: return None else: for n in node.getiterator(node2.tag): res = True if node2.tag == 'field': # only compare field names, a field can be only once in a given view # at a given level (and for multilevel expressions, we should use xpath # inheritance spec anyway) if node2.get('name') == n.get('name'): return n else: continue for attr in node2.attrib: if attr == 'position': continue if n.get(attr): if n.get(attr) == node2.get(attr): continue res = False if res: return n return None
469,361
def _inherit_apply_rec(result, inherit_id): # get all views which inherit from (ie modify) this view cr.execute('select arch,id from ir_ui_view where inherit_id=%s and model=%s order by priority', (inherit_id, self._name)) sql_inherit = cr.fetchall() for (inherit, id) in sql_inherit: result = _inherit_apply(result, inherit, id) result = _inherit_apply_rec(result, id) return result
def _inherit_apply_rec(result, inherit_id): # get all views which inherit from (ie modify) this view cr.execute('select arch,id from ir_ui_view where inherit_id=%s and model=%s order by priority', (inherit_id, self._name)) sql_inherit = cr.fetchall() for (inherit, id) in sql_inherit: result = _inherit_apply(result, inherit, id) result = _inherit_apply_rec(result, id) return result
469,362
def _minimum_planned_date(self, cr, uid, ids, field_name, arg, context=None): res={} purchase_obj=self.browse(cr, uid, ids, context=context) for purchase in purchase_obj: res[purchase.id] = False if purchase.order_line: min_date=purchase.order_line[0].date_planned for line in purchase.order_line: if line.date_planned < min_date: min_date=line.date_planned res[purchase.id]=min_date return res
def _minimum_planned_date(self, cr, uid, ids, field_name, arg, context=None): res={} purchase_obj=self.browse(cr, uid, ids, context=context) for purchase in purchase_obj: res[purchase.id] = time.strftime('%Y-%m-%d %H:%M:%S') if purchase.order_line: min_date=purchase.order_line[0].date_planned for line in purchase.order_line: if line.date_planned < min_date: min_date=line.date_planned res[purchase.id]=min_date return res
469,363
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} if not values: values = {} res = {} if not ids: return res for id in ids: res[id] = [] if offset: warnings.warn("Specifying offset at a many2many.get() may produce unpredictable results.", DeprecationWarning, stacklevel=2) obj = obj.pool.get(self._obj)
def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} if not values: values = {} res = {} if not ids: return res for id in ids: res[id] = [] if offset: warnings.warn("Specifying offset at a many2many.get() may produce unpredictable results.", DeprecationWarning, stacklevel=2) obj = obj.pool.get(self._obj)
469,364
def _fnct_read(self, obj, cr, uid, ids, prop_name, obj_dest, context=None): properties = obj.pool.get('ir.property') domain = [('fields_id.model', '=', obj._name), ('fields_id.name','in',prop_name)] domain += [('res_id','in', [obj._name + ',' + str(oid) for oid in ids])] nids = properties.search(cr, uid, domain, context=context) default_val,replaces = self._get_defaults(obj, cr, uid, prop_name, context)
def _fnct_read(self, obj, cr, uid, ids, prop_name, obj_dest, context=None): properties = obj.pool.get('ir.property') domain = [('fields_id.model', '=', obj._name), ('fields_id.name','in',prop_name)] domain += [('res_id','in', [obj._name + ',' + str(oid) for oid in ids])] nids = properties.search(cr, uid, domain, context=context) default_val,replaces = self._get_defaults(obj, cr, uid, prop_name, context)
469,365
def _get_new_period_start(self, cr, uid, context=None): cr.execute("select max(date_stop) from stock_period") result = cr.fetchone() last_date = result and result[0] or False if last_date: period_start = datetime(last_date,"%Y-%m-%d %H:%M:%S")+ relativedelta(days=1) period_start = period_start - relativedelta(hours=period_start.hour, minutes=period_start.minute, seconds=period_start.second) else: period_start = datetime.today() return period_start.strftime('%Y-%m-%d')
def _get_new_period_start(self, cr, uid, context=None): cr.execute("select max(date_stop) from stock_period") result = cr.fetchone() last_date = result and result[0] or False if last_date: period_start = datetime.strptime(last_date,"%Y-%m-%d %H:%M:%S")+ relativedelta(days=1) period_start = period_start - relativedelta(hours=period_start.hour, minutes=period_start.minute, seconds=period_start.second) else: period_start = datetime.today() return period_start.strftime('%Y-%m-%d')
469,366
def _get_new_period_start(self, cr, uid, context=None): cr.execute("select max(date_stop) from stock_period") result = cr.fetchone() last_date = result and result[0] or False if last_date: period_start = datetime(last_date,"%Y-%m-%d %H:%M:%S")+ relativedelta(days=1) period_start = period_start - relativedelta(hours=period_start.hour, minutes=period_start.minute, seconds=period_start.second) else: period_start = datetime.today() return period_start.strftime('%Y-%m-%d')
def _get_new_period_start(self, cr, uid, context=None): cr.execute("select max(date_stop) from stock_period") result = cr.fetchone() last_date = result and result[0] or False if last_date: period_start = datetime(last_date,"%Y-%m-%d %H:%M:%S")+ relativedelta(days=1) period_start = period_start - relativedelta(hours=period_start.hour, minutes=period_start.minute, seconds=period_start.second) else: period_start = datetime.today() return period_start.strftime('%Y-%m-%d')
469,367
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strftime('%Y-%m-%d') < p.date_stop: if name =='Daily': de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y-%m-%d') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name =="Weekly": de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y, week %W') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name == "Monthly": de = ds + relativedelta(months=interval, minutes=-1) new_name = ds.strftime('%Y/%m') new_id =period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(months=interval) lines.append(new_id) return { 'domain': "[('id','in', ["+','.join(map(str, lines))+"])]", 'view_type': 'form', "view_mode": 'tree, form', 'res_model': 'stock.period', 'type': 'ir.actions.act_window', }
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strftime('%Y-%m-%d') <= p.date_stop: if name =='Daily': de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y-%m-%d') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name =="Weekly": de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y, week %W') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name == "Monthly": de = ds + relativedelta(months=interval, minutes=-1) new_name = ds.strftime('%Y/%m') new_id =period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(months=interval) lines.append(new_id) return { 'domain': "[('id','in', ["+','.join(map(str, lines))+"])]", 'view_type': 'form', "view_mode": 'tree, form', 'res_model': 'stock.period', 'type': 'ir.actions.act_window', }
469,368
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strftime('%Y-%m-%d') < p.date_stop: if name =='Daily': de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y-%m-%d') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name =="Weekly": de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y, week %W') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name == "Monthly": de = ds + relativedelta(months=interval, minutes=-1) new_name = ds.strftime('%Y/%m') new_id =period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(months=interval) lines.append(new_id) return { 'domain': "[('id','in', ["+','.join(map(str, lines))+"])]", 'view_type': 'form', "view_mode": 'tree, form', 'res_model': 'stock.period', 'type': 'ir.actions.act_window', }
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strftime('%Y-%m-%d') < p.date_stop: if name =='Daily': de = ds + relativedelta(days=(interval + 1), seconds =-1) new_name = de.strftime('%Y-%m-%d') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name =="Weekly": de = ds + relativedelta(days=(interval + 1), seconds =-1) new_name = de.strftime('%Y, week %W') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name == "Monthly": de = ds + relativedelta(months=interval, minutes=-1) new_name = ds.strftime('%Y/%m') new_id =period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(months=interval) lines.append(new_id) return { 'domain': "[('id','in', ["+','.join(map(str, lines))+"])]", 'view_type': 'form', "view_mode": 'tree, form', 'res_model': 'stock.period', 'type': 'ir.actions.act_window', }
469,369
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strftime('%Y-%m-%d') < p.date_stop: if name =='Daily': de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y-%m-%d') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name =="Weekly": de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y, week %W') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name == "Monthly": de = ds + relativedelta(months=interval, minutes=-1) new_name = ds.strftime('%Y/%m') new_id =period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(months=interval) lines.append(new_id) return { 'domain': "[('id','in', ["+','.join(map(str, lines))+"])]", 'view_type': 'form', "view_mode": 'tree, form', 'res_model': 'stock.period', 'type': 'ir.actions.act_window', }
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strftime('%Y-%m-%d') < p.date_stop: if name =='Daily': de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y-%m-%d') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=(interval + 1)) if name =="Weekly": de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y, week %W') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=(interval + 1)) if name == "Monthly": de = ds + relativedelta(months=interval, minutes=-1) new_name = ds.strftime('%Y/%m') new_id =period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(months=interval) lines.append(new_id) return { 'domain': "[('id','in', ["+','.join(map(str, lines))+"])]", 'view_type': 'form', "view_mode": 'tree, form', 'res_model': 'stock.period', 'type': 'ir.actions.act_window', }
469,370
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strftime('%Y-%m-%d') < p.date_stop: if name =='Daily': de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y-%m-%d') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name =="Weekly": de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y, week %W') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name == "Monthly": de = ds + relativedelta(months=interval, minutes=-1) new_name = ds.strftime('%Y/%m') new_id =period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(months=interval) lines.append(new_id) return { 'domain': "[('id','in', ["+','.join(map(str, lines))+"])]", 'view_type': 'form', "view_mode": 'tree, form', 'res_model': 'stock.period', 'type': 'ir.actions.act_window', }
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strftime('%Y-%m-%d') < p.date_stop: if name =='Daily': de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y-%m-%d') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name =="Weekly": de = ds + relativedelta(days=(interval + 1), seconds =-1) if dt_stp < de: de = dt_stp + relativedelta(days=1,seconds =-1) else: de = ds + relativedelta(days=(interval + 1), seconds =-1) start_week = ds.strftime('%W') start_year = ds.strftime('%Y') end_week = de.strftime('%W') end_year = de.strftime('%Y') if start_year <> end_year: if end_week == '00': new_name = "Week " + start_week +"-" + start_year else: new_name = "Week " + start_week +", " + start_year +" - Week " +end_week +", " + end_year elif start_week == end_week: new_name = "Week " + start_week +"-" +start_year else: new_name = "Week " + start_week +"-" + end_week+", " + start_year new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name == "Monthly": de = ds + relativedelta(months=interval, minutes=-1) new_name = ds.strftime('%Y/%m') new_id =period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(months=interval) lines.append(new_id) return { 'domain': "[('id','in', ["+','.join(map(str, lines))+"])]", 'view_type': 'form', "view_mode": 'tree, form', 'res_model': 'stock.period', 'type': 'ir.actions.act_window', }
469,371
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strftime('%Y-%m-%d') < p.date_stop: if name =='Daily': de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y-%m-%d') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name =="Weekly": de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y, week %W') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name == "Monthly": de = ds + relativedelta(months=interval, minutes=-1) new_name = ds.strftime('%Y/%m') new_id =period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(months=interval) lines.append(new_id) return { 'domain': "[('id','in', ["+','.join(map(str, lines))+"])]", 'view_type': 'form', "view_mode": 'tree, form', 'res_model': 'stock.period', 'type': 'ir.actions.act_window', }
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strftime('%Y-%m-%d') < p.date_stop: if name =='Daily': de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y-%m-%d') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=(interval + 1)) if name =="Weekly": de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y, week %W') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=(interval + 1)) if name == "Monthly": de = ds + relativedelta(months=interval, minutes=-1) new_name = ds.strftime('%Y/%m') new_id =period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(months=interval) lines.append(new_id) return { 'domain': "[('id','in', ["+','.join(map(str, lines))+"])]", 'view_type': 'form', "view_mode": 'tree, form', 'res_model': 'stock.period', 'type': 'ir.actions.act_window', }
469,372
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strftime('%Y-%m-%d') < p.date_stop: if name =='Daily': de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y-%m-%d') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name =="Weekly": de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y, week %W') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name == "Monthly": de = ds + relativedelta(months=interval, minutes=-1) new_name = ds.strftime('%Y/%m') new_id =period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(months=interval) lines.append(new_id) return { 'domain': "[('id','in', ["+','.join(map(str, lines))+"])]", 'view_type': 'form', "view_mode": 'tree, form', 'res_model': 'stock.period', 'type': 'ir.actions.act_window', }
def create_stock_periods(self, cr, uid, ids, context=None): interval = context.get('interval',0) name = context.get('name','Daily') period_obj = self.pool.get('stock.period') lines = [] for p in self.browse(cr, uid, ids, context=context): dt = p.date_start ds = datetime.strptime(p.date_start, '%Y-%m-%d') while ds.strftime('%Y-%m-%d') < p.date_stop: if name =='Daily': de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y-%m-%d') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name =="Weekly": de = ds + relativedelta(days=interval, minutes =-1) new_name = de.strftime('%Y, week %W') new_id = period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(days=interval) + 1 if name == "Monthly": de = ds + relativedelta(months=interval, seconds=-1) if dt_stp < de: de = dt_stp + relativedelta(days=1,seconds =-1) else: de = ds + relativedelta(months=interval, seconds=-1) new_name = ds.strftime('%Y/%m') new_id =period_obj.create(cr, uid, { 'name': new_name, 'date_start': ds.strftime('%Y-%m-%d'), 'date_stop': de.strftime('%Y-%m-%d %H:%M:%S'), }) ds = ds + relativedelta(months=interval) lines.append(new_id) return { 'domain': "[('id','in', ["+','.join(map(str, lines))+"])]", 'view_type': 'form', "view_mode": 'tree, form', 'res_model': 'stock.period', 'type': 'ir.actions.act_window', }
469,373
def action_cancel(self, cr, uid, ids, *args): account_move_obj = self.pool.get('account.move') invoices = self.read(cr, uid, ids, ['move_id']) for i in invoices: if i['move_id']: account_move_obj.button_cancel(cr, uid, [i['move_id'][0]]) # delete the move this invoice was pointing to # Note that the corresponding move_lines and move_reconciles # will be automatically deleted too account_move_obj.unlink(cr, uid, [i['move_id'][0]]) self.write(cr, uid, ids, {'state':'cancel', 'move_id':False}) self._log_event(cr, uid, ids,-1.0, 'Cancel Invoice') return True
def action_cancel(self, cr, uid, ids, *args): account_move_obj = self.pool.get('account.move') invoices = self.read(cr, uid, ids, ['move_id', 'payment_ids']) for i in invoices: if i['move_id']: account_move_obj.button_cancel(cr, uid, [i['move_id'][0]]) # delete the move this invoice was pointing to # Note that the corresponding move_lines and move_reconciles # will be automatically deleted too account_move_obj.unlink(cr, uid, [i['move_id'][0]]) self.write(cr, uid, ids, {'state':'cancel', 'move_id':False}) self._log_event(cr, uid, ids,-1.0, 'Cancel Invoice') return True
469,374
def rename(self, src, datacr): """ Renaming operation, the effect depends on the src: * A file: read, create and remove * A directory: change the parent and reassign childs to ressource """ cr = datacr[0] try: nname = _to_unicode(datacr[2]) ret = src.move_to(cr, datacr[1], new_name=nname) # API shouldn't wait for us to write the object assert (ret is True) or (ret is False) cr.commit() except Exception,err: self._log.exception('Cannot rename "%s" to "%s" at "%s"', src, dst_basename, dst_basedir) raise OSError(1,'Operation not permited.')
def rename(self, src, datacr): """ Renaming operation, the effect depends on the src: * A file: read, create and remove * A directory: change the parent and reassign childs to ressource """ cr = datacr[0] try: nname = _to_unicode(datacr[2]) ret = src.move_to(cr, datacr[1], new_name=nname) # API shouldn't wait for us to write the object assert (ret is True) or (ret is False) cr.commit() except Exception,err: self._log.exception('Cannot rename "%s" to "%s" at "%s"', src, datacr[2], datacr[1]) raise OSError(1,'Operation not permited.')
469,375
def button_confirm(self, cr, uid, ids, context={}): done = [] res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users') account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') account_bank_statement_line_obj = \ self.pool.get('account.bank.statement.line')
def button_confirm(self, cr, uid, ids, context={}): done = [] res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users') account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') account_bank_statement_line_obj = \ self.pool.get('account.bank.statement.line')
469,376
def read_image(self, path): path_info = path.split(',') icon_path = addons.get_module_resource(path_info[0],path_info[1]) icon = tools.file_open(icon_path,'rb').read() return base64.encodestring(icon)
def read_image(self, path): path_info = path.split(',') icon_path = addons.get_module_resource(path_info[0],path_info[1]) icon = tools.file_open(icon_path,'rb').read() return base64.encodestring(icon)
469,377
def action_ship_create(self, cr, uid, ids, *args): wf_service = netsvc.LocalService("workflow") picking_id = False move_obj = self.pool.get('stock.move') proc_obj = self.pool.get('procurement.order') company = self.pool.get('res.users').browse(cr, uid, uid).company_id for order in self.browse(cr, uid, ids, context={}): proc_ids = [] output_id = order.shop_id.warehouse_id.lot_output_id.id picking_id = False for line in order.order_line: proc_id = False date_planned = datetime.now() + relativedelta(days=line.delay or 0.0) date_planned = (date_planned - timedelta(days=company.security_lead)).strftime('%Y-%m-%d %H:%M:%S')
def action_ship_create(self, cr, uid, ids, *args): wf_service = netsvc.LocalService("workflow") picking_id = False move_obj = self.pool.get('stock.move') proc_obj = self.pool.get('procurement.order') company = self.pool.get('res.users').browse(cr, uid, uid).company_id for order in self.browse(cr, uid, ids, context={}): proc_ids = [] output_id = order.shop_id.warehouse_id.lot_output_id.id picking_id = False for line in order.order_line: proc_id = False date_planned = datetime.now() + relativedelta(days=line.delay or 0.0) date_planned = (date_planned - timedelta(days=company.security_lead)).strftime('%Y-%m-%d %H:%M:%S')
469,378
def validate(self, cr, uid, ids, context={}): if context and ('__last_update' in context): del context['__last_update'] ok = True for move in self.browse(cr, uid, ids, context): #unlink analytic lines on move_lines for obj_line in move.line_id: for obj in obj_line.analytic_lines: self.pool.get('account.analytic.line').unlink(cr,uid,obj.id)
def validate(self, cr, uid, ids, context={}): if context and ('__last_update' in context): del context['__last_update'] ok = True for move in self.browse(cr, uid, ids, context): #unlink analytic lines on move_lines for obj_line in move.line_id: for obj in obj_line.analytic_lines: self.pool.get('account.analytic.line').unlink(cr,uid,obj.id)
469,379
def action_number(self, cr, uid, ids, *args): for obj_inv in self.browse(cr, uid, ids): id = obj_inv.id invtype = obj_inv.type number = obj_inv.number move_id = obj_inv.move_id and obj_inv.move_id.id or False reference = obj_inv.reference if not number: tmp_context = { 'fiscalyear_id': obj_inv.period_id.fiscalyear_id.id } if obj_inv.journal_id.invoice_sequence_id: sequence_id = obj_inv.journal_id.invoice_sequence_id.id number = self.pool.get('ir.sequence').get_id(cr, uid, sequence_id, 'id', context=tmp_context) else: number = self.pool.get('ir.sequence').get_id(cr, uid, 'account.invoice.%s' % invtype, 'code', context=tmp_context) if invtype in ('in_invoice', 'in_refund'): ref = reference else: ref = self._convert_ref(cr, uid, number) cr.execute('UPDATE account_invoice SET number=%s ' \ 'WHERE id=%s', (number, id)) cr.execute('UPDATE account_move SET ref=%s ' \ 'WHERE id=%s AND (ref is null OR ref = \'\')', (ref, move_id)) cr.execute('UPDATE account_move_line SET ref=%s ' \ 'WHERE move_id=%s AND (ref is null OR ref = \'\')', (ref, move_id)) cr.execute('UPDATE account_analytic_line SET ref=%s ' \ 'FROM account_move_line ' \ 'WHERE account_move_line.move_id = %s ' \ 'AND account_analytic_line.move_id = account_move_line.id', (ref, move_id)) for inv_id, name in self.name_get(cr, uid, [id]): message = _('Invoice ') + " '" + name + "' "+ _("is validated.") self.log(cr, uid, inv_id, message) return True
def action_number(self, cr, uid, ids, *args): for obj_inv in self.browse(cr, uid, ids): id = obj_inv.id invtype = obj_inv.type number = obj_inv.number move_id = obj_inv.move_id and obj_inv.move_id.id or False reference = obj_inv.reference or '' if not number: tmp_context = { 'fiscalyear_id': obj_inv.period_id.fiscalyear_id.id } if obj_inv.journal_id.invoice_sequence_id: sequence_id = obj_inv.journal_id.invoice_sequence_id.id number = self.pool.get('ir.sequence').get_id(cr, uid, sequence_id, 'id', context=tmp_context) else: number = self.pool.get('ir.sequence').get_id(cr, uid, 'account.invoice.%s' % invtype, 'code', context=tmp_context) if invtype in ('in_invoice', 'in_refund'): ref = reference else: ref = self._convert_ref(cr, uid, number) cr.execute('UPDATE account_invoice SET number=%s ' \ 'WHERE id=%s', (number, id)) cr.execute('UPDATE account_move SET ref=%s ' \ 'WHERE id=%s AND (ref is null OR ref = \'\')', (ref, move_id)) cr.execute('UPDATE account_move_line SET ref=%s ' \ 'WHERE move_id=%s AND (ref is null OR ref = \'\')', (ref, move_id)) cr.execute('UPDATE account_analytic_line SET ref=%s ' \ 'FROM account_move_line ' \ 'WHERE account_move_line.move_id = %s ' \ 'AND account_analytic_line.move_id = account_move_line.id', (ref, move_id)) for inv_id, name in self.name_get(cr, uid, [id]): message = _('Invoice ') + " '" + name + "' "+ _("is validated.") self.log(cr, uid, inv_id, message) return True
469,380
def _get_data(self, cr, uid, ids, field_name, arg, context={}): res = {} state_perc = 0.0 avg_ans = 0.0 for case in self.browse(cr, uid, ids, context): if field_name != 'avg_answers': state = field_name[5:] cr.execute("select count(*) from crm_opportunity where section_id =%s and state='%s'"%(case.section_id.id,state)) state_cases = cr.fetchone()[0] perc_state = (state_cases / float(case.nbr_cases) ) * 100 res[case.id] = perc_state else: model_name = self._name.split('report.') if len(model_name) < 2: res[case.id] = 0.0 else: model_name = model_name[1]
def _get_data(self, cr, uid, ids, field_name, arg, context={}): res = {} state_perc = 0.0 avg_ans = 0.0 for case in self.browse(cr, uid, ids, context): if field_name != 'avg_answers': state = field_name[5:] cr.execute("select count(*) from crm_opportunity where section_id =%s and state='%s'"%(case.section_id.id,state)) state_cases = cr.fetchone()[0] perc_state = (state_cases / float(case.nbr) ) * 100 res[case.id] = perc_state else: model_name = self._name.split('report.') if len(model_name) < 2: res[case.id] = 0.0 else: model_name = model_name[1]
469,381
def _get_data(self, cr, uid, ids, field_name, arg, context={}): res = {} state_perc = 0.0 avg_ans = 0.0 for case in self.browse(cr, uid, ids, context): if field_name != 'avg_answers': state = field_name[5:] cr.execute("select count(*) from crm_opportunity where section_id =%s and state='%s'"%(case.section_id.id,state)) state_cases = cr.fetchone()[0] perc_state = (state_cases / float(case.nbr_cases) ) * 100 res[case.id] = perc_state else: model_name = self._name.split('report.') if len(model_name) < 2: res[case.id] = 0.0 else: model_name = model_name[1]
def _get_data(self, cr, uid, ids, field_name, arg, context={}): res = {} state_perc = 0.0 avg_ans = 0.0 for case in self.browse(cr, uid, ids, context): if field_name != 'avg_answers': state = field_name[5:] cr.execute("select count(*) from crm_opportunity where section_id =%s and state='%s'"%(case.section_id.id,state)) state_cases = cr.fetchone()[0] perc_state = (state_cases / float(case.nbr_cases) ) * 100 res[case.id] = perc_state else: model_name = self._name.split('report.') if len(model_name) < 2: res[case.id] = 0.0 else: model_name = model_name[1]
469,382
def _get_data(self, cr, uid, ids, field_name, arg, context={}): res = {} state_perc = 0.0 avg_ans = 0.0 for case in self.browse(cr, uid, ids, context): if field_name != 'avg_answers': state = field_name[5:] cr.execute("select count(*) from crm_opportunity where section_id =%s and state='%s'"%(case.section_id.id,state)) state_cases = cr.fetchone()[0] perc_state = (state_cases / float(case.nbr_cases) ) * 100 res[case.id] = perc_state else: model_name = self._name.split('report.') if len(model_name) < 2: res[case.id] = 0.0 else: model_name = model_name[1]
def _get_data(self, cr, uid, ids, field_name, arg, context={}): res = {} state_perc = 0.0 avg_ans = 0.0 for case in self.browse(cr, uid, ids, context): if field_name != 'avg_answers': state = field_name[5:] cr.execute("select count(*) from crm_opportunity where section_id =%s and state='%s'"%(case.section_id.id,state)) state_cases = cr.fetchone()[0] perc_state = (state_cases / float(case.nbr_cases) ) * 100 res[case.id] = perc_state else: model_name = self._name.split('report.') if len(model_name) < 2: res[case.id] = 0.0 else: model_name = model_name[1]
469,383
def _mass_mail_send(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) hist_obj = pool.get('crm.case.history').browse(cr,uid,data['ids'])[0] model = hist_obj.log_id.model_id.model model_pool = pool.get(model) case = model_pool.browse(cr, uid, hist_obj.log_id.res_id) model_pool._history(cr, uid, [case], _('Send'), history=True, email=False) model_pool.write(cr, uid, [case.id], { 'som': False, 'canal_id': False, }) emails = [data['form']['to']] + (data['form']['cc'] or '').split(',') emails = filter(None, emails) body = data['form']['text'] if case.user_id.signature: body += '\n\n%s' % (case.user_id.signature) tools.email_send( case.user_id.address_id.email, emails, data['form']['subject'], model_pool.format_body(body), reply_to=case.section_id.reply_to, openobject_id=str(case.id), subtype="html" ) return {}
def _mass_mail_send(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) hist_obj = pool.get('crm.case.history').browse(cr,uid,data['ids'])[0] model = hist_obj.log_id.model_id.model model_pool = pool.get(model) case = model_pool.browse(cr, uid, hist_obj.log_id.res_id) model_pool._history(cr, uid, [case], _('Send'), history=True, email=False) emails = [data['form']['to']] + (data['form']['cc'] or '').split(',') emails = filter(None, emails) body = data['form']['text'] if case.user_id.signature: body += '\n\n%s' % (case.user_id.signature) tools.email_send( case.user_id.address_id.email, emails, data['form']['subject'], model_pool.format_body(body), reply_to=case.section_id.reply_to, openobject_id=str(case.id), subtype="html" ) return {}
469,384
def _eval_field(self, model, field_name, expression): column = model._columns[field_name] if is_ref(expression): if expression.model: other_model_name = expression.model else: other_model_name = column._obj other_model = self.get_model(other_model_name) if expression.search: q = eval(expression.search, self.eval_context) ids = other_model.search(self.cr, self.uid, q) if expression.use: instances = other_model.browse(self.cr, self.uid, ids) elements = [inst[expression.use] for inst in instances] else: elements = ids if column._type in ("many2many", "one2many"): value = [(6, 0, elements)] else: # many2one value = elements[0] elif column._type == "many2one": value = self.get_id(expression) elif column._type == "one2many": other_model = self.get_model(column._obj) value = [(0, 0, self._create_record(other_model, fields)) for fields in expression] elif column._type == "many2many": ids = [self.get_id(xml_id) for xml_id in expression] value = [(6, 0, ids)] else: # scalar field if is_eval(expression): value = eval(expression.expression, self.eval_context) else: value = expression # raise YamlImportException('Unsupported column "%s" or value %s:%s' % (field_name, type(expression), expression)) return value
def _eval_field(self, model, field_name, expression): column = model._columns[field_name] if is_ref(expression): if expression.model: other_model_name = expression.model else: other_model_name = column._obj other_model = self.get_model(other_model_name) if expression.search: q = eval(expression.search, self.eval_context) ids = other_model.search(self.cr, self.uid, q) if expression.use: instances = other_model.browse(self.cr, self.uid, ids) elements = [inst[expression.use] for inst in instances] else: elements = ids if column._type in ("many2many", "one2many"): value = [(6, 0, elements)] else: # many2one value = self._get_first_result(elements) elif column._type == "many2one": value = self.get_id(expression) elif column._type == "one2many": other_model = self.get_model(column._obj) value = [(0, 0, self._create_record(other_model, fields)) for fields in expression] elif column._type == "many2many": ids = [self.get_id(xml_id) for xml_id in expression] value = [(6, 0, ids)] else: # scalar field if is_eval(expression): value = eval(expression.expression, self.eval_context) else: value = expression # raise YamlImportException('Unsupported column "%s" or value %s:%s' % (field_name, type(expression), expression)) return value
469,385
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
469,386
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
defread_group(self,cr,uid,domain,fields,groupby,offset=0,limit=None,context=None):context=contextor{}self.pool.get('ir.model.access').check(cr,uid,self._name,'read',context=context)ifnotfields:fields=self._columns.keys()
469,387
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
469,388
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
469,389
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): context = context or {} self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) if not fields: fields = self._columns.keys()
469,390
def _cal_weight(self, cr, uid, ids, name, args, context=None): res = {} data_picking = self.browse(cr, uid, ids, context) for picking in data_picking: total_weight = 0.00 if picking.move_lines: weight = 0.00 for move in picking.move_lines: if move.product_id.weight > 0.00: weight = (move.product_uos_qty * move.product_id.weight) total_weight += weight res[picking.id] = total_weight return res
def _cal_weight(self, cr, uid, ids, name, args, context=None): res = {} uom_obj = self.pool.get('product.uom') for picking in self.browse(cr, uid, ids, context): total_weight = 0.00 if picking.move_lines: weight = 0.00 for move in picking.move_lines: if move.product_id.weight > 0.00: weight = (move.product_uos_qty * move.product_id.weight) total_weight += weight res[picking.id] = total_weight return res
469,391
def _cal_weight(self, cr, uid, ids, name, args, context=None): res = {} data_picking = self.browse(cr, uid, ids, context) for picking in data_picking: total_weight = 0.00 if picking.move_lines: weight = 0.00 for move in picking.move_lines: if move.product_id.weight > 0.00: weight = (move.product_uos_qty * move.product_id.weight) total_weight += weight res[picking.id] = total_weight return res
def _cal_weight(self, cr, uid, ids, name, args, context=None): res = {} data_picking = self.browse(cr, uid, ids, context) for picking in data_picking: total_weight = 0.00 for move in picking.move_lines: total_weight += move.weight res[picking.id] = total_weight return res
469,392
def _get_picking_line(self, cr, uid, ids, context=None): result = {} for line in self.pool.get('stock.move').browse(cr, uid, ids, context=context): result[line.picking_id.id] = True return result.keys()
def _get_picking_line(self, cr, uid, ids, context=None): result = {} for line in self.pool.get('stock.move').browse(cr, uid, ids, context=context): result[line.picking_id.id] = True return result.keys()
469,393
def _compute_price(bom): print bom.product_id price = 0
def _compute_price(bom): print bom.product_id price = 0
469,394
def _compute_price(bom): print bom.product_id price = 0
def _compute_price(bom): print bom.product_id price = 0
469,395
def _process_text(self, txt): if not self.localcontext: return str2xml(txt) if not txt: return '' result = '' sps = _regex.split(txt) while sps: # This is a simple text to translate to_translate = tools.ustr(sps.pop(0)) result += tools.ustr(self.localcontext.get('translate', lambda x:x)(to_translate)) if sps: try: txt = None expr = sps.pop(0) txt = eval(expr, self.localcontext) if txt and isinstance(txt, basestring): txt = tools.ustr(txt) except Exception: pass if isinstance(txt, basestring): result += str2xml(txt) elif (txt is not None) and (txt is not False): result += txt return result
def _process_text(self, txt): if not self.localcontext: return str2xml(txt) if not txt: return '' result = '' sps = _regex.split(txt) while sps: # This is a simple text to translate to_translate = tools.ustr(sps.pop(0)) result += tools.ustr(self.localcontext.get('translate', lambda x:x)(to_translate)) if sps: try: txt = None expr = sps.pop(0) txt = eval(expr, self.localcontext) if txt and isinstance(txt, basestring): txt = tools.ustr(txt) except Exception: pass if isinstance(txt, basestring): result += str2xml(txt) elif (txt is not None) and (txt is not False): result += unicode(txt) return result
469,396
def onchange_move_id(self, cr, uid, ids, prod_id=False, move_id=False): """ On change of move id sets values of guarantee limit, source location, destination location, partner and partner address. @param prod_id: Id of product in current record. @param move_id: Changed move. @return: Dictionary of values. """ data = {} data['value'] = {} if not prod_id: return data if move_id: move = self.pool.get('stock.move').browse(cr, uid, move_id) product = self.pool.get('product.product').browse(cr, uid, prod_id) limit = datetime.strptime(move.date_planned, '%Y-%m-%d %H:%M:%S') + relativedelta(months=product.warranty) data['value']['guarantee_limit'] = limit.strftime('%Y-%m-%d') data['value']['location_id'] = move.location_dest_id.id data['value']['location_dest_id'] = move.location_dest_id.id if move.address_id: data['value']['partner_id'] = move.address_id.partner_id and move.address_id.partner_id.id else: data['value']['partner_id'] = False data['value']['address_id'] = move.address_id and move.address_id.id d = self.onchange_partner_id(cr, uid, ids, data['value']['partner_id'], data['value']['address_id']) data['value'].update(d['value']) return data
def onchange_move_id(self, cr, uid, ids, prod_id=False, move_id=False): """ On change of move id sets values of guarantee limit, source location, destination location, partner and partner address. @param prod_id: Id of product in current record. @param move_id: Changed move. @return: Dictionary of values. """ data = {} data['value'] = {} if not prod_id: return data if move_id: move = self.pool.get('stock.move').browse(cr, uid, move_id) product = self.pool.get('product.product').browse(cr, uid, prod_id) limit = datetime.strptime(move.date_expected, '%Y-%m-%d %H:%M:%S') + relativedelta(months=product.warranty) data['value']['guarantee_limit'] = limit.strftime('%Y-%m-%d') data['value']['location_id'] = move.location_dest_id.id data['value']['location_dest_id'] = move.location_dest_id.id if move.address_id: data['value']['partner_id'] = move.address_id.partner_id and move.address_id.partner_id.id else: data['value']['partner_id'] = False data['value']['address_id'] = move.address_id and move.address_id.id d = self.onchange_partner_id(cr, uid, ids, data['value']['partner_id'], data['value']['address_id']) data['value'].update(d['value']) return data
469,397
def refund(self, cr, uid, ids, date=None, period_id=None, description=None): map_old_new = {} refund_ids = [] for old_inv_id in ids: new_id = super(account_invoice,self).refund(cr, uid, ids, date=date, period_id=period_id, description=description) refund_ids += new_id map_old_new[old_inv_id] = new_id[0]
def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None): map_old_new = {} refund_ids = [] for old_inv_id in ids: new_id = super(account_invoice,self).refund(cr, uid, ids, date=date, period_id=period_id, description=description) refund_ids += new_id map_old_new[old_inv_id] = new_id[0]
469,398
def refund(self, cr, uid, ids, date=None, period_id=None, description=None): map_old_new = {} refund_ids = [] for old_inv_id in ids: new_id = super(account_invoice,self).refund(cr, uid, ids, date=date, period_id=period_id, description=description) refund_ids += new_id map_old_new[old_inv_id] = new_id[0]
def refund(self, cr, uid, ids, date=None, period_id=None, description=None): map_old_new = {} refund_ids = [] for old_inv_id in ids: new_id = super(account_invoice,self).refund(cr, uid, ids, date=date, period_id=period_id, description=description, journal_id=journal_id) refund_ids += new_id map_old_new[old_inv_id] = new_id[0]
469,399