[MERGE] Merge lp:~openerp-dev/openobject-addons/jam-dev-addons

bzr revid: sbh@tinyerp.com-20101229065245-69k3ys7obdn8eqkw
This commit is contained in:
Sbh (OpenERP) 2010-12-29 12:22:45 +05:30
commit 628debcf9b
31 changed files with 35 additions and 79 deletions

View File

@ -36,8 +36,7 @@ upload the report using the same wizard.
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['base'],
'init_xml': ['security/base_report_security.xml',
'wizard/base_report_design_view.xml'],
'init_xml': ['wizard/base_report_design_view.xml'],
'update_xml': ['base_report_designer_installer.xml'],
'demo_xml': [],
'installable': True,

View File

@ -140,28 +140,16 @@ class ServerParameter( unohelper.Base, XJobExecutor ):
ErrorDialog("Connection Refuse...","Please enter valid Login/Password")
self.win.endExecute()
try:
ids = self.sock.execute(sDatabase,UID,sPassword, 'res.groups' , 'search', [('name','=','OpenOfficeReportDesigner')])
ids_module =self.sock.execute(sDatabase, UID, sPassword, 'ir.module.module', 'search', [('name','=','base_report_designer'),('state', '=', 'installed')])
dict_groups =self.sock.execute(sDatabase, UID,sPassword, 'res.groups' , 'read',ids,['users'])
except :
import traceback,sys
info = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
self.logobj.log_write('ServerParameter', LOG_ERROR, info)
if not len(ids) :
ErrorDialog("Group Not Found!!! Create a group named \n\n"'"OpenOfficeReportDesigner"'" \n\n ","","Group Name Error")
self.logobj.log_write('Group Error',LOG_WARNING, ':Create a group OpenOfficeReportDesigner using database %s' % (sDatabase))
self.win.endExecute()
if not len(ids_module):
ErrorDialog("Please Install base_report_designer module", "", "Module Uninstalled Error")
self.logobj.log_write('Module Not Found',LOG_WARNING, ':base_report_designer not install in database %s' % (sDatabase))
self.win.endExecute()
if UID not in dict_groups[0]['users']:
ErrorDialog("Connection Refuse...","You have not access these Report Designer")
self.logobj.log_write('Connection Refuse',LOG_WARNING, " Not Access Report Designer ")
self.win.endExecute()
else:
desktop=getDesktop()
doc = desktop.getCurrentComponent()

View File

@ -1,22 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data noupdate="1">
<record id="res_groups_openofficereportdesigner0" model="res.groups">
<field eval="[(6,0,[])]" name="menu_access"/>
<field eval="[(6,0,[])]" name="rule_groups"/>
<field eval="[(6,0,[ref('base.user_root')])]" name="users"/>
<field eval="&quot;&quot;&quot;OpenOfficeReportDesigner&quot;&quot;&quot;" name="name"/>
</record>
<record id="ir_model_access_openofficereportdesigner0" model="ir.model.access">
<field name="model_id" ref="base.model_ir_actions_report_xml"/>
<field eval="1" name="perm_read"/>
<field eval="&quot;&quot;&quot;OpenOfficeReportDesigner&quot;&quot;&quot;" name="name"/>
<field eval="1" name="perm_unlink"/>
<field eval="1" name="perm_write"/>
<field eval="1" name="perm_create"/>
<field name="group_id" ref="res_groups_openofficereportdesigner0"/>
</record>
</data>
</openerp>

View File

@ -57,7 +57,7 @@ class lunch_cashbox_clean(osv.osv_memory):
# 'box': box_id,
# 'active': True,
# })
return {}
return {'type': 'ir.actions.act_window_close'}
lunch_cashbox_clean()

View File

@ -48,7 +48,7 @@ class lunch_order_confirm(osv.osv_memory):
for confirm_obj in self.read(cr, uid, ids):
order_ref.confirm(cr, uid, data, confirm_obj['confirm_cashbox'], context)
return {}
return {'type': 'ir.actions.act_window_close'}
lunch_order_confirm()

View File

@ -121,7 +121,7 @@ class mrp_track_move(osv.osv_memory):
new_prodlot = prodlot_obj.create(cr, uid, {'name': 'PRODUCTION:%d:LOT:%d' % (record_id, idx+1), 'product_id': move.product_id.id})
update_val['prodlot_id'] = new_prodlot
move_obj.write(cr, uid, [current_move], update_val)
return {}
return {'type': 'ir.actions.act_window_close'}
mrp_track_move()

View File

@ -48,7 +48,7 @@ class repair_cancel(osv.osv_memory):
else:
raise osv.except_osv(_('Warning!'),_('Repair order is not invoiced.'))
return {}
return {'type': 'ir.actions.act_window_close'}
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
""" Changes the view dynamically

View File

@ -63,7 +63,7 @@ class procurement_compute(osv.osv_memory):
"""
threaded_calculation = threading.Thread(target=self._procure_calculation_orderpoint, args=(cr, uid, ids, context))
threaded_calculation.start()
return {}
return {'type': 'ir.actions.act_window_close'}
procurement_compute()

View File

@ -59,8 +59,8 @@ class procurement_compute_all(osv.osv_memory):
"""
threaded_calculation = threading.Thread(target=self._procure_calculation_all, args=(cr, uid, ids, context))
threaded_calculation.start()
return {}
return {'type': 'ir.actions.act_window_close'}
procurement_compute_all()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -54,7 +54,7 @@ class project_timebox_fill(osv.osv_memory):
if not data[0]['task_ids']:
return {}
self.pool.get('project.task').write(cr, uid, data[0]['task_ids'], {'timebox_id':data[0]['timebox_to_id']})
return {}
return {'type': 'ir.actions.act_window_close'}
project_timebox_fill()

View File

@ -44,7 +44,7 @@ class project_schedule_task(osv.osv_memory):
if context is None:
context = {}
if not 'active_id' in context:
return {}
return {'type': 'ir.actions.act_window_close'}
return phase_pool.schedule_tasks(cr, uid, [context['active_id']], context=context)
project_schedule_task()

View File

@ -97,7 +97,7 @@ class project_scrum_backlog_merge(osv.osv_memory):
#To assing a new product backlog to merged tasks
task_obj.write(cr, uid, task_lines, {'product_backlog_id': id_b})
backlog_obj.unlink(cr, uid, context['active_ids'], context=context)
return {}
return {'type': 'ir.actions.act_window_close'}
project_scrum_backlog_merge()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -62,7 +62,7 @@ class backlog_sprint_assign(osv.osv_memory):
message = _('Product Backlog') + " '" + backlog.name + "' "+ _("is assigned sprint:%s"%(sprint.name))
self.log(cr, uid, backlog.id, message)
backlog_obj.write(cr, uid, backlog_ids, {'sprint_id': data['sprint_id']}, context=context)
return {}
return {'type': 'ir.actions.act_window_close'}
backlog_sprint_assign()

View File

@ -103,5 +103,5 @@ class project_scrum_email(osv.osv_memory):
tools.email_send(user_email, [data.scrum_master_email], data.subject, body, reply_to=user_email)
if data.product_owner_email:
tools.email_send(user_email, [data.product_owner_email], data.subject, body, reply_to=user_email)
return {}
return {'type': 'ir.actions.act_window_close'}
project_scrum_email()

View File

@ -139,7 +139,7 @@ class purchase_requisition_partner(osv.osv_memory):
'order_id': purchase_id
})
order_line_obj.create(cr,uid,order_line)
return {}
return {'type': 'ir.actions.act_window_close'}
purchase_requisition_partner()

View File

@ -128,7 +128,7 @@ class report_webkit_actions(osv.osv_memory):
)
if res[0]:
if not current.open_action:
return {}
return {'type': 'ir.actions.act_window_close'}
return {
'name': _('Client Actions Connections'),

View File

@ -110,8 +110,8 @@ class sale_order_line_make_invoice(osv.osv_memory):
if not invoices:
raise osv.except_osv(_('Warning'), _('Invoice cannot be created for this Sales Order Line due to one of the following reasons:\n1.The state of this sales order line is either "draft" or "cancel"!\n2.The Sales Order Line is Invoiced!'))
return {}
return {'type': 'ir.actions.act_window_close'}
sale_order_line_make_invoice()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -112,7 +112,7 @@ class crm_make_sale(osv.osv_memory):
if make.close:
case_obj.case_close(cr, uid, data)
if not new_ids:
return {}
return {'type': 'ir.actions.act_window_close'}
if len(new_ids)<=1:
value = {
'domain': str([('id', 'in', new_ids)]),

View File

@ -113,6 +113,6 @@ class change_standard_price(osv.osv_memory):
'stock_journal' : res[0].stock_journal.id
}
prod_obj.do_change_standard_price(cr, uid, [rec_id], datas, context)
return {}
return {'type': 'ir.actions.act_window_close'}
change_standard_price()

View File

@ -66,7 +66,7 @@ class stock_fill_inventory(osv.osv_memory):
if ids and len(ids):
ids = ids[0]
else:
return {}
return {'type': 'ir.actions.act_window_close'}
fill_inventory = self.browse(cr, uid, ids, context=context)
res = {}
res_location = {}
@ -113,7 +113,7 @@ class stock_fill_inventory(osv.osv_memory):
if(len(product_ids) == 0):
raise osv.except_osv(_('Message !'), _('No product in this location.'))
return {}
return {'type': 'ir.actions.act_window_close'}
stock_fill_inventory()

View File

@ -84,7 +84,7 @@ class stock_inventory_merge(osv.osv_memory):
'product_qty': quantity,
})
return {}
return {'type': 'ir.actions.act_window_close'}
stock_inventory_merge()

View File

@ -46,7 +46,7 @@ class stock_move_track(osv.osv_memory):
datas = self.read(cr, uid, ids)[0]
move_obj = self.pool.get('stock.move')
move_obj._track_lines(cr, uid, context['active_id'], datas, context=context)
return {}
return {'type': 'ir.actions.act_window_close'}
stock_move_track()
@ -102,7 +102,7 @@ class stock_move_consume(osv.osv_memory):
move_obj.action_consume(cr, uid, move_ids,
data['product_qty'], data['location_id'],
context=context)
return {}
return {'type': 'ir.actions.act_window_close'}
stock_move_consume()
@ -163,7 +163,7 @@ class stock_move_scrap(osv.osv_memory):
move_obj.action_scrap(cr, uid, move_ids,
data['product_qty'], data['location_id'],
context=context)
return {}
return {'type': 'ir.actions.act_window_close'}
stock_move_scrap()
@ -218,7 +218,7 @@ class split_in_production_lot(osv.osv_memory):
if context is None:
context = {}
self.split(cr, uid, ids, context.get('active_ids'), context=context)
return {}
return {'type': 'ir.actions.act_window_close'}
def split(self, cr, uid, ids, move_ids, context=None):
""" To split stock moves into production lot

View File

@ -190,11 +190,8 @@ class stock_partial_move(osv.osv_memory):
p_moves = {}
picking_type = self.__get_picking_type(cr, uid, move_ids)
print picking_type
moves_list = picking_type == 'product_moves_in' and partial.product_moves_in or partial.product_moves_out
print picking_type == 'product_moves_in'
print partial.product_moves_out
print moves_list
for product_move in moves_list:
p_moves[product_move.move_id.id] = product_move
@ -204,11 +201,6 @@ class stock_partial_move(osv.osv_memory):
continue
if not p_moves.get(move.id):
continue
print p_moves[move.id].product_id.id
print p_moves[move.id].quantity
print p_moves[move.id].product_uom.id
partial_datas['move%s' % (move.id)] = {
'product_id' : p_moves[move.id].id,
'product_qty' : p_moves[move.id].quantity,
@ -224,9 +216,8 @@ class stock_partial_move(osv.osv_memory):
})
print partial_datas
move_obj.do_partial(cr, uid, moves_ids_final, partial_datas, context=context)
return {}
return {'type': 'ir.actions.act_window_close'}
stock_partial_move()
stock_partial_move_memory_out()

View File

@ -174,7 +174,7 @@ class stock_partial_picking(osv.osv_memory):
'product_currency': p_moves[move.id].currency.id,
})
pick_obj.do_partial(cr, uid, picking_ids, partial_datas, context=context)
return {}
return {'type': 'ir.actions.act_window_close'}

View File

@ -116,7 +116,7 @@ class stock_split_move_line(osv.osv_memory):
new_obj = move_obj.copy(cr, uid, move.id, {'product_qty' : new_qty, 'product_uos_qty': new_uos_qty, 'state':move.state})
uos_qty = quantity / move.product_qty * move.product_uos_qty
move_obj.write(cr, uid, [move.id], {'product_qty' : quantity, 'product_uos_qty': uos_qty})
return {}
return {'type': 'ir.actions.act_window_close'}
stock_split_move_line()

View File

@ -79,6 +79,6 @@ class stock_split_into(osv.osv_memory):
inventory_obj.write(cr, uid, inventory_id, {'move_ids': [(4, current_move)]}, context=context)
return {}
return {'type': 'ir.actions.act_window_close'}
stock_split_into()

View File

@ -87,7 +87,7 @@ class stock_ups_upload(osv.osv_memory):
report = netsvc._group['report']['report.stock.move.lot.ups_xml']
data['report_type'] = 'raw'
fp = file('/tmp/test.xml', 'w').write(report.create(uid, context['active_id'], ids, {}))
return {}
return {'type': 'ir.actions.act_window_close'}
stock_ups_upload()

View File

@ -48,7 +48,7 @@ class invoice_directly(osv.osv_memory):
'type': 'ir.actions.act_window',
'target': 'new',
}
return {}
return {'type': 'ir.actions.act_window_close'}
invoice_directly()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -86,7 +86,7 @@ class wiki_create_menu(osv.osv_memory):
'action': 'ir.actions.act_window,'+ str(action_id),
}, context)
obj_wiki_group.write(cr, uid, [group_id], {'menu_id':menu_id})
return {}
return {'type': 'ir.actions.act_window_close'}
wiki_create_menu()

View File

@ -87,7 +87,7 @@ class wiki_make_index(osv.osv_memory):
for rs in result:
wiki_pool.write(cr, uid, [rs[1]], {'section':rs[0]})
return {}
return {'type': 'ir.actions.act_window_close'}
wiki_make_index()