bzr revid: fp@tinyerp.com-20081028121001-ag9t1wv15xqq02fc
This commit is contained in:
Fabien Pinckaers 2008-10-28 13:10:01 +01:00
parent b07a8834d0
commit 550e2b4cbb
5 changed files with 12 additions and 4 deletions

View File

@ -386,6 +386,10 @@ class product_product(osv.osv):
res = {}
for p in self.browse(cr, uid, ids, context):
data = self._get_partner_code_name(cr, uid, [], p.id, context.get('partner_id', None), context)
if not data['code']:
data['name'] = p.code
if not data['name']:
data['name'] = p.name
res[p.id] = (data['code'] and ('['+data['code']+'] ') or '') + \
(data['name'] or '')
return res

View File

@ -898,6 +898,7 @@ class sale_order_line(osv.osv):
}
else:
result.update({'price_unit': price})
print result
return {'value': result, 'domain': domain,'warning':warning}
def product_uom_change(self, cursor, user, ids, pricelist, product, qty=0,

View File

@ -612,7 +612,8 @@ class stock_picking(osv.osv):
continue
payment_term_id = False
partner = picking.address_id and picking.address_id.partner_id
raise osv.except_osv(_('Error, no partner !'),
if not partner:
raise osv.except_osv(_('Error, no partner !'),
_('Please put a partner on the picking list if you want to generate invoice.'))
if type in ('out_invoice', 'out_refund'):

View File

@ -608,6 +608,7 @@
<field name="name" select="1" readonly="1"/>
<field name="min_date" select="1"/>
<field name="backorder_id" select="2" readonly="1"/>
<field name="origin" select="2"/>
</group>
<notebook colspan="4">
<page string="General Information">
@ -796,6 +797,7 @@
<field name="min_date" select="2"/>
<field name="invoice_state"/>
<field name="backorder_id" select="2" readonly="1"/>
<field name="origin" select="2" readonly="1"/>
</group>
<notebook colspan="4">
<page string="General Information">

View File

@ -90,9 +90,9 @@ def _get_type(obj, cr, uid, data, context):
return {'type': type}
def _create_invoice(obj, cr, uid, data, context):
if context and context.get('new_picking',False):
data['id'] = context['new_picking']
data['ids'] = [context['new_picking']]
if data['form'].get('new_picking',False):
data['id'] = data['form']['new_picking']
data['ids'] = [data['form']['new_picking']]
pool = pooler.get_pool(cr.dbname)
picking_obj = pooler.get_pool(cr.dbname).get('stock.picking')
mod_obj = pool.get('ir.model.data')