[MERGE] rename address_id into parnter_id

bzr revid: sbh@tinyerp.com-20120330085848-2gmfjgadftc1a4bq
This commit is contained in:
Sbh (Openerp) 2012-03-30 14:28:48 +05:30
commit eb1986a7df
26 changed files with 132 additions and 134 deletions

View File

@ -89,7 +89,7 @@ class stock_picking(osv.osv):
_inherit = "stock.picking"
def _get_account_analytic_invoice(self, cursor, user, picking, move_line):
partner_id = picking.address_id and picking.address_id.id or False
partner_id = picking.partner_id and picking.partner_id.id or False
rec = self.pool.get('account.analytic.default').account_get(cursor, user, move_line.product_id.id, partner_id , user, time.strftime('%Y-%m-%d'), context={})
if rec:

View File

@ -3,7 +3,7 @@
<act_window id="action_claim_from_delivery" name="Claim"
domain="[]" target="current"
context="{'default_partner_address_id': address_id, 'default_partner_id': partner_id}"
context="{'default_partner_id': partner_id}"
view_mode="form" res_model="crm.claim"
src_model="stock.picking" />

View File

@ -189,7 +189,7 @@
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_out_form"/>
<field name="arch" type="xml">
<field name="address_id" position="after">
<field name="partner_id" position="after">
<field name="carrier_id"/>
<field name="carrier_tracking_ref" groups="base.group_extended"/>
<field name="number_of_packages" groups="base.group_extended"/>

View File

@ -134,8 +134,8 @@
<para style="terp_default_9">[[ o.sale_id and o.sale_id.partner_invoice_id and display_address(o.sale_id.partner_invoice_id) ]]</para>
</td>
<td>
<para style="terp_default_9">[[ o.address_id and o.address_id and o.address_id.name or '' ]]</para>
<para style="terp_default_9">[[ o.address_id and o.address_id and display_address(o.address_id) ]]</para>
<para style="terp_default_9">[[ o.partner_id and o.partner_id and o.partner_id.name or '' ]]</para>
<para style="terp_default_9">[[ o.partner_id and o.partner_id and display_address(o.partner_id) ]]</para>
</td>
</tr>
</blockTable>

View File

@ -84,7 +84,7 @@ class stock_picking(osv.osv):
for inv_line in invoice.invoice_line):
return None
grid_id = carrier_obj.grid_get(cr, uid, [picking.carrier_id.id],
picking.address_id.id, context=context)
picking.partner_id.id, context=context)
if not grid_id:
raise osv.except_osv(_('Warning'),
_('The carrier %s (id: %d) has no delivery grid!') \
@ -99,7 +99,7 @@ class stock_picking(osv.osv):
.property_account_income_categ.id
taxes = picking.carrier_id.product_id.taxes_id
partner = picking.address_id or False
partner = picking.partner_id or False
if partner:
account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, partner.property_account_position, account_id)
taxes_ids = self.pool.get('account.fiscal.position').map_tax(cr, uid, partner.property_account_position, taxes)

View File

@ -312,7 +312,7 @@ class mrp_bom(osv.osv):
phantom = False
if bom.type == 'phantom' and not bom.bom_lines:
newbom = self._bom_find(cr, uid, bom.product_id.id, bom.product_uom.id, properties)
if newbom:
res = self._bom_explode(cr, uid, self.browse(cr, uid, [newbom])[0], factor*bom.product_qty, properties, addthis=True, level=level+10)
result = result + res[0]
@ -670,9 +670,9 @@ class mrp_production(osv.osv):
return res
def _get_subproduct_factor(self, cr, uid, production_id, move_id=None, context=None):
""" Compute the factor to compute the qty of procucts to produce for the given production_id. By default,
it's always equal to the quantity encoded in the production order or the production wizard, but if the
module mrp_subproduct is installed, then we must use the move_id to identify the product to produce
""" Compute the factor to compute the qty of procucts to produce for the given production_id. By default,
it's always equal to the quantity encoded in the production order or the production wizard, but if the
module mrp_subproduct is installed, then we must use the move_id to identify the product to produce
and its quantity.
:param production_id: ID of the mrp.order
:param move_id: ID of the stock move that needs to be produced. Will be used in mrp_subproduct.
@ -733,7 +733,7 @@ class mrp_production(osv.osv):
prod_name = scheduled.product_id.name_get()[0][1]
raise osv.except_osv(_('Warning!'), _('You are going to consume total %s quantities of "%s".\nBut you can only consume up to total %s quantities.') % (qty, prod_name, qty_avail))
if qty <= 0.0:
# we already have more qtys consumed than we need
# we already have more qtys consumed than we need
continue
raw_product[0].action_consume(qty, raw_product[0].location_id.id, context=context)
@ -890,21 +890,21 @@ class mrp_production(osv.osv):
'state': 'waiting',
'company_id': production.company_id.id,
})
def _make_production_internal_shipment(self, cr, uid, production, context=None):
ir_sequence = self.pool.get('ir.sequence')
stock_picking = self.pool.get('stock.picking')
routing_loc = None
pick_type = 'internal'
address_id = False
partner_id = False
# Take routing address as a Shipment Address.
# If usage of routing location is a internal, make outgoing shipment otherwise internal shipment
if production.bom_id.routing_id and production.bom_id.routing_id.location_id:
routing_loc = production.bom_id.routing_id.location_id
if routing_loc.usage <> 'internal':
pick_type = 'out'
address_id = routing_loc.address_id and routing_loc.address_id.id or False
partner_id = routing_loc.partner_id and routing_loc.partner_id.id or False
# Take next Sequence number of shipment base on type
pick_name = ir_sequence.get(cr, uid, 'stock.picking.' + pick_type)
@ -915,7 +915,7 @@ class mrp_production(osv.osv):
'type': pick_type,
'move_type': 'one',
'state': 'auto',
'address_id': address_id,
'partner_id': partner_id,
'auto_picking': self._get_auto_picking(cr, uid, production),
'company_id': production.company_id.id,
})
@ -926,7 +926,7 @@ class mrp_production(osv.osv):
stock_move = self.pool.get('stock.move')
source_location_id = production.product_id.product_tmpl_id.property_stock_production.id
destination_location_id = production.location_dest_id.id
move_name = _('PROD: %s') + production.name
move_name = _('PROD: %s') + production.name
data = {
'name': move_name,
'date': production.date_planned,
@ -983,7 +983,7 @@ class mrp_production(osv.osv):
for production in self.browse(cr, uid, ids, context=context):
shipment_id = self._make_production_internal_shipment(cr, uid, production, context=context)
produce_move_id = self._make_production_produce_line(cr, uid, production, context=context)
# Take routing location as a Source Location.
source_location_id = production.location_src_id.id
if production.bom_id.routing_id and production.bom_id.routing_id.location_id:
@ -994,7 +994,7 @@ class mrp_production(osv.osv):
shipment_move_id = self._make_production_internal_shipment_line(cr, uid, line, shipment_id, consume_move_id,\
destination_location_id=source_location_id, context=context)
self._make_production_line_procurement(cr, uid, line, shipment_move_id, context=context)
wf_service.trg_validate(uid, 'stock.picking', shipment_id, 'button_confirm', cr)
production.write({'state':'confirmed'}, context=context)
message = _("Manufacturing order '%s' is scheduled for the %s.") % (

View File

@ -22,8 +22,8 @@
assert line.product_qty == (2.0*factor), "Qty is not correspond."
assert line.product_uom.id == ref('product.product_uom_unit'), "UOM is not correspond"
sidepanel = True
elif line.product_id.id == ref('product.product_product_woodlintelm0'): #LIN40 4*0.25 Meter
assert not woodlintelm, "Production line is already generated for LIN40."
elif line.product_id.id == ref('product.product_product_woodlintelm0'): #LIN40 4*0.25 Meter
assert not woodlintelm, "Production line is already generated for LIN40."
assert line.product_qty == (4*0.25*factor), "Qty is not correspond."
assert line.product_uom.id == ref('product.product_uom_meter'), "UOM is not correspond"
woodlintelm = True
@ -32,7 +32,7 @@
assert line.product_qty == (0.25*factor), "Qty is not correspond."
assert line.product_uom.id == ref('product.product_uom_meter'), "UOM is not correspond"
woodmm0 = True
elif line.product_id.id == ref('product.product_product_metalcleats0'): #METC000 4*3 Unit
elif line.product_id.id == ref('product.product_product_metalcleats0'): #METC000 4*3 Unit
assert not metalcleats, "Production line is already generated for METC000."
assert line.product_qty == (4*3*factor), "Qty is not correspond."
assert line.product_uom.id == ref('product.product_uom_unit'), "UOM is not correspond"
@ -107,7 +107,7 @@
routing_loc = None
if order.bom_id.routing_id and order.bom_id.routing_id.location_id:
routing_loc = order.bom_id.routing_id.location_id.id
date_planned = order.date_planned
date_planned = order.date_planned
for move_line in order.move_lines:
for order_line in order.product_lines:
if move_line.product_id.type not in ('product', 'consu'):
@ -129,18 +129,18 @@
procurement = self.pool.get('procurement.order')
order = self.browse(cr, uid, ref("mrp_production_shelf100cm"))
assert order.picking_id, 'Internal Shipment should be created!'
routing_loc = None
pick_type = 'internal'
address_id = False
partner_id = False
if order.bom_id.routing_id and order.bom_id.routing_id.location_id:
routing_loc = order.bom_id.routing_id.location_id
if routing_loc.usage <> 'internal':
pick_type = 'out'
address_id = routing_loc.address_id and routing_loc.address_id.id or False
partner_id = routing_loc.partner_id and routing_loc.partner_id.id or False
routing_loc = routing_loc.id
assert order.picking_id.type == pick_type, "Shipment should be Internal."
assert order.picking_id.address_id.id == address_id, "Shipment Address is not correspond with Adderss of Routing Location."
assert order.picking_id.partner_id.id == partner_id, "Shipment Address is not correspond with Adderss of Routing Location."
date_planned = order.date_planned
for move_line in order.picking_id.move_lines:
for order_line in order.product_lines:
@ -167,7 +167,7 @@
assert shipment_procurement.product_uos.id == order_line.product_uos.id, "UOS is not correspond in procurement."
assert shipment_procurement.location_id.id == order.location_src_id.id, "Location is not correspond in procurement."
assert shipment_procurement.procure_method == order_line.product_id.procure_method, "Procure method is not correspond in procurement."
-
I change production qty with 3 Dozen Shelf 100cm.
-
@ -187,7 +187,7 @@
assert order.product_qty == 3, "Qty is not changed in order."
move = order.move_created_ids[0]
assert move.product_qty == order.product_qty, "Qty is not changed in move line."
-
-
I run scheduler.
-
!python {model: procurement.order}: |
@ -223,7 +223,7 @@
order = self.browse(cr, uid, ref("mrp_production_shelf100cm"))
for move in order.move_lines:
move.action_consume(move.product_qty)
if move.product_id.id == ref("product.product_product_metalcleats0"):
if move.product_id.id == ref("product.product_product_metalcleats0"):
move.action_scrap(5.0, scrap_location_id)
-
I produce product.
@ -242,8 +242,8 @@
!python {model: mrp.production}: |
order = self.browse(cr, uid, ref("mrp_production_shelf100cm"))
assert order.state == 'done', "Production order should be closed."
-
I check Total Costs at End of Production.
-
I check Total Costs at End of Production.
-
!python {model: mrp.production}: |
order = self.browse(cr, uid, ref("mrp_production_shelf100cm"))
@ -275,7 +275,7 @@
assert line.journal_id.id == wc.costs_journal_id.id, "Account Journal is not correspond."
assert line.product_id.id == wc.product_id.id, "Product is not correspond."
assert line.product_uom_id.id == wc.product_id.uom_id.id, "UOM is not correspond."
-
I print a "BOM Structure".
-

View File

@ -229,12 +229,12 @@ class mrp_repair(osv.osv):
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 and move.address_id.id
if move.partner_id:
data['value']['partner_id'] = move.partner_id and move.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']['partner_id'] = move.partner_id and move.partner_id.id
d = self.onchange_partner_id(cr, uid, ids, data['value']['partner_id'], data['value']['partner_id'])
data['value'].update(d['value'])
return data
@ -515,7 +515,7 @@ class mrp_repair(osv.osv):
'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,
'partner_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,
@ -530,7 +530,7 @@ class mrp_repair(osv.osv):
'origin': repair.name,
'state': 'draft',
'move_type': 'one',
'address_id': repair.address_id and repair.address_id.id or False,
'partner_id': repair.address_id and repair.address_id.id or False,
'note': repair.internal_notes,
'invoice_state': 'none',
'type': 'out',
@ -542,7 +542,7 @@ class mrp_repair(osv.osv):
'product_qty': move.product_uom_qty or 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,
'partner_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,

View File

@ -50,7 +50,7 @@ class pos_order(osv.osv):
_name = "pos.order"
_description = "Point of Sale"
_order = "id desc"
def create_from_ui(self, cr, uid, orders, context=None):
#_logger.info("orders: %r", orders)
list = []
@ -205,7 +205,7 @@ class pos_order(osv.osv):
addr = order.partner_id and partner_obj.address_get(cr, uid, [order.partner_id.id], ['delivery']) or {}
picking_id = picking_obj.create(cr, uid, {
'origin': order.name,
'address_id': addr.get('delivery',False),
'partner_id': addr.get('delivery',False),
'type': 'out',
'company_id': order.company_id.id,
'move_type': 'direct',
@ -414,7 +414,7 @@ class pos_order(osv.osv):
wf_service.trg_validate(uid, 'pos.order', order.id, 'invoice', cr)
if not inv_ids: return {}
mod_obj = self.pool.get('ir.model.data')
res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_form')
res_id = res and res[1] or False

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -53,8 +53,8 @@ class pos_return(osv.osv_memory):
for order in order_obj.browse(cr, uid, active_ids, context=context):
for line in order.lines:
result.append({
'product_id' : line.product_id.id,
'quantity' : line.qty,
'product_id' : line.product_id.id,
'quantity' : line.qty,
'line_id':line.id
})
res.update({'pos_moves_ids': result})
@ -93,7 +93,7 @@ class pos_return(osv.osv_memory):
'type': 'ir.actions.act_window',
}
def create_returns2(self, cr, uid, ids, context=None):
if context is None:
context = {}
active_id = context.get('active_id', False)
@ -113,7 +113,7 @@ class pos_return(osv.osv_memory):
for order_id in order_obj.browse(cr, uid, [active_id], context=context):
source_stock_id = property_obj.get(cr, uid, 'property_stock_customer', 'res.partner', context=context).id
cr.execute("SELECT s.id FROM stock_location s, stock_warehouse w "
"WHERE w.lot_stock_id=s.id AND w.id=%s ",
"WHERE w.lot_stock_id=s.id AND w.id=%s ",
(order_id.shop_id.warehouse_id.id,))
res = cr.fetchone()
location_id = res and res[0] or None
@ -121,7 +121,7 @@ class pos_return(osv.osv_memory):
'move_lines': [],
'state':'draft',
'type': 'in',
'address_id': order_id.partner_id.id,
'partner_id': order_id.partner_id.id,
'date': date_cur })
new_order = order_obj.copy(cr, uid, order_id.id, {'name': 'Refund %s'%order_id.name,
'lines':[],
@ -268,7 +268,7 @@ class add_product(osv.osv_memory):
wf_service = netsvc.LocalService("workflow")
self_data = self.browse(cr, uid, ids, context=context)[0]
order_obj.add_product(cr, uid, active_ids[0], self_data.product_id.id, self_data.quantity, context=context)
for order_id in order_obj.browse(cr, uid, active_ids, context=context):
stock_dest_id = property_obj.get(cr, uid, 'property_stock_customer', 'res.partner', context=context).id
cr.execute("SELECT s.id FROM stock_location s, stock_warehouse w "
@ -287,7 +287,7 @@ class add_product(osv.osv_memory):
})
for line in order_id.lines:
key= 'return%s' % line.id
if line.id:
if line.id:
if data.has_key(key):
qty = data[key]
lines_obj.write(cr,uid,[line.id], {

View File

@ -428,7 +428,7 @@ class purchase_order(osv.osv):
'origin': order.name + ((order.origin and (':' + order.origin)) or ''),
'date': order.date_order,
'type': 'in',
'address_id': order.dest_address_id.id or order.partner_id.id,
'partner_id': order.dest_address_id.id or order.partner_id.id,
'invoice_state': '2binvoiced' if order.invoice_method == 'picking' else 'none',
'purchase_id': order.id,
'company_id': order.company_id.id,
@ -448,7 +448,7 @@ class purchase_order(osv.osv):
'location_id': order.partner_id.property_stock_supplier.id,
'location_dest_id': order.location_id.id,
'picking_id': picking_id,
'address_id': order.dest_address_id.id or order.partner_id.id,
'partner_id': order.dest_address_id.id or order.partner_id.id,
'move_dest_id': order_line.move_dest_id.id,
'state': 'draft',
'purchase_line_id': order_line.id,

View File

@ -170,7 +170,6 @@
<notebook colspan="4">
<page string="Purchase Order">
<field name="partner_id" on_change="onchange_partner_id(partner_id)" context="{'search_default_supplier':1,'default_supplier':1,'default_customer':0}" options='{"quick_create": false}'/>
<!--field name="partner_address_id" options='{"quick_create": false}'/-->
<field domain="[('type','=','purchase')]" name="pricelist_id" groups="base.group_extended"/>
<field name="origin" groups="base.group_extended"/>
<newline/>

View File

@ -167,7 +167,7 @@
<td>
<para style="terp_default_Bold_9">Shipping address :</para>
<para style="terp_default_9">[[ (o.dest_address_id and o.dest_address_id.name) or (o.warehouse_id and o.warehouse_id.name) or '']]</para>
<para style="terp_default_9">[[ (o.dest_address_id and display_address(o.dest_address_id)) or (o.warehouse_id and display_address(o.warehouse_id.partner_address_id)) or '']]</para>
<para style="terp_default_9">[[ (o.dest_address_id and display_address(o.dest_address_id)) or (o.warehouse_id and display_address(o.warehouse_id.partner_id)) or '']]</para>
</td>
</tr>
</blockTable>

View File

@ -40,7 +40,7 @@
assert len(purchase_order.picking_ids) >= 1, "You should have only one reception order"
for picking in purchase_order.picking_ids:
assert picking.state == "assigned", "Reception state should be in assigned state"
assert picking.address_id.id == purchase_order.partner_id.id, "Delivery address of reception id is different from order"
assert picking.partner_id.id == purchase_order.partner_id.id, "Delivery address of reception id is different from order"
assert picking.company_id.id == purchase_order.company_id.id, "Company is not correspond with purchase order"
-
Reception is ready for process so now done the reception.

View File

@ -733,7 +733,7 @@ class sale_order(osv.osv):
'product_uos': (line.product_uos and line.product_uos.id)\
or line.product_uom.id,
'product_packaging': line.product_packaging.id,
'address_id': line.address_allotment_id.id or order.partner_shipping_id.id,
'partner_id': line.address_allotment_id.id or order.partner_shipping_id.id,
'location_id': location_id,
'location_dest_id': output_id,
'sale_line_id': line.id,
@ -755,7 +755,7 @@ class sale_order(osv.osv):
'state': 'auto',
'move_type': order.picking_policy,
'sale_id': order.id,
'address_id': order.partner_shipping_id.id,
'partner_id': order.partner_shipping_id.id,
'note': order.note,
'invoice_state': (order.order_policy=='picking' and '2binvoiced') or 'none',
'company_id': order.company_id.id,

View File

@ -84,7 +84,7 @@
</assert>
<assert id="test_order_1" model="sale.order" severity="error" string="the sales order's picking will be sent to the good address and is already confirmed">
<test expr="picking_ids[0].address_id == partner_shipping_id"/>
<test expr="picking_ids[0].partner_id == partner_shipping_id"/>
<!-- test expr="picking_ids[0].state">confirmed</test # Desactivated because of MRP_JIT -->
</assert>

View File

@ -52,7 +52,7 @@
assert picking.origin == sale_order.name,"Origin of Delivery order is not correspond with sequence number of sale order."
assert picking.type == 'out',"Shipment should be Outgoing."
assert picking.move_type == sale_order.picking_policy,"Delivery Method is not corresponding with delivery method of sale order."
assert picking.address_id.id == sale_order.partner_shipping_id.id,"Shipping Address is not correspond with sale order."
assert picking.partner_id.id == sale_order.partner_shipping_id.id,"Shipping Address is not correspond with sale order."
assert picking.note == sale_order.note,"Note is not correspond with sale order."
assert picking.invoice_state == (sale_order.order_policy=='picking' and '2binvoiced') or 'none',"Invoice policy is not correspond with sale order."
assert len(picking.move_lines) == len(sale_order.order_line), "Total move of delivery order are not corresposning with total sale order lines."
@ -69,7 +69,7 @@
assert move.product_uos_qty == (order_line.product_uos and order_line.product_uos_qty) or order_line.product_uom_qty,"Product UOS Quantity is not correspond."
assert move.product_uos == (order_line.product_uos and order_line.product_uos.id) or order_line.product_uom.id,"Product UOS is not correspond"
assert move.product_packaging.id == order_line.product_packaging.id,"Product packaging is not correspond."
assert move.address_id.id == order_line.address_allotment_id.id or sale_order.partner_shipping_id.id,"Address is not correspond"
assert move.partner_id.id == order_line.address_allotment_id.id or sale_order.partner_shipping_id.id,"Address is not correspond"
#assert move.location_id.id == location_id,"Source Location is not correspond."
#assert move.location_dest_id == output_id,"Destination Location is not correspond."
assert move.note == order_line.notes,"Note is not correspond"

View File

@ -162,13 +162,13 @@
<tr>
<td>
<para style="terp_default_Bold_9">Shipping Address :</para>
<para style="terp_default_9">[[ (picking.address_id and picking.address_id.id and picking.address_id.title.name) or '' ]] [[ picking.address_id and picking.address_id.id and picking.address_id.name ]]</para>
<para style="terp_default_9">[[ picking.address_id and display_address(picking.address_id,'delivery') ]]</para>
<para style="terp_default_9">[[ (picking.partner_id and picking.partner_id.id and picking.partner_id.title.name) or '' ]] [[ picking.partner_id and picking.partner_id.id and picking.partner_id.name ]]</para>
<para style="terp_default_9">[[ picking.partner_id and display_address(picking.partner_id,'delivery') ]]</para>
</td>
<td>
<para style="terp_default_Bold_9">Contact Address :</para>
<para style="terp_default_9">[[ picking.address_id and picking.address_id.title.name or '' ]] [[ picking.address_id and picking.address_id.name or '' ]]</para>
<para style="terp_default_9">[[ picking.address_id and display_address(picking.address_id,'default') ]] </para>
<para style="terp_default_9">[[ picking.partner_id and picking.partner_id.title.name or '' ]] [[ picking.partner_id and picking.partner_id.name or '' ]]</para>
<para style="terp_default_9">[[ picking.partner_id and display_address(picking.partner_id,'default') ]] </para>
</td>
</tr>
</blockTable>
@ -218,7 +218,7 @@
<para style="terp_default_Centre_8">[[ picking.origin or '']]</para>
</td>
<td>
<para style="terp_default_Centre_8">[[ (picking.address_id and picking.address_id.title.name) or '' ]] [[ (picking.address_id and picking.address_id.name) or '' ]] </para>
<para style="terp_default_Centre_8">[[ (picking.partner_id and picking.partner_id.title.name) or '' ]] [[ (picking.partner_id and picking.partner_id.name) or '' ]] </para>
</td>
<td>
<para style="terp_default_Centre_8">[[ formatLang(picking.min_date,date_time = True) ]]</para>

View File

@ -76,7 +76,7 @@ class report_stock_move(osv.osv):
al.product_qty,
al.out_qty as product_qty_out,
al.in_qty as product_qty_in,
al.address_id as partner_id,
al.partner_id as partner_id,
al.product_id as product_id,
al.state as state ,
al.product_uom as product_uom,
@ -113,7 +113,7 @@ class report_stock_move(osv.osv):
sm.location_dest_id as location_dest_id,
sum(sm.product_qty) as product_qty,
pt.categ_id as categ_id ,
sm.address_id as address_id,
sm.partner_id as partner_id,
sm.product_id as product_id,
sm.picking_id as picking_id,
sm.company_id as company_id,
@ -129,7 +129,7 @@ class report_stock_move(osv.osv):
LEFT JOIN product_uom pu2 ON (sm.product_uom=pu2.id)
LEFT JOIN product_template pt ON (pp.product_tmpl_id=pt.id)
GROUP BY
sm.id,sp.type, sm.date,sm.address_id,
sm.id,sp.type, sm.date,sm.partner_id,
sm.product_id,sm.state,sm.product_uom,sm.date_expected,
sm.product_id,pt.standard_price, sm.picking_id, sm.product_qty,
sm.company_id,sm.product_qty, sm.location_id,sm.location_dest_id,pu.factor,pt.categ_id, sp.stock_journal_id)
@ -137,7 +137,7 @@ class report_stock_move(osv.osv):
GROUP BY
al.out_qty,al.in_qty,al.curr_year,al.curr_month,
al.curr_day,al.curr_day_diff,al.curr_day_diff1,al.curr_day_diff2,al.dp,al.location_id,al.location_dest_id,
al.address_id,al.product_id,al.state,al.product_uom,
al.partner_id,al.product_id,al.state,al.product_uom,
al.picking_id,al.company_id,al.type,al.product_qty, al.categ_id, al.stock_journal
)
""")
@ -173,7 +173,7 @@ class report_stock_inventory(osv.osv):
CREATE OR REPLACE view report_stock_inventory AS (
(SELECT
min(m.id) as id, m.date as date,
m.address_id as partner_id, m.location_id as location_id,
m.partner_id as partner_id, m.location_id as location_id,
m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,
m.company_id,
m.state as state, m.prodlot_id as prodlot_id,
@ -190,12 +190,12 @@ CREATE OR REPLACE view report_stock_inventory AS (
LEFT JOIN product_uom u ON (m.product_uom=u.id)
LEFT JOIN stock_location l ON (m.location_id=l.id)
GROUP BY
m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id,
m.id, m.product_id, m.product_uom, pt.categ_id, m.partner_id, m.location_id, m.location_dest_id,
m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id
) UNION ALL (
SELECT
-m.id as id, m.date as date,
m.address_id as partner_id, m.location_dest_id as location_id,
m.partner_id as partner_id, m.location_dest_id as location_id,
m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,
m.company_id,
m.state as state, m.prodlot_id as prodlot_id,
@ -211,7 +211,7 @@ CREATE OR REPLACE view report_stock_inventory AS (
LEFT JOIN product_uom u ON (m.product_uom=u.id)
LEFT JOIN stock_location l ON (m.location_dest_id=l.id)
GROUP BY
m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id,
m.id, m.product_id, m.product_uom, pt.categ_id, m.partner_id, m.location_id, m.location_dest_id,
m.prodlot_id, m.date, m.state, l.usage, m.company_id, pt.uom_id
)
);

View File

@ -190,7 +190,7 @@ class stock_location(osv.osv):
'chained_picking_type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal')], 'Shipping Type', help="Shipping Type of the Picking List that will contain the chained move (leave empty to automatically detect the type based on the source and destination locations)."),
'chained_company_id': fields.many2one('res.company', 'Chained Company', help='The company the Picking List containing the chained move will belong to (leave empty to use the default company determination rules'),
'chained_delay': fields.integer('Chaining Lead Time',help="Delay between original move and chained move in days"),
'address_id': fields.many2one('res.partner', 'Location Address',help="Address of customer or supplier."),
'partner_id': fields.many2one('res.partner', 'Location Address',help="Address of customer or supplier."),
'icon': fields.selection(tools.icons, 'Icon', size=64,help="Icon show in hierarchical tree view"),
'comment': fields.text('Additional Information'),
@ -646,7 +646,7 @@ class stock_picking(osv.osv):
store=True, type='datetime', string='Max. Expected Date', select=2),
'move_lines': fields.one2many('stock.move', 'picking_id', 'Internal Moves', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
'auto_picking': fields.boolean('Auto-Picking'),
'address_id': fields.many2one('res.partner', 'Address', help="Address of partner"),
'partner_id': fields.many2one('res.partner', 'Partner'),
'invoice_state': fields.selection([
("invoiced", "Invoiced"),
("2binvoiced", "To Be Invoiced"),
@ -876,7 +876,7 @@ class stock_picking(osv.osv):
@param picking: object of the picking for which we are selecting the partner to invoice
@return: object of the partner to invoice
"""
return picking.address_id and picking.address_id.id
return picking.partner_id and picking.partner_id.id
def _get_comment_invoice(self, cr, uid, picking):
"""
@ -916,11 +916,11 @@ class stock_picking(osv.osv):
else:
taxes = move_line.product_id.taxes_id
if move_line.picking_id and move_line.picking_id.address_id and move_line.picking_id.address_id.id:
if move_line.picking_id and move_line.picking_id.partner_id and move_line.picking_id.partner_id.id:
return self.pool.get('account.fiscal.position').map_tax(
cr,
uid,
move_line.picking_id.address_id.property_account_position,
move_line.picking_id.partner_id.property_account_position,
taxes
)
else:
@ -1176,7 +1176,7 @@ class stock_picking(osv.osv):
def do_partial(self, cr, uid, ids, partial_datas, context=None):
""" Makes partial picking and moves done.
@param partial_datas : Dictionary containing details of partial picking
like partner_id, address_id, delivery_date,
like partner_id, partner_id, delivery_date,
delivery moves with product_id, product_qty, uom
@return: Dictionary of values
"""
@ -1276,7 +1276,7 @@ class stock_picking(osv.osv):
{
'product_qty' : move.product_qty - partial_qty[move.id],
'product_uos_qty': move.product_qty - partial_qty[move.id], #TODO: put correct uos_qty
})
if new_picking:
@ -1378,7 +1378,7 @@ class stock_production_lot(osv.osv):
name = '%s [%s]' % (name, record['ref'])
res.append((record['id'], name))
return res
def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
args = args or []
ids = []
@ -1579,7 +1579,7 @@ class stock_move(osv.osv):
'location_id': fields.many2one('stock.location', 'Source Location', required=True, select=True,states={'done': [('readonly', True)]}, help="Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."),
'location_dest_id': fields.many2one('stock.location', 'Destination Location', required=True,states={'done': [('readonly', True)]}, select=True, help="Location where the system will stock the finished products."),
'address_id': fields.many2one('res.partner', 'Destination Address ', states={'done': [('readonly', True)]}, help="Optional address where goods are to be delivered, specifically used for allotment"),
'partner_id': fields.many2one('res.partner', 'Destination Address ', states={'done': [('readonly', True)]}, help="Optional address where goods are to be delivered, specifically used for allotment"),
'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot', states={'done': [('readonly', True)]}, help="Production lot is used to put a serial number on the production", select=True),
'tracking_id': fields.many2one('stock.tracking', 'Pack', select=True, states={'done': [('readonly', True)]}, help="Logistical shipping unit: pallet, box, pack ..."),
@ -1800,19 +1800,19 @@ class stock_move(osv.osv):
return {'value': result}
def onchange_product_id(self, cr, uid, ids, prod_id=False, loc_id=False,
loc_dest_id=False, address_id=False):
loc_dest_id=False, partner_id=False):
""" On change of product id, if finds UoM, UoS, quantity and UoS quantity.
@param prod_id: Changed Product id
@param loc_id: Source location id
@param loc_dest_id: Destination location id
@param address_id: Address id of partner
@param partner_id: Address id of partner
@return: Dictionary of values
"""
if not prod_id:
return {}
lang = False
if address_id:
addr_rec = self.pool.get('res.partner').browse(cr, uid, address_id)
if partner_id:
addr_rec = self.pool.get('res.partner').browse(cr, uid, partner_id)
if addr_rec:
lang = addr_rec and addr_rec.lang or False
ctx = {'lang': lang}
@ -1854,7 +1854,7 @@ class stock_move(osv.osv):
cr,
uid,
m.location_dest_id,
m.picking_id and m.picking_id.address_id and m.picking_id.address_id,
m.picking_id and m.picking_id.partner_id and m.picking_id.partner_id,
m.product_id,
context
)
@ -1905,7 +1905,7 @@ class stock_move(osv.osv):
'auto_picking': moves_todo[0][1][1] == 'auto',
'stock_journal_id': moves_todo[0][1][3],
'company_id': moves_todo[0][1][4] or res_company._company_default_get(cr, uid, 'stock.company', context=context),
'address_id': picking.address_id.id,
'partner_id': picking.partner_id.id,
'invoice_state': 'none',
'date': picking.date,
}
@ -2261,7 +2261,7 @@ class stock_move(osv.osv):
processing of the given stock move.
"""
# prepare default values considering that the destination accounts have the reference_currency_id as their main currency
partner_id = (move.picking_id.address_id and move.picking_id.address_id.id and move.picking_id.address_id.id) or False
partner_id = (move.picking_id.partner_id and move.picking_id.partner_id.id and move.picking_id.partner_id.id) or False
debit_line_vals = {
'name': move.name,
'product_id': move.product_id and move.product_id.id or False,
@ -2493,7 +2493,7 @@ class stock_move(osv.osv):
def do_partial(self, cr, uid, ids, partial_datas, context=None):
""" Makes partial pickings and moves done.
@param partial_datas: Dictionary containing details of partial picking
like partner_id, address_id, delivery_date, delivery
like partner_id, delivery_date, delivery
moves with product_id, product_qty, uom
"""
res = {}
@ -2680,7 +2680,7 @@ class stock_inventory(osv.osv):
'prodlot_id': lot_id,
'date': inv.date,
}
if change > 0:
value.update( {
'product_qty': change,
@ -2772,7 +2772,7 @@ class stock_warehouse(osv.osv):
_columns = {
'name': fields.char('Name', size=128, required=True, select=True),
'company_id': fields.many2one('res.company', 'Company', required=True, select=True),
'partner_address_id': fields.many2one('res.partner', 'Owner Address'),
'partner_id': fields.many2one('res.partner', 'Owner Address'),
'lot_input_id': fields.many2one('stock.location', 'Location Input', required=True, domain=[('usage','<>','view')]),
'lot_stock_id': fields.many2one('stock.location', 'Location Stock', required=True, domain=[('usage','=','internal')]),
'lot_output_id': fields.many2one('stock.location', 'Location Output', required=True, domain=[('usage','<>','view')]),

View File

@ -5,7 +5,7 @@
<record id="base.user_demo" model="res.users">
<field eval="[(4, ref('group_stock_user'))]" name="groups_id"/>
</record>
<!--
Resource: stock.location
-->
@ -42,7 +42,7 @@
<field name="name">Shelf 1</field>
<field name="location_id" ref="stock_location_stock"/>
</record>
<!--
Resource: stock.inventory
@ -219,7 +219,7 @@
<field eval="&quot;&quot;&quot;Shop 2&quot;&quot;&quot;" name="name"/>
</record>
<record id="stock_location_shop0" model="stock.location">
<field model="res.partner" name="address_id" search="[('name','=','Fabien')]"/>
<field model="res.partner" name="partner_id" search="[('name','=','Fabien')]"/>
<field name="location_id" ref="stock.stock_location_locations"/>
<field name="company_id" ref="res_company_shop0"/>
<field eval="&quot;&quot;&quot;internal&quot;&quot;&quot;" name="usage"/>
@ -229,7 +229,7 @@
<field eval="&quot;&quot;&quot;manual&quot;&quot;&quot;" name="chained_auto_packing"/>
</record>
<record id="stock_location_shop1" model="stock.location">
<field model="res.partner" name="address_id" search="[('name','=','Eric')]"/>
<field model="res.partner" name="partner_id" search="[('name','=','Eric')]"/>
<field name="company_id" ref="res_company_tinyshop0"/>
<field name="location_id" ref="stock.stock_location_locations"/>
<field eval="&quot;&quot;&quot;internal&quot;&quot;&quot;" name="usage"/>
@ -237,7 +237,7 @@
<field eval="&quot;&quot;&quot;Shop 2&quot;&quot;&quot;" name="name"/>
</record>
<record id="stock_location_intermediatelocation0" model="stock.location">
<field name="address_id" ref="base.main_partner"/>
<field name="partner_id" ref="base.main_partner"/>
<field name="location_id" ref="stock.stock_location_locations_partner"/>
<field eval="&quot;&quot;&quot;procurement&quot;&quot;&quot;" name="usage"/>
<field eval="&quot;&quot;&quot;Internal Shippings&quot;&quot;&quot;" name="name"/>
@ -247,7 +247,7 @@
<field name="lot_output_id" ref="stock.stock_location_output"/>
<field eval="&quot;&quot;&quot;Shop 1&quot;&quot;&quot;" name="name"/>
<field name="lot_stock_id" ref="stock_location_shop0"/>
<field name="partner_address_id" ref="res_partner_address_fabien0"/>
<field name="partner_id" ref="res_partner_address_fabien0"/>
<field name="company_id" ref="res_company_shop0"/>
<field name="lot_input_id" ref="stock_location_shop0"/>
</record>
@ -255,7 +255,7 @@
<field name="lot_output_id" ref="stock.stock_location_output"/>
<field name="name">Shop 2</field>
<field name="lot_stock_id" ref="stock_location_shop1"/>
<field name="partner_address_id" ref="res_partner_address_eric0"/>
<field name="partner_id" ref="res_partner_address_eric0"/>
<field name="company_id" ref="res_company_tinyshop0"/>
<field name="lot_input_id" ref="stock_location_shop1"/>
</record>

View File

@ -10,7 +10,7 @@
!record {model: stock.location, id: location_refrigerator_small}:
name: Small Refrigerator
usage: internal
location_id: location_refrigerator
location_id: location_refrigerator
-
!record {model: stock.location, id: location_opening}:
name: opening
@ -75,7 +75,7 @@
product_qty: 40.0
prod_lot_id: lot_icecream_1
location_id: location_refrigerator
-
!record {model: stock.picking, id: outgoing_shipment}:
type: out
@ -92,7 +92,7 @@
!record {model: stock.picking, id: incomming_shipment}:
type: in
invoice_state: 2binvoiced
address_id: base.res_partner_address_9
partner_id: base.res_partner_address_9
location_dest_id: location_refrigerator
-
!record {model: stock.move, id: incomming_shipment_icecream}:

View File

@ -22,7 +22,7 @@
action="product.product_category_action_form" id="menu_product_category_config_stock"
parent="stock.menu_product_in_config_stock" sequence="0" />
<menuitem
action="product.product_ul_form_action"
action="product.product_ul_form_action"
id="menu_product_packaging_stock_action" parent="stock.menu_product_in_config_stock" sequence="1"/>
<menuitem
id="menu_stock_unit_measure_stock" name="Units of Measure"
@ -509,7 +509,7 @@
</group>
<group col="4" colspan="2">
<separator string="Additional Information" colspan="4"/>
<field name="address_id" context="{'contact_display':'partner'}" colspan="4"/>
<field name="partner_id" colspan="4"/>
<field name="company_id" groups="base.group_multi_company" widget="selection" colspan="4"/>
<field name="icon" groups="base.group_extended" colspan="4"/>
<field name="scrap_location" groups="base.group_extended"/>
@ -624,7 +624,7 @@
<field name="lot_output_id"/>
<field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
<newline/>
<field name="partner_address_id" context="{'contact_display':'partner'}"/>
<field name="partner_id"/>
</form>
</field>
</record>
@ -638,7 +638,7 @@
<field name="lot_input_id"/>
<field name="lot_stock_id"/>
<field name="lot_output_id"/>
<field name="partner_address_id" context="{'contact_display':'partner'}"/>
<field name="partner_id"/>
</tree>
</field>
</record>
@ -658,10 +658,10 @@
<field name="type">calendar</field>
<field name="priority" eval="2"/>
<field name="arch" type="xml">
<calendar string="Calendar View" date_start="min_date" date_stop="max_date" color="address_id">
<calendar string="Calendar View" date_start="min_date" date_stop="max_date" color="partner_id">
<field name="origin"/>
<field name="type"/>
<field name="address_id"/>
<field name="partner_id"/>
</calendar>
</field>
</record>
@ -694,7 +694,7 @@
<group colspan="4" col="4">
<field name="name" readonly="1"/>
<field name="origin"/>
<field name="address_id" on_change="onchange_partner_in(address_id)" context="{'contact_display':'partner'}" colspan="4"/>
<field name="partner_id" on_change="onchange_partner_in(partner_id)" colspan="4"/>
<field name="invoice_state" string="Invoice Control" groups="base.group_extended"/>
<field name="backorder_id" readonly="1" groups="base.group_extended"/>
</group>
@ -706,7 +706,7 @@
</group>
<notebook colspan="4">
<page string="Products">
<field colspan="4" name="move_lines" nolabel="1" widget="one2many_list" context="{'address_in_id': address_id}">
<field colspan="4" name="move_lines" nolabel="1" widget="one2many_list" context="{'address_in_id': partner_id}">
<tree colors="grey:scrapped == True" string="Stock Moves">
<field name="product_id"/>
<field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
@ -743,7 +743,7 @@
<group colspan="2" col="4">
<separator colspan="4" string="Move Information"/>
<field name="name" invisible="1" colspan="4"/>
<field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)" colspan="4"/>
<field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.partner_id)" colspan="4"/>
<field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)" colspan="3"/>
<button name="%(stock.move_scrap)d"
string="Scrap" type="action" groups="base.group_extended"
@ -836,7 +836,7 @@
<filter icon="terp-dolar" name="to_invoice" string="To Invoice" domain="[('invoice_state','=','2binvoiced')]" help="Internal Pickings to invoice"/>
<separator orientation="vertical"/>
<field name="name"/>
<field name="address_id"/>
<field name="partner_id"/>
<field name="stock_journal_id" groups="base.group_extended" widget="selection"/>
</group>
<newline/>
@ -885,7 +885,7 @@
<group colspan="4" col="4">
<field name="name" readonly="1"/>
<field name="origin" readonly="1"/>
<field name="address_id" on_change="onchange_partner_in(address_id)" context="{'contact_display':'partner'}" colspan="4"/>
<field name="partner_id" on_change="onchange_partner_in(partner_id)" colspan="4"/>
<field name="invoice_state"/>
<field name="backorder_id" readonly="1" groups="base.group_extended"/>
</group>
@ -897,7 +897,7 @@
</group>
<notebook colspan="4">
<page string="Products">
<field colspan="4" name="move_lines" nolabel="1" widget="one2many_list" context="{'address_out_id': address_id, 'picking_type': type}" >
<field colspan="4" name="move_lines" nolabel="1" widget="one2many_list" context="{'address_out_id': partner_id, 'picking_type': type}" >
<tree colors="grey:scrapped==True" string="Stock Moves">
<field name="product_id"/>
<field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)"/>
@ -932,7 +932,7 @@
<group colspan="2" col="4">
<separator colspan="4" string="Move Information"/>
<field name="name" invisible="1" colspan="4" />
<field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)" colspan="4" />
<field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.partner_id)" colspan="4" />
<field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)" colspan="3" />
<button name="%(stock.move_scrap)d"
string="Scrap" type="action"
@ -1103,7 +1103,7 @@
<group colspan="4" col="4">
<field name="name" readonly="1"/>
<field name="origin"/>
<field name="address_id" on_change="onchange_partner_in(address_id)" context="{'contact_display':'partner'}" colspan="4"/>
<field name="partner_id" on_change="onchange_partner_in(partner_id)" colspan="4"/>
<field name="invoice_state" string="Invoice Control"/>
<field name="backorder_id" readonly="1" groups="base.group_extended"/>
</group>
@ -1115,7 +1115,7 @@
</group>
<notebook colspan="4">
<page string="General Information">
<field colspan="4" name="move_lines" nolabel="1" widget="one2many_list" context="{'address_in_id': address_id, 'picking_type': type}" >
<field colspan="4" name="move_lines" nolabel="1" widget="one2many_list" context="{'address_in_id': partner_id, 'picking_type': type}" >
<tree colors="grey:scrapped==True" string="Stock Moves">
<field name="product_id" />
<field name="product_qty" />
@ -1149,7 +1149,7 @@
<group colspan="2" col="4">
<separator colspan="4" string="Move Information"/>
<field name="name" invisible="1" colspan="4"/>
<field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.address_id)" colspan="4"/>
<field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id, parent.partner_id)" colspan="4"/>
<field name="product_qty" on_change="onchange_quantity(product_id, product_qty, product_uom, product_uos)" colspan="3"/>
<button name="%(stock.move_scrap)d"
string="Scrap" type="action" groups="base.group_extended"
@ -1411,7 +1411,7 @@
<newline/>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="address_id" context="{'contact_display':'partner'}"/>
<field name="partner_id" context="{'contact_display':'partner'}"/>
</group>
<group colspan="2" col="2">
@ -1479,7 +1479,7 @@
<separator orientation="vertical"/>
<field name="product_id"/>
<field name="location_id" string="Location" filter_domain="['|',('location_id','ilike',self),('location_dest_id','ilike',self)]"/>
<field name="address_id" string="Partner" context="{'contact_display':'partner'}" filter_domain="[('picking_id.address_id','ilike',self)]"/>
<field name="partner_id" string="Partner" filter_domain="[('picking_id.partner_id','ilike',self)]"/>
<field name="date" groups="base.group_no_one"/>
<field name="origin"/>
<field name="prodlot_id"/>
@ -1597,7 +1597,7 @@
<newline/>
<field name="location_id"/>
<field name="location_dest_id"/>
<field name="address_id" context="{'contact_display':'partner'}"/>
<field name="partner_id"/>
</group>
<group colspan="2" col="2">

View File

@ -5,7 +5,7 @@
I create an Outgoing Picking order.
-
!record {model: stock.picking, id: stock_picking_out0}:
address_id: base.res_partner_address_3000
partner_id: base.res_partner_address_3000
invoice_state: 2binvoiced
move_lines:
- company_id: base.main_company
@ -55,7 +55,7 @@
!python {model: account.invoice}: |
picking_obj = self.pool.get('stock.picking')
picking = picking_obj.browse(cr, uid, [ref('stock_picking_out0')])
partner = picking[0].address_id.id
partner = picking[0].partner_id.id
inv_ids = self.search(cr, uid, [('type','=','out_invoice'),('partner_id','=',partner)])
assert inv_ids, 'No Invoice is generated!'

View File

@ -1,5 +1,5 @@
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
@ -14,7 +14,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -63,7 +63,7 @@ class procurement_order(osv.osv):
'type': line.picking_type,
'stock_journal_id': line.journal_id and line.journal_id.id or False,
'move_type': 'one',
'address_id': line.partner_address_id.id,
'partner_id': line.partner_address_id.id,
'note': _('Picking for pulled procurement coming from original location %s, pull rule %s, via original Procurement %s (#%d)') % (proc.location_id.name, line.name, proc.name, proc.id),
'invoice_state': line.invoice_state,
})
@ -79,7 +79,7 @@ class procurement_order(osv.osv):
or proc.product_qty,
'product_uos': (proc.product_uos and proc.product_uos.id)\
or proc.product_uom.id,
'address_id': line.partner_address_id.id,
'partner_id': line.partner_address_id.id,
'location_id': line.location_src_id.id,
'location_dest_id': line.location_id.id,
'move_dest_id': proc.move_id and proc.move_id.id or False, # to verif, about history ?

View File

@ -65,7 +65,7 @@
In order to test pushed flow .I buy the product from Micro Link Technologies supplier. I create a Picking.
-
!record {model: stock.picking , id: stock_picking_in0}:
address_id: res_partner_address_0
partner_id: res_partner_address_0
company_id: base.main_company
invoice_state: none
move_lines:
@ -105,13 +105,12 @@
-
!python {model: stock.picking }: |
import time
picking_id = self.search(cr, uid, [('address_id.parent_id','=',ref('res_partner_microlinktechnologies0')),('type','=','in')])
picking_id = self.search(cr, uid, [('partner_id','=',ref('res_partner_microlinktechnologies0')),('type','=','in')])
if picking_id:
pick=self.browse(cr,uid,picking_id[0])
move =pick.move_lines[0]
partial_datas = {
'partner_id':pick.address_id.parent_id.id,
'address_id': pick.address_id.id,
'partner_id':pick.partner_id,
'delivery_date' : time.strftime('%Y-%m-%d'),
}
partial_datas['move%s'%(move.id)]= {