[IMP] Change warehouse to picking_type_id on purchase + put destination address after picking type + adapt packaging
bzr revid: jco@openerp.com-20130903134600-7jraor07pqp8ijpo
This commit is contained in:
parent
0b4dd1546d
commit
cc3dfdd3c0
|
@ -26,7 +26,6 @@
|
|||
<field name="product_uom" invisible="1"/>
|
||||
<field name="day" invisible="1"/>
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="warehouse_id" invisible="1"/>
|
||||
<field name="validator" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
|
|
|
@ -188,7 +188,6 @@ class purchase_order(osv.osv):
|
|||
help="Put an address if you want to deliver directly from the supplier to the customer. " \
|
||||
"Otherwise, keep empty to deliver to your own company."
|
||||
),
|
||||
'warehouse_id': fields.many2one('stock.warehouse', 'Destination Warehouse'),
|
||||
'location_id': fields.many2one('stock.location', 'Destination', required=True, domain=[('usage','<>','view')], states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]} ),
|
||||
'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, help="The pricelist sets the currency used for this purchase order. It also computes the supplier price for the selected products/quantities."),
|
||||
'currency_id': fields.many2one('res.currency','Currency', readonly=True, required=True,states={'draft': [('readonly', False)],'sent': [('readonly', False)]}),
|
||||
|
@ -234,7 +233,8 @@ class purchase_order(osv.osv):
|
|||
'journal_id': fields.many2one('account.journal', 'Journal'),
|
||||
'bid_date': fields.date('Bid Received On', readonly=True, help="Date on which the bid was received"),
|
||||
'bid_validity': fields.date('Bid Valid Until', help="Date on which the bid expired"),
|
||||
'picking_type_id': fields.many2one('stock.picking.type', 'Picking Type', help="This will determine picking type of incoming shipment", required=True),
|
||||
'picking_type_id': fields.many2one('stock.picking.type', 'Picking Type', help="This will determine picking type of incoming shipment", required=True,
|
||||
states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}),
|
||||
'related_location_id':fields.related('picking_type_id', 'default_location_dest_id', type='many2one', relation='stock.location', string="Related location", store=True),
|
||||
}
|
||||
_defaults = {
|
||||
|
@ -302,7 +302,7 @@ class purchase_order(osv.osv):
|
|||
if not address_id:
|
||||
return {}
|
||||
address = self.pool.get('res.partner')
|
||||
values = {'warehouse_id': False}
|
||||
values = {}
|
||||
supplier = address.browse(cr, uid, address_id)
|
||||
if supplier:
|
||||
location_id = supplier.property_stock_customer.id
|
||||
|
@ -861,7 +861,7 @@ class purchase_order(osv.osv):
|
|||
'date_order': porder.date_order,
|
||||
'partner_id': porder.partner_id.id,
|
||||
'dest_address_id': porder.dest_address_id.id,
|
||||
'warehouse_id': porder.warehouse_id.id,
|
||||
'picking_type_id': porder.picking_type_id.id,
|
||||
'location_id': porder.location_id.id,
|
||||
'pricelist_id': porder.pricelist_id.id,
|
||||
'state': 'draft',
|
||||
|
@ -1247,7 +1247,6 @@ class procurement_order(osv.osv):
|
|||
partner_id = partner.id
|
||||
address_id = partner_obj.address_get(cr, uid, [partner_id], ['delivery'])['delivery']
|
||||
pricelist_id = partner.property_product_pricelist_purchase.id
|
||||
warehouse_id = warehouse_obj.search(cr, uid, [('company_id', '=', procurement.company_id.id or company.id)], context=context)
|
||||
uom_id = procurement.product_id.uom_po_id.id
|
||||
qty = uom_obj._compute_qty(cr, uid, procurement.product_uom.id, procurement.product_qty, uom_id)
|
||||
if seller_qty:
|
||||
|
@ -1283,7 +1282,7 @@ class procurement_order(osv.osv):
|
|||
'origin': procurement.origin,
|
||||
'partner_id': partner_id,
|
||||
'location_id': procurement.location_id.id,
|
||||
'warehouse_id': warehouse_id and warehouse_id[0] or False,
|
||||
'picking_type_id': procurement.rule_id.picking_type_id.id,
|
||||
'pricelist_id': pricelist_id,
|
||||
'date_order': purchase_date.strftime(DEFAULT_SERVER_DATETIME_FORMAT),
|
||||
'company_id': procurement.company_id.id,
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
</record>
|
||||
|
||||
<function
|
||||
eval="('default',False,'warehouse_id', [('purchase.order', False)], ref('stock.warehouse0'), True, False, False, False, True)"
|
||||
eval="('default',False,'picking_type_id', [('purchase.order', False)], ref('stock.picking_type_in'), True, False, False, False, True)"
|
||||
id="purchase_default_set"
|
||||
model="ir.values"
|
||||
name="set"/>
|
||||
|
|
|
@ -196,9 +196,13 @@
|
|||
<group>
|
||||
<field name="date_order"/>
|
||||
<field name="origin" attr="{'invisible': [('origin','=',False)]}"/>
|
||||
<field name="warehouse_id" widget="selection" groups="stock.group_locations"/>
|
||||
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
|
||||
<field name="picking_type_id" on_change="onchange_picking_type_id(picking_type_id, context)" domain="[('code_id','=','incoming')]"/>
|
||||
<field name="picking_type_id" on_change="onchange_picking_type_id(picking_type_id, context)" domain="[('code_id','=','incoming')]" string="Warehouse / Operation" widget="selection"/>
|
||||
<field name="related_location_id" invisible="1"/>
|
||||
<field name="dest_address_id" string="Customer Address" on_change="onchange_dest_address_id(dest_address_id)"
|
||||
attrs="{'invisible':['|', ('picking_type_id','=',False), ('related_location_id','!=', False)],
|
||||
'required': [('picking_type_id','!=',False), ('related_location_id','=', False)]}"
|
||||
groups="stock.group_locations"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
|
@ -241,11 +245,7 @@
|
|||
<page string="Deliveries & Invoices">
|
||||
<group>
|
||||
<group>
|
||||
<field name="related_location_id" invisible="1"/>
|
||||
<field name="dest_address_id" string="Customer Address" on_change="onchange_dest_address_id(dest_address_id)"
|
||||
attrs="{'invisible':['|', ('picking_type_id','=',False), ('related_location_id','!=', False)],
|
||||
'required': [('picking_type_id','!=',False), ('related_location_id','=', False)]}"
|
||||
groups="stock.group_locations"/>
|
||||
|
||||
<field name="minimum_planned_date"/>
|
||||
<field name="location_id" groups="stock.group_locations"/>
|
||||
<field name="shipped" groups="base.group_no_one"/>
|
||||
|
|
|
@ -42,7 +42,7 @@ class purchase_report(osv.osv):
|
|||
('done', 'Done'),
|
||||
('cancel', 'Cancelled')],'Order Status', readonly=True),
|
||||
'product_id':fields.many2one('product.product', 'Product', readonly=True),
|
||||
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', readonly=True),
|
||||
'picking_type_id': fields.many2one('stock.warehouse', 'Warehouse', readonly=True),
|
||||
'location_id': fields.many2one('stock.location', 'Destination', readonly=True),
|
||||
'partner_id':fields.many2one('res.partner', 'Supplier', readonly=True),
|
||||
'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', readonly=True),
|
||||
|
@ -82,7 +82,7 @@ class purchase_report(osv.osv):
|
|||
s.dest_address_id,
|
||||
s.pricelist_id,
|
||||
s.validator,
|
||||
s.warehouse_id as warehouse_id,
|
||||
s.picking_type_id as picking_type_id,
|
||||
s.partner_id as partner_id,
|
||||
s.create_uid as user_id,
|
||||
s.company_id as company_id,
|
||||
|
@ -128,7 +128,7 @@ class purchase_report(osv.osv):
|
|||
to_char(s.date_order, 'MM'),
|
||||
to_char(s.date_order, 'YYYY-MM-DD'),
|
||||
s.state,
|
||||
s.warehouse_id,
|
||||
s.picking_type_id,
|
||||
u.uom_type,
|
||||
u.category_id,
|
||||
t.uom_id,
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<field name="day" invisible="1"/>
|
||||
<field name="name" invisible="1"/>
|
||||
<field name="month" invisible="1"/>
|
||||
<field name="warehouse_id" invisible="1"/>
|
||||
<field name="picking_type_id" invisible="1"/>
|
||||
<field name="validator" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
|
@ -58,7 +58,7 @@
|
|||
<field name="user_id"/>
|
||||
<field name="validator"/>
|
||||
<field name="location_id"/>
|
||||
<field name="warehouse_id"/>
|
||||
<field name="picking_type_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="date"/>
|
||||
<field name="date_approve"/>
|
||||
|
@ -72,9 +72,9 @@
|
|||
<filter string="Product" name="group_product_id" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
|
||||
<filter string="Category" name="group_category_id" icon="terp-stock_symbol-selection" context="{'group_by':'category_id'}"/>
|
||||
<filter string="Reference Unit of Measure" name="group_product_uom" icon="terp-mrp" context="{'group_by':'product_uom'}"/>
|
||||
<filter string="Warehouse" icon="terp-go-home" context="{'group_by':'warehouse_id'}"/>
|
||||
<filter string="Warehouse" icon="terp-go-home" context="{'group_by':'picking_type_id'}"/>
|
||||
<filter string="Reference UOM" name="group_product_uom" icon="terp-mrp" context="{'group_by':'product_uom'}"/>
|
||||
<filter string="Warehouse" icon="terp-go-home" context="{'group_by':'warehouse_id'}"/>
|
||||
<filter string="Warehouse" icon="terp-go-home" context="{'group_by':'picking_type_id'}"/>
|
||||
<filter string="Destination" icon="terp-gtk-jump-to-ltr" context="{'group_by':'location_id'}"/>
|
||||
<filter string="Status" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
|
||||
<filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
|
||||
|
|
|
@ -20,9 +20,6 @@
|
|||
<xpath expr="//field[@name='move_type']" position="before">
|
||||
<field name="purchase_id" domain="[('invoice_method','=','picking')]" groups="base.group_no_one" context="{'search_default_partner_id':partner_id,'default_partner_id':partner_id, 'default_invoice_method':'picking'}"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='company_id']" position="after">
|
||||
<field name="warehouse_id" groups="stock.group_locations"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -774,7 +774,7 @@ class stock_picking(osv.osv):
|
|||
quant_obj.quants_reserve(cr, uid, quants, move, context=context)
|
||||
#In the end, move quants in correct package
|
||||
if create:
|
||||
quant_obj.write(cr, uid, [x[0] for x in quants], {'package_id': ops.result_package_id and ops.result_package_id.id or False}, context=context)
|
||||
quant_obj.write(cr, uid, [x[0].id for x in quants], {'package_id': ops.result_package_id and ops.result_package_id.id or False}, context=context)
|
||||
res2[move.id] -= qty
|
||||
res[ops.id] = {}
|
||||
res[ops.id][ops.product_id.id] = qty_to_do
|
||||
|
|
Loading…
Reference in New Issue