rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
def _get_discount_invoice(self, cursor, user, move_line):
def _get_discount_invoice(self, cr, uid, move_line):
def _get_discount_invoice(self, cursor, user, move_line): '''Return the discount for the move line''' return 0.0
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def _get_taxes_invoice(self, cursor, user, move_line, type):
def _get_taxes_invoice(self, cr, uid, move_line, type):
def _get_taxes_invoice(self, cursor, user, move_line, type): '''Return taxes ids for the move line''' if type in ('in_invoice', 'in_refund'): taxes = move_line.product_id.supplier_taxes_id else: taxes = move_line.product_id.taxes_id
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
cursor, user,
cr, uid,
def _get_taxes_invoice(self, cursor, user, move_line, type): '''Return taxes ids for the move line''' if type in ('in_invoice', 'in_refund'): taxes = move_line.product_id.supplier_taxes_id else: taxes = move_line.product_id.taxes_id
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def _get_account_analytic_invoice(self, cursor, user, picking, move_line):
def _get_account_analytic_invoice(self, cr, uid, picking, move_line):
def _get_account_analytic_invoice(self, cursor, user, picking, move_line): return False
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def _invoice_line_hook(self, cursor, user, move_line, invoice_line_id):
def _invoice_line_hook(self, cr, uid, move_line, invoice_line_id):
def _invoice_line_hook(self, cursor, user, move_line, invoice_line_id): '''Call after the creation of the invoice line''' return
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def _invoice_hook(self, cursor, user, picking, invoice_id):
def _invoice_hook(self, cr, uid, picking, invoice_id):
def _invoice_hook(self, cursor, user, picking, invoice_id): '''Call after the creation of the invoice''' return
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def action_invoice_create(self, cursor, user, ids, journal_id=False,
def action_invoice_create(self, cr, uid, ids, journal_id=False,
def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') invoices_group = {} res = {}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
for picking in self.browse(cursor, user, ids, context=context):
for picking in self.browse(cr, uid, ids, context=context):
def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') invoices_group = {} res = {}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
payment_term_id = self._get_payment_term(cursor, user, picking)
payment_term_id = self._get_payment_term(cr, uid, picking)
def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') invoices_group = {} res = {}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
self._get_address_invoice(cursor, user, picking).values() comment = self._get_comment_invoice(cursor, user, picking)
self._get_address_invoice(cr, uid, picking).values() comment = self._get_comment_invoice(cr, uid, picking)
def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') invoices_group = {} res = {}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
invoice = invoice_obj.browse(cursor, user, invoice_id)
invoice = invoice_obj.browse(cr, uid, invoice_id)
def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') invoices_group = {} res = {}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
invoice_obj.write(cursor, user, [invoice_id], invoice_vals, context=context)
invoice_obj.write(cr, uid, [invoice_id], invoice_vals, context=context)
def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') invoices_group = {} res = {}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
cur_id = self.get_currency_id(cursor, user, picking)
cur_id = self.get_currency_id(cr, uid, picking)
def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') invoices_group = {} res = {}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
invoice_id = invoice_obj.create(cursor, user, invoice_vals,
invoice_id = invoice_obj.create(cr, uid, invoice_vals,
def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') invoices_group = {} res = {}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
price_unit = self._get_price_unit_invoice(cursor, user,
price_unit = self._get_price_unit_invoice(cr, uid,
def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') invoices_group = {} res = {}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
discount = self._get_discount_invoice(cursor, user, move_line) tax_ids = self._get_taxes_invoice(cursor, user, move_line, type) account_analytic_id = self._get_account_analytic_invoice(cursor, user, picking, move_line)
discount = self._get_discount_invoice(cr, uid, move_line) tax_ids = self._get_taxes_invoice(cr, uid, move_line, type) account_analytic_id = self._get_account_analytic_invoice(cr, uid, picking, move_line)
def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') invoices_group = {} res = {}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
account_id = self.pool.get('account.fiscal.position').map_account(cursor, user, partner.property_account_position, account_id)
account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, partner.property_account_position, account_id)
def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') invoices_group = {} res = {}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
invoice_line_id = invoice_line_obj.create(cursor, user, {
invoice_line_id = invoice_line_obj.create(cr, uid, {
def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') invoices_group = {} res = {}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
self._invoice_line_hook(cursor, user, move_line, invoice_line_id) invoice_obj.button_compute(cursor, user, [invoice_id], context=context,
self._invoice_line_hook(cr, uid, move_line, invoice_line_id) invoice_obj.button_compute(cr, uid, [invoice_id], context=context,
def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') invoices_group = {} res = {}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
self.write(cursor, user, [picking.id], {
self.write(cr, uid, [picking.id], {
def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') invoices_group = {} res = {}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
self._invoice_hook(cursor, user, picking, invoice_id) self.write(cursor, user, res.keys(), {
self._invoice_hook(cr, uid, picking, invoice_id) self.write(cr, uid, res.keys(), {
def action_invoice_create(self, cursor, user, ids, journal_id=False, group=False, type='out_invoice', context=None): '''Return ids of created invoices for the pickings''' invoice_obj = self.pool.get('account.invoice') invoice_line_obj = self.pool.get('account.invoice.line') invoices_group = {} res = {}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
@ partial_datas : dict. contain details of partial picking
@ partial_datas : dict. contain details of partial picking
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
partial_data = partial_datas.get('move%s'%(move.id), False)
partial_data = partial_datas.get('move%s'%(move.id), False)
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
product_uom = partial_data.get('product_uom',False)
product_uom = partial_data.get('product_uom',False)
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
user = users_obj.browse(cr, uid, uid) context['currency_id'] = move.company_id.currency_id.id
user = users_obj.browse(cr, uid, uid) context['currency_id'] = move.company_id.currency_id.id
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
product.uom_id.id)
product.uom_id.id)
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
'picking_id' : new_picking,
'picking_id' : new_picking,
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
'move_dest_id': False,
'move_dest_id': False,
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_done', cr)
wf_service.trg_validate(uid, 'stock.picking', pick.id, 'button_done', cr)
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
delivered_pack = self.browse(cr, uid, delivered_pack_id, context=context)
delivered_pack = self.browse(cr, uid, delivered_pack_id, context=context)
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
'name': delivered_pack.name,
'name': delivered_pack.name,
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
'picking_id' : pick.id, 'move_delivered' : [(6,0, map(lambda x:x.id, delivered_pack.move_lines))] }, context=context)
'picking_id' : pick.id, 'move_delivered' : [(6,0, map(lambda x:x.id, delivered_pack.move_lines))] }, context=context)
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} move_obj = self.pool.get('stock.move') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) for pick in self.browse(cr, uid, ids, context=context): new_picking = None new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def _stock_search(self, cr, uid, obj, name, args, context): locations = self.pool.get('stock.location').search(cr, uid, [('usage', '=', 'internal')]) cr.execute('''select prodlot_id, sum(name) from stock_report_prodlots where location_id =ANY(%s) group by prodlot_id having sum(name) '''+ str(args[0][1]) + str(args[0][2]),(locations,)) res = cr.fetchall() ids = [('id', 'in', map(lambda x: x[0], res))] return ids
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def _stock_search(self, cr, uid, obj, name, args, context): locations = self.pool.get('stock.location').search(cr, uid, [('usage', '=', 'internal')]) cr.execute('''select prodlot_id, sum(name) from stock_report_prodlots where location_id =ANY(%s) group by prodlot_id having sum(name) '''+ str(args[0][1]) + str(args[0][2]),(locations,)) res = cr.fetchall() ids = [('id', 'in', map(lambda x: x[0], res))] return ids
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def _stock_search(self, cr, uid, obj, name, args, context): locations = self.pool.get('stock.location').search(cr, uid, [('usage', '=', 'internal')]) cr.execute('''select prodlot_id, sum(name) from stock_report_prodlots where location_id =ANY(%s) group by prodlot_id having sum(name) '''+ str(args[0][1]) + str(args[0][2]),(locations,)) res = cr.fetchall() ids = [('id', 'in', map(lambda x: x[0], res))] return ids
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
'name': fields.char('Name', size=60, required=True),
'name': fields.char('Name', size=60, required=True),
def _stock_search(self, cr, uid, obj, name, args, context): locations = self.pool.get('stock.location').search(cr, uid, [('usage', '=', 'internal')]) cr.execute('''select prodlot_id, sum(name) from stock_report_prodlots where location_id =ANY(%s) group by prodlot_id having sum(name) '''+ str(args[0][1]) + str(args[0][2]),(locations,)) res = cr.fetchall() ids = [('id', 'in', map(lambda x: x[0], res))] return ids
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def _stock_search(self, cr, uid, obj, name, args, context): locations = self.pool.get('stock.location').search(cr, uid, [('usage', '=', 'internal')]) cr.execute('''select prodlot_id, sum(name) from stock_report_prodlots where location_id =ANY(%s) group by prodlot_id having sum(name) '''+ str(args[0][1]) + str(args[0][2]),(locations,)) res = cr.fetchall() ids = [('id', 'in', map(lambda x: x[0], res))] return ids
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
'scraped': fields.boolean('Scraped'),
'scraped': fields.boolean('Scraped'),
def _check_product_lot(self, cr, uid, ids): for move in self.browse(cr, uid, ids): if move.prodlot_id and (move.prodlot_id.product_id.id != move.product_id.id): return False return True
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def check_assign(self, cr, uid, ids, context={}): done = [] count = 0 pickings = {} for move in self.browse(cr, uid, ids): if move.product_id.type == 'consu': if move.state in ('confirmed', 'waiting'): done.append(move.id) pickings[move.picking_id.id] = 1 continue if move.state in ('confirmed', 'waiting'): res = self.pool.get('stock.location')._product_reserve(cr, uid, [move.location_id.id], move.product_id.id, move.product_qty, {'uom': move.product_uom.id}) if res: #_product_available_test depends on the next status for correct functioning #the test does not work correctly if the same product occurs multiple times #in the same order. This is e.g. the case when using the button 'split in two' of #the stock outgoing form self.write(cr, uid, move.id, {'state':'assigned'}) done.append(move.id) pickings[move.picking_id.id] = 1 r = res.pop(0) cr.execute('update stock_move set location_id=%s, product_qty=%s where id=%s', (r[1], r[0], move.id))
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
return True
return True
def action_cancel(self, cr, uid, ids, context={}): if not len(ids): return True pickings = {} for move in self.browse(cr, uid, ids): if move.state in ('confirmed', 'waiting', 'assigned', 'draft'): if move.picking_id: pickings[move.picking_id.id] = True if move.move_dest_id and move.move_dest_id.state == 'waiting': self.write(cr, uid, [move.move_dest_id.id], {'state': 'assigned'}) if context.get('call_unlink',False) and 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) self.write(cr, uid, ids, {'state': 'cancel', 'move_dest_id': False}) if not context.get('call_unlink',False): for pick in self.pool.get('stock.picking').browse(cr, uid, pickings.keys()): if all(move.state == 'cancel' for move in pick.move_lines): self.pool.get('stock.picking').write(cr, uid, [pick.id], {'state': 'cancel'})
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def action_done(self, cr, uid, ids, context=None): track_flag = False picking_ids = [] 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)
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
cr, uid, ids, context=context)
cr, uid, ids, context=context)
def unlink(self, cr, uid, ids, context=None): for move in self.browse(cr, uid, ids, context=context): if move.state != 'draft': raise osv.except_osv(_('UserError'), _('You can only delete draft moves.')) return super(stock_move, self).unlink( cr, uid, ids, context=context)
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
prodlot = prodlot_obj.browse(cr, uid, prodlot_id)
prodlot = prodlot_obj.browse(cr, uid, prodlot_id)
def _create_lot(self, cr, uid, ids, product_id, prefix=False): prodlot_obj = self.pool.get('stock.production.lot') ir_sequence_obj = self.pool.get('ir.sequence') sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial') if not sequence: raise osv.except_osv(_('Error!'), _('No production sequence defined')) prodlot_id = prodlot_obj.create(cr, uid, {'name': sequence, 'prefix': prefix}, {'product_id': product_id}) prodlot = prodlot_obj.browse(cr, uid, prodlot_id) ref = ','.join(map(lambda x:str(x),ids)) if prodlot.ref: ref = '%s, %s' % (prodlot.ref, ref) prodlot_obj.write(cr, uid, [prodlot_id], {'ref': ref}) return prodlot_id
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
ref = '%s, %s' % (prodlot.ref, ref)
ref = '%s, %s' % (prodlot.ref, ref)
def _create_lot(self, cr, uid, ids, product_id, prefix=False): prodlot_obj = self.pool.get('stock.production.lot') ir_sequence_obj = self.pool.get('ir.sequence') sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial') if not sequence: raise osv.except_osv(_('Error!'), _('No production sequence defined')) prodlot_id = prodlot_obj.create(cr, uid, {'name': sequence, 'prefix': prefix}, {'product_id': product_id}) prodlot = prodlot_obj.browse(cr, uid, prodlot_id) ref = ','.join(map(lambda x:str(x),ids)) if prodlot.ref: ref = '%s, %s' % (prodlot.ref, ref) prodlot_obj.write(cr, uid, [prodlot_id], {'ref': ref}) return prodlot_id
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
Move the scrap/damaged product into scrap location
Move the scrap/damaged product into scrap location
def action_scrap(self, cr, uid, ids, quantity, location_id, context=None): ''' Move the scrap/damaged product into scrap location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be scraped @ param quantity : specify scrap qty @ param location_id : specify scrap location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
'''
'''
def action_scrap(self, cr, uid, ids, quantity, location_id, context=None): ''' Move the scrap/damaged product into scrap location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be scraped @ param quantity : specify scrap qty @ param location_id : specify scrap location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
res = [] for move in self.browse(cr, uid, ids, context=context):
res = [] for move in self.browse(cr, uid, ids, context=context):
def action_scrap(self, cr, uid, ids, quantity, location_id, context=None): ''' Move the scrap/damaged product into scrap location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be scraped @ param quantity : specify scrap qty @ param location_id : specify scrap location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
'product_qty': quantity, 'product_uos_qty': uos_qty, 'state': move.state, 'scraped' : True,
'product_qty': quantity, 'product_uos_qty': uos_qty, 'state': move.state, 'scraped' : True,
def action_scrap(self, cr, uid, ids, quantity, location_id, context=None): ''' Move the scrap/damaged product into scrap location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be scraped @ param quantity : specify scrap qty @ param location_id : specify scrap location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
res += [new_move]
res += [new_move]
def action_scrap(self, cr, uid, ids, quantity, location_id, context=None): ''' Move the scrap/damaged product into scrap location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be scraped @ param quantity : specify scrap qty @ param location_id : specify scrap location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def action_split(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None): ''' Split Stock Move lines into production lot which specified split by quantity. @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be splited @ param split_by_qty : specify split by qty @ param prefix : specify prefix of production lot @ param with_lot : if true, prodcution lot will assign for split line otherwise not. @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
'''
'''
def action_split(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None): ''' Split Stock Move lines into production lot which specified split by quantity. @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be splited @ param split_by_qty : specify split by qty @ param prefix : specify prefix of production lot @ param with_lot : if true, prodcution lot will assign for split line otherwise not. @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
for move in self.browse(cr, uid, ids):
for move in self.browse(cr, uid, ids):
def action_split(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None): ''' Split Stock Move lines into production lot which specified split by quantity. @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be splited @ param split_by_qty : specify split by qty @ param prefix : specify prefix of production lot @ param with_lot : if true, prodcution lot will assign for split line otherwise not. @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
} for idx in range(int(quantity//split_by_qty)):
} for idx in range(int(quantity//split_by_qty)):
def action_split(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None): ''' Split Stock Move lines into production lot which specified split by quantity. @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be splited @ param split_by_qty : specify split by qty @ param prefix : specify prefix of production lot @ param with_lot : if true, prodcution lot will assign for split line otherwise not. @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
if quantity_rest > 0: idx = int(quantity//split_by_qty)
if quantity_rest > 0: idx = int(quantity//split_by_qty)
def action_split(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None): ''' Split Stock Move lines into production lot which specified split by quantity. @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be splited @ param split_by_qty : specify split by qty @ param prefix : specify prefix of production lot @ param with_lot : if true, prodcution lot will assign for split line otherwise not. @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
update_val['product_uos_qty'] = uos_qty_rest if not idx and move.product_qty<=quantity: current_move = move.id
update_val['product_uos_qty'] = uos_qty_rest if not idx and move.product_qty<=quantity: current_move = move.id
def action_split(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None): ''' Split Stock Move lines into production lot which specified split by quantity. @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be splited @ param split_by_qty : specify split by qty @ param prefix : specify prefix of production lot @ param with_lot : if true, prodcution lot will assign for split line otherwise not. @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
current_move = self.copy(cr, uid, move.id, {'state': move.state})
current_move = self.copy(cr, uid, move.id, {'state': move.state})
def action_split(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None): ''' Split Stock Move lines into production lot which specified split by quantity. @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be splited @ param split_by_qty : specify split by qty @ param prefix : specify prefix of production lot @ param with_lot : if true, prodcution lot will assign for split line otherwise not. @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
if with_lot:
if with_lot:
def action_split(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None): ''' Split Stock Move lines into production lot which specified split by quantity. @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be splited @ param split_by_qty : specify split by qty @ param prefix : specify prefix of production lot @ param with_lot : if true, prodcution lot will assign for split line otherwise not. @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
return res def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None):
return res def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None):
def action_split(self, cr, uid, ids, quantity, split_by_qty=1, prefix=False, with_lot=True, context=None): ''' Split Stock Move lines into production lot which specified split by quantity. @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be splited @ param split_by_qty : specify split by qty @ param prefix : specify prefix of production lot @ param with_lot : if true, prodcution lot will assign for split line otherwise not. @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
@ param location_id : specify source location
@ param location_id : specify source location
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
'''
'''
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
res = [] for move in self.browse(cr, uid, ids, context=context):
res = [] for move in self.browse(cr, uid, ids, context=context):
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
quantity_rest -= quantity uos_qty_rest = quantity_rest / move_qty * move.product_uos_qty
quantity_rest -= quantity uos_qty_rest = quantity_rest / move_qty * move.product_uos_qty
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
quantity_rest = 0
quantity_rest = 0
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
if quantity_rest > 0:
if quantity_rest > 0:
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
'product_qty': quantity, 'product_uos_qty': uos_qty, 'state': move.state,
'product_qty': quantity, 'product_uos_qty': uos_qty, 'state': move.state,
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
}
}
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
update_val = {}
update_val = {}
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
update_val['product_uos_qty'] = uos_qty_rest self.write(cr, uid, [move.id], update_val) else: quantity_rest = quantity
update_val['product_uos_qty'] = uos_qty_rest self.write(cr, uid, [move.id], update_val) else: quantity_rest = quantity
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
else: res += [move.id]
else: res += [move.id]
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
}
}
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
self.action_done(cr, uid, res) return res
self.action_done(cr, uid, res) return res
def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
@ partial_datas : dict. contain details of partial picking
@ partial_datas : dict. contain details of partial picking
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
partial_data = partial_datas.get('move%s'%(move.id), False)
partial_data = partial_datas.get('move%s'%(move.id), False)
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
product_uom = partial_data.get('product_uom',False)
product_uom = partial_data.get('product_uom',False)
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
user = users_obj.browse(cr, uid, uid) context['currency_id'] = move.company_id.currency_id.id
user = users_obj.browse(cr, uid, uid) context['currency_id'] = move.company_id.currency_id.id
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
product.uom_id.id)
product.uom_id.id)
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
for move in too_few: product_qty = move_product_qty[move.id]
for move in too_few: product_qty = move_product_qty[move.id]
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
complete.append(move)
complete.append(move)
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
SELECT move.id FROM stock_picking pick RIGHT JOIN stock_move move ON move.picking_id = pick.id AND move.state = %s
SELECT move.id FROM stock_picking pick RIGHT JOIN stock_move move ON move.picking_id = pick.id AND move.state = %s
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
res = cr.fetchall() if len(res) == len(move.picking_id.move_lines): picking_obj.action_move(cr, uid, [move.picking_id.id]) wf_service.trg_validate(uid, 'stock.picking', move.picking_id.id, 'button_done', cr) ref = {}
res = cr.fetchall() if len(res) == len(move.picking_id.move_lines): picking_obj.action_move(cr, uid, [move.picking_id.id]) wf_service.trg_validate(uid, 'stock.picking', move.picking_id.id, 'button_done', cr) ref = {}
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
for move in complete: done_move_ids.append(move.id) if move.picking_id.id not in ref: delivery_id = delivery_obj.create(cr, uid, {
for move in complete: done_move_ids.append(move.id) if move.picking_id.id not in ref: delivery_id = delivery_obj.create(cr, uid, {
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def do_partial(self, cr, uid, ids, partial_datas, context={}): """ @ partial_datas : dict. contain details of partial picking like partner_id, address_id, delivery_date, delivery moves with product_id, product_qty, uom """ res = {} picking_obj = self.pool.get('stock.picking') delivery_obj = self.pool.get('stock.delivery') product_obj = self.pool.get('product.product') currency_obj = self.pool.get('res.currency') users_obj = self.pool.get('res.users') uom_obj = self.pool.get('product.uom') price_type_obj = self.pool.get('product.price.type') sequence_obj = self.pool.get('ir.sequence') wf_service = netsvc.LocalService("workflow") partner_id = partial_datas.get('partner_id', False) address_id = partial_datas.get('address_id', False) delivery_date = partial_datas.get('delivery_date', False) new_moves = []
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
def action_done(self, cr, uid, ids, context=None): for inv in self.browse(cr, uid, ids): move_ids = [] move_line = [] for line in inv.inventory_line_id: pid = line.product_id.id # price = line.product_id.standard_price or 0.0 amount = self.pool.get('stock.location')._product_get(cr, uid, line.location_id.id, [pid], {'uom': line.product_uom.id})[pid] change = line.product_qty - amount lot_id = line.prod_lot_id.id if change: location_id = line.product_id.product_tmpl_id.property_stock_inventory.id value = { 'name': 'INV:' + str(line.inventory_id.id) + ':' + line.inventory_id.name, 'product_id': line.product_id.id, 'product_uom': line.product_uom.id, 'prodlot_id': lot_id, 'date': inv.date, 'date_planned': inv.date, 'state': 'assigned' } if change > 0: value.update( { 'product_qty': change, 'location_id': location_id, 'location_dest_id': line.location_id.id, }) else: value.update( { 'product_qty': -change, 'location_id': line.location_id.id, 'location_dest_id': location_id, }) if lot_id: value.update({ 'prodlot_id': lot_id, 'product_qty': line.product_qty }) move_ids.append(self._inventory_line_hook(cr, uid, line, value)) if len(move_ids): self.pool.get('stock.move').action_done(cr, uid, move_ids, context=context) self.write(cr, uid, [inv.id], {'state': 'done', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S'), 'move_ids': [(6, 0, move_ids)]}) return True
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
stock_warehouse()
stock_warehouse()
def on_change_product_id(self, cr, uid, ids, location_id, product, uom=False): if not product: return {} if not uom: prod = self.pool.get('product.product').browse(cr, uid, [product], {'uom': uom})[0] uom = prod.uom_id.id amount = self.pool.get('stock.location')._product_get(cr, uid, location_id, [product], {'uom': uom})[product] result = {'product_qty': amount, 'product_uom': uom} return {'value': result}
18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py
self._inherits_check()
def __init__(self, cr): super(orm, self).__init__(cr)
57191c139d6a79e1734d22b57cecd4017dd1a220 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/57191c139d6a79e1734d22b57cecd4017dd1a220/orm.py
ids = self.search(cr, user, args, limit=limit, context=context)
if name: ids = self.search(cr, user, [('description', '=', name)] + args, limit=limit, context=context) if not ids: ids = self.search(cr, user, [('name', operator, name)] + args, limit=limit, context=context) else: ids = self.search(cr, user, args, limit=limit, context=context or {})
Returns a list of tupples containing id, name, as internally it is called {def name_get}
37ff846bd1ecacbf15e15e02bb117bc9b765222d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/37ff846bd1ecacbf15e15e02bb117bc9b765222d/account.py
self.ical_set(cal_data.name.lower(), {'name':cal_data.params['CN']}, 'value')
self.ical_set(cal_data.name.lower(), {'name': cal_data.params['CN'][0]}, 'value') continue
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 """
ac2207504c19709e58fb91c4311d5517e071e68d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ac2207504c19709e58fb91c4311d5517e071e68d/calendar.py