@@ -845,7 +845,8 @@
|
||||
|
||||
<field name="debit" select="1"/>
|
||||
<field name="credit" select="1"/>
|
||||
|
||||
<field name="date" select="1"/>
|
||||
|
||||
<separator colspan="4" string="Optional Information"/>
|
||||
<field name="currency_id"/>
|
||||
<field name="amount_currency"/>
|
||||
|
||||
@@ -880,7 +880,7 @@ class account_invoice(osv.osv):
|
||||
|
||||
lines = [(0, 0, l1), (0, 0, l2)]
|
||||
move = {'ref': invoice.number, 'line_id': lines, 'journal_id': pay_journal_id, 'period_id': period_id, 'date': date}
|
||||
move_id = self.pool.get('account.move').create(cr, uid, move)
|
||||
move_id = self.pool.get('account.move').create(cr, uid, move, context=context)
|
||||
|
||||
line_ids = []
|
||||
total = 0.0
|
||||
|
||||
@@ -584,7 +584,7 @@ class account_analytic_account_summary_month(osv.osv):
|
||||
_description = "Hours summary by month"
|
||||
_auto = False
|
||||
_rec_name = 'month'
|
||||
_order = 'month'
|
||||
# _order = 'month'
|
||||
|
||||
def _unit_amount(self, cr, uid, ids, name, arg, context=None):
|
||||
res = {}
|
||||
|
||||
@@ -128,8 +128,9 @@ class base_module_record(osv.osv):
|
||||
noupdate = noupdate or update
|
||||
if not id:
|
||||
field.setAttribute("model", fields[key]['relation'])
|
||||
name = self.pool.get(fields[key]['relation']).browse(cr, uid, val).name
|
||||
field.setAttribute("search", "[('name','=','"+name+"')]")
|
||||
fld_nm = self.pool.get(fields[key]['relation'])._rec_name
|
||||
name = self.pool.get(fields[key]['relation']).read(cr, uid, val,[fld_nm])[fld_nm] or False
|
||||
field.setAttribute("search", str([(str(fld_nm) ,'=', name)]))
|
||||
else:
|
||||
field.setAttribute("ref", id)
|
||||
record.appendChild(field)
|
||||
|
||||
@@ -109,7 +109,14 @@ class email_parser(object):
|
||||
import netsvc
|
||||
netsvc.Logger().notifyChannel('mailgate', netsvc.LOG_ERROR, "%s" % e)
|
||||
|
||||
id = self.rpc('crm.case', 'create', data)
|
||||
try:
|
||||
id = self.rpc('crm.case', 'create', data)
|
||||
|
||||
|
||||
except Exception,e:
|
||||
if getattr(e,'faultCode','') and 'AccessError' in e.faultCode:
|
||||
e = '\n\nThe Specified user does not have an access to the CRM case.'
|
||||
print e
|
||||
attachments = message['attachment']
|
||||
|
||||
for attach in attachments or []:
|
||||
@@ -316,7 +323,11 @@ if __name__ == '__main__':
|
||||
|
||||
msg_txt = email.message_from_file(sys.stdin)
|
||||
|
||||
parser.parse(msg_txt)
|
||||
|
||||
try :
|
||||
parser.parse(msg_txt)
|
||||
except Exception,e:
|
||||
if getattr(e,'faultCode','') and 'Connection unexpectedly closed' in e.faultCode:
|
||||
print e
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -126,17 +126,20 @@ class abstracted_fs:
|
||||
for db_name in result:
|
||||
db, cr = None, None
|
||||
try:
|
||||
db = pooler.get_db_only(db_name)
|
||||
cr = db.cursor()
|
||||
cr.execute("SELECT 1 FROM pg_class WHERE relkind = 'r' AND relname = 'ir_module_module'")
|
||||
if not cr.fetchone():
|
||||
continue
|
||||
|
||||
cr.execute("select id from ir_module_module where name like 'document%' and state='installed' ")
|
||||
res = cr.fetchone()
|
||||
if res and len(res):
|
||||
self.db_name_list.append(db_name)
|
||||
cr.commit()
|
||||
try:
|
||||
db = pooler.get_db_only(db_name)
|
||||
cr = db.cursor()
|
||||
cr.execute("SELECT 1 FROM pg_class WHERE relkind = 'r' AND relname = 'ir_module_module'")
|
||||
if not cr.fetchone():
|
||||
continue
|
||||
|
||||
cr.execute("select id from ir_module_module where name like 'document%' and state='installed' ")
|
||||
res = cr.fetchone()
|
||||
if res and len(res):
|
||||
self.db_name_list.append(db_name)
|
||||
cr.commit()
|
||||
except Exception, e:
|
||||
log(e)
|
||||
finally:
|
||||
if cr is not None:
|
||||
cr.close()
|
||||
|
||||
@@ -304,11 +304,14 @@ class pos_order(osv.osv):
|
||||
def create_picking(self, cr, uid, ids, context={}):
|
||||
"""Create a picking for each order and validate it."""
|
||||
picking_obj = self.pool.get('stock.picking')
|
||||
|
||||
partner_obj = self.pool.get('res.partner')
|
||||
address_id = False
|
||||
orders = self.browse(cr, uid, ids, context)
|
||||
for order in orders:
|
||||
if not order.last_out_picking:
|
||||
new = True
|
||||
if order.partner_id.id:
|
||||
address_id = partner_obj.address_get(cr, uid, [order.partner_id.id], ['delivery'])['delivery']
|
||||
picking_id = picking_obj.create(cr, uid, {
|
||||
'origin': order.name,
|
||||
'type': 'out',
|
||||
@@ -318,7 +321,8 @@ class pos_order(osv.osv):
|
||||
'invoice_state': 'none',
|
||||
'auto_picking': True,
|
||||
'pos_order': order.id,
|
||||
})
|
||||
'address_id' : address_id
|
||||
},context)
|
||||
self.write(cr, uid, [order.id], {'last_out_picking': picking_id})
|
||||
else:
|
||||
picking_id = order.last_out_picking.id
|
||||
|
||||
@@ -45,7 +45,7 @@ class product_pricelist(report_sxw.rml_parse):
|
||||
qtys = 1
|
||||
|
||||
for i in range(1,6):
|
||||
if form['qty'+str(i)] >= 0 and form['qty'+str(i)] not in vals.values():
|
||||
if form['qty'+str(i)] > 0 and form['qty'+str(i)] not in vals.values():
|
||||
vals['qty'+str(qtys)] = form['qty'+str(i)]
|
||||
qtys += 1
|
||||
lst.append(vals)
|
||||
@@ -54,7 +54,7 @@ class product_pricelist(report_sxw.rml_parse):
|
||||
def _set_quantity(self,form):
|
||||
for i in range(1,6):
|
||||
q = 'qty%d'%i
|
||||
if form[q] >=0 and form[q] not in self.quantity:
|
||||
if form[q] >0 and form[q] not in self.quantity:
|
||||
self.quantity.append(form[q])
|
||||
# else:
|
||||
# self.quantity.append(0)
|
||||
|
||||
@@ -955,7 +955,12 @@ class stock_move(osv.osv):
|
||||
['prodlot_id'])]
|
||||
def _default_location_destination(self, cr, uid, context={}):
|
||||
if context.get('move_line', []):
|
||||
return context['move_line'][0][2] and context['move_line'][0][2]['location_dest_id'] or False
|
||||
if context['move_line'][0]:
|
||||
if isinstance(context['move_line'][0],(tuple,list)):
|
||||
return context['move_line'][0][2] and context['move_line'][0][2]['location_dest_id'] or False
|
||||
else:
|
||||
move_list = self.pool.get('stock.move').read(cr, uid, context['move_line'][0],['location_dest_id'])
|
||||
return move_list and move_list['location_dest_id'][0] or False
|
||||
if context.get('address_out_id', False):
|
||||
return self.pool.get('res.partner.address').browse(cr, uid, context['address_out_id'], context).partner_id.property_stock_customer.id
|
||||
return False
|
||||
|
||||
@@ -343,7 +343,7 @@
|
||||
<field name="usage" select="1"/>
|
||||
<field name="account_id" select="1"/>
|
||||
<field name="location_id"/>
|
||||
<field name="address_id" context="{'context_display':'partner'}"/>
|
||||
<field name="address_id" context="{'contact_display':'partner'}"/>
|
||||
<field name="icon"/>
|
||||
<newline/>
|
||||
<group col="2" colspan="2">
|
||||
@@ -422,7 +422,7 @@
|
||||
<field name="lot_stock_id"/>
|
||||
<field name="lot_output_id"/>
|
||||
<newline/>
|
||||
<field name="partner_address_id" context="{'context_display':'partner'}"/>
|
||||
<field name="partner_address_id" context="{'contact_display':'partner'}"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -436,7 +436,7 @@
|
||||
<field name="lot_input_id"/>
|
||||
<field name="lot_stock_id"/>
|
||||
<field name="lot_output_id"/>
|
||||
<field name="partner_address_id" context="{'context_display':'partner'}"/>
|
||||
<field name="partner_address_id" context="{'contact_display':'partner'}"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -458,7 +458,7 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Move Lines">
|
||||
<field name="address_id" invisible="True" context="{'context_display':'partner'}"/>
|
||||
<field name="address_id" invisible="True" context="{'contact_display':'partner'}"/>
|
||||
<field name="picking_id" invisible="True"/>
|
||||
<field domain="[('picking_id','<>',picking_id),('state','in',['confirmed','assigned']),('picking_id.address_id','=',address_id)]" name="move_ids" nolabel="1"/><newline/>
|
||||
<group colspan="4">
|
||||
@@ -521,7 +521,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Packing list">
|
||||
<group colspan="4" col="6">
|
||||
<field name="address_id" select="2" context="{'context_display':'partner'}"/>
|
||||
<field name="address_id" select="2" context="{'contact_display':'partner'}"/>
|
||||
<field name="type"/>
|
||||
<field name="name" readonly="1"/>
|
||||
<field name="date"/>
|
||||
@@ -542,7 +542,7 @@
|
||||
<field colspan="4" invisible="1" name="name" select="1"/>
|
||||
<field invisible="1" name="date"/>
|
||||
<field name="date_planned"/>
|
||||
<field name="address_id" select="1" context="{'context_display':'partner'}"/>
|
||||
<field name="address_id" select="1" context="{'contact_display':'partner'}"/>
|
||||
<field groups="base.group_extended" name="product_packaging"/>
|
||||
<field name="prodlot_id" select="2"
|
||||
context="{'location_id':location_id, 'product_id':product_id}"
|
||||
@@ -990,7 +990,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Input Packing List">
|
||||
<group colspan="4" col="6">
|
||||
<field name="address_id" on_change="onchange_partner_in(address_id)" select="2" context="{'context_display':'partner'}"/>
|
||||
<field name="address_id" on_change="onchange_partner_in(address_id)" select="2" context="{'contact_display':'partner'}"/>
|
||||
<field name="origin" select="2"/>
|
||||
<field name="invoice_state" select="2" string="Invoice Control"/>
|
||||
<field name="name" readonly="1" select="1"/>
|
||||
@@ -1242,7 +1242,7 @@
|
||||
<field name="date"/>
|
||||
<field name="date_planned"/>
|
||||
<field name="priority"/>
|
||||
<field name="address_id" select="2" context="{'context_display':'partner'}"/>
|
||||
<field name="address_id" select="2" context="{'contact_display':'partner'}"/>
|
||||
<newline/>
|
||||
<field name="picking_id" select="2"/>
|
||||
<field name="prodlot_id" select="2"
|
||||
|
||||
Reference in New Issue
Block a user