diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 40f8fd277a8..b2fa85304bb 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -2508,8 +2508,6 @@ - -
@@ -2519,7 +2517,6 @@ - diff --git a/addons/account/i18n/hr.po b/addons/account/i18n/hr.po index 329ae8fa080..1fbbfcbd0ab 100644 --- a/addons/account/i18n/hr.po +++ b/addons/account/i18n/hr.po @@ -2668,10 +2668,10 @@ msgid "" "partners accounts (for debit/credit computations), closed for deprecated " "accounts." msgstr "" -"Pogled: Sintetički zbrojni konto, ne sadrži knjiženja\r\n" -"Konsolidacija: Zbrojni konto za više poduzeća i paralelne kontne planove\r\n" -"Obveze: Salda konta partnera - dobavljači\r\n" -"Potraživanja: Salda konta partnera - kupci\r\n" +"Pogled: Sintetički zbrojni konto, ne sadrži knjiženja\n" +"Konsolidacija: Zbrojni konto za više poduzeća i paralelne kontne planove\n" +"Obveze: Salda konta partnera - dobavljači\n" +"Potraživanja: Salda konta partnera - kupci\n" "Zatvoren: Za konta koja se više ne koriste" #. module: account diff --git a/addons/account_invoice_layout/account_invoice_layout_demo.xml b/addons/account_invoice_layout/account_invoice_layout_demo.xml index cb8df67d997..e49079c9656 100644 --- a/addons/account_invoice_layout/account_invoice_layout_demo.xml +++ b/addons/account_invoice_layout/account_invoice_layout_demo.xml @@ -4,11 +4,11 @@ OpenERP SA - ERP & CRM Solutions.... + ERP & CRM Solutions.... Tiny sprl Be Expert with the Experts... - \ No newline at end of file + diff --git a/addons/auction/auction_view.xml b/addons/auction/auction_view.xml index 648d8f271e8..f91f77429ca 100644 --- a/addons/auction/auction_view.xml +++ b/addons/auction/auction_view.xml @@ -388,8 +388,9 @@ string="Sold" help="Buy object" domain="[('state','=','sold')]"/> - - + + + diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 11bd22e6134..facb598427b 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -398,10 +398,13 @@ property or property parameter."), """ res = None def ics_datetime(idate, short=False): - if short: - return date.fromtimestamp(time.mktime(time.strptime(idate, '%Y-%m-%d'))) + if idate: + if short: + return date.fromtimestamp(time.mktime(time.strptime(idate, '%Y-%m-%d'))) + else: + return datetime.strptime(idate, '%Y-%m-%d %H:%M:%S') else: - return datetime.strptime(idate, '%Y-%m-%d %H:%M:%S') + return False try: # FIXME: why isn't this in CalDAV? import vobject @@ -482,35 +485,37 @@ property or property parameter."), sign = att.sent_by_uid and att.sent_by_uid.signature or '' sign = '
'.join(sign and sign.split('\n') or []) res_obj = att.ref - sub = res_obj.name - att_infos = [] - other_invitaion_ids = self.search(cr, uid, [('ref', '=', res_obj._name + ',' + str(res_obj.id))]) - for att2 in self.browse(cr, uid, other_invitaion_ids): - att_infos.append(((att2.user_id and att2.user_id.name) or \ - (att2.partner_id and att2.partner_id.name) or \ - att2.email) + ' - Status: ' + att2.state.title()) - body_vals = {'name': res_obj.name, - 'start_date': res_obj.date, - 'end_date': res_obj.date_deadline or False, - 'description': res_obj.description or '-', - 'location': res_obj.location or '-', - 'attendees': '
'.join(att_infos), - 'user': res_obj.user_id and res_obj.user_id.name or 'OpenERP User', - 'sign': sign, - 'company': company - } - body = html_invitation % body_vals - if mail_to and email_from: - attach = self.get_ics_file(cr, uid, res_obj, context=context) - tools.email_send( - email_from, - mail_to, - sub, - body, - attach=attach and [('invitation.ics', attach)] or None, - subtype='html', - reply_to=email_from - ) + if res_obj: + att_infos = [] + sub = res_obj.name + other_invitation_ids = self.search(cr, uid, [('ref', '=', res_obj._name + ',' + str(res_obj.id))]) + + for att2 in self.browse(cr, uid, other_invitation_ids): + att_infos.append(((att2.user_id and att2.user_id.name) or \ + (att2.partner_id and att2.partner_id.name) or \ + att2.email) + ' - Status: ' + att2.state.title()) + body_vals = {'name': res_obj.name, + 'start_date': res_obj.date, + 'end_date': res_obj.date_deadline or False, + 'description': res_obj.description or '-', + 'location': res_obj.location or '-', + 'attendees': '
'.join(att_infos), + 'user': res_obj.user_id and res_obj.user_id.name or 'OpenERP User', + 'sign': sign, + 'company': company + } + body = html_invitation % body_vals + if mail_to and email_from: + attach = self.get_ics_file(cr, uid, res_obj, context=context) + tools.email_send( + email_from, + mail_to, + sub, + body, + attach=attach and [('invitation.ics', attach)] or None, + subtype='html', + reply_to=email_from + ) return True def onchange_user_id(self, cr, uid, ids, user_id, *args, **argv): diff --git a/addons/base_calendar/wizard/base_calendar_invite_attendee.py b/addons/base_calendar/wizard/base_calendar_invite_attendee.py index f60139c0600..98369962ab7 100644 --- a/addons/base_calendar/wizard/base_calendar_invite_attendee.py +++ b/addons/base_calendar/wizard/base_calendar_invite_attendee.py @@ -128,8 +128,9 @@ send an Email to Invited Person') att = att_obj.browse(cr, uid, context_id) att_val.update({ 'parent_ids': [(4, att.id)], - 'ref': att.ref._name + ',' +str(att.ref.id) + 'ref': att.ref and (att.ref._name + ',' +str(att.ref.id)) or False }) + attendees.append(att_obj.create(cr, uid, att_val)) if model_field: for attendee in attendees: diff --git a/addons/base_module_quality/pylint_test/pylint_test.py b/addons/base_module_quality/pylint_test/pylint_test.py index f30a7b34be8..102f93c469e 100644 --- a/addons/base_module_quality/pylint_test/pylint_test.py +++ b/addons/base_module_quality/pylint_test/pylint_test.py @@ -54,9 +54,8 @@ class quality_test(base_module_quality.abstract_quality_check): flag = True file_path = os.path.join(module_path, file_py) try: - import pylint res = os.popen('pylint --rcfile=' + config_file_path + ' ' + file_path).read() - except Exception, e: + except Exception: self.error = True self.log.exception("Cannot run pylint test for %s", file_path) self.result += _("Error. Is pylint correctly installed? (http://pypi.python.org/pypi/pylint)")+"\n" diff --git a/addons/base_setup/installer.py b/addons/base_setup/installer.py index 77303336ab7..0c8478ba57d 100644 --- a/addons/base_setup/installer.py +++ b/addons/base_setup/installer.py @@ -19,7 +19,6 @@ # ############################################################################## from osv import fields, osv -import netsvc class base_setup_installer(osv.osv_memory): _name = 'base.setup.installer' diff --git a/addons/crm/report/report_businessopp.py b/addons/crm/report/report_businessopp.py index 7cadb41359a..07751622abe 100644 --- a/addons/crm/report/report_businessopp.py +++ b/addons/crm/report/report_businessopp.py @@ -83,12 +83,12 @@ class report_custom(report_int): if benefit < minbenef: minbenef = benefit - tuple = (proba * 100, benefit) + tuple_benefit = (proba * 100, benefit) responsible_data.setdefault(userid, []) - responsible_data[userid].append(tuple) + responsible_data[userid].append(tuple_benefit) - tuple = (proba * 100, cost, benefit) - data.append(tuple) + tuple_benefit = (proba * 100, cost, benefit) + data.append(tuple_benefit) responsible_names[userid] = (row['name'] or '/').replace('/','//') diff --git a/addons/document/report/document_report.py b/addons/document/report/document_report.py index 646f39ec590..419b37ca68e 100644 --- a/addons/document/report/document_report.py +++ b/addons/document/report/document_report.py @@ -21,7 +21,6 @@ from osv import fields,osv -import time import tools class report_document_user(osv.osv): diff --git a/addons/hr/hr_demo.xml b/addons/hr/hr_demo.xml index ad637250ed7..0d41ff1a4c9 100644 --- a/addons/hr/hr_demo.xml +++ b/addons/hr/hr_demo.xml @@ -65,12 +65,14 @@ Quentin Paolino + Antoine Philippe + diff --git a/addons/idea/i18n/zh_CN.po b/addons/idea/i18n/zh_CN.po index 7ee6810c30d..db39720b746 100644 --- a/addons/idea/i18n/zh_CN.po +++ b/addons/idea/i18n/zh_CN.po @@ -220,8 +220,8 @@ msgid "" "managers can obtain an easy view on best ideas from all the users. Once " "installed, check the menu 'Ideas' in the 'Tools' main menu." msgstr "" -"这模块允许你在企业创新里简单和有效地使用.\r\n" -"它允许每个人对不同注意表达构想, 其它用户能评价这些构想和对具体的构想进行投票. 每个构想根据不同投票决定得分.\r\n" +"这模块允许你在企业创新里简单和有效地使用.\n" +"它允许每个人对不同注意表达构想, 其它用户能评价这些构想和对具体的构想进行投票. 每个构想根据不同投票决定得分.\n" "管理人员可以很容易得到所有用户对构想的评价." #. module: idea diff --git a/addons/mail_gateway/mail_gateway.py b/addons/mail_gateway/mail_gateway.py index c8d75a3a873..c775b97d520 100644 --- a/addons/mail_gateway/mail_gateway.py +++ b/addons/mail_gateway/mail_gateway.py @@ -136,8 +136,8 @@ class mailgate_thread(osv.osv): 'partner_id': partner_id, 'res_id': case.id, 'date': time.strftime('%Y-%m-%d %H:%M:%S'), - 'message_id': message_id, - 'description': details or (hasattr(case, 'description') and case.description or False), + 'message_id': message_id, + 'description': details or (hasattr(case, 'description') and case.description or False), 'attachment_ids': [(6, 0, attachments)] } @@ -283,7 +283,7 @@ class mailgate_tool(osv.osv_memory): 'description': msg.get('body', msg.get('from')), 'history': True, 'partner_id': partner_id, - 'res_model': model, + 'model': model, 'email_cc': msg.get('cc'), 'email_from': msg.get('from'), 'email_to': msg.get('to'), diff --git a/addons/mail_gateway/mail_gateway_view.xml b/addons/mail_gateway/mail_gateway_view.xml index 203d9a942bf..de1a88c34c7 100644 --- a/addons/mail_gateway/mail_gateway_view.xml +++ b/addons/mail_gateway/mail_gateway_view.xml @@ -10,13 +10,13 @@ - + - + @@ -50,7 +50,9 @@ - + + + @@ -63,13 +65,21 @@ - - + + + + + + + + + + + - mailgate.thread.form mailgate.thread @@ -127,8 +137,9 @@ form [('history', '=', True)] + {"search_default_user_id":uid} - + Mailgateway Threads mailgate.thread @@ -149,7 +160,7 @@ - + Emails @@ -159,7 +170,7 @@ [('history', '=', True)] - + tree @@ -173,10 +184,6 @@ - - - + + + + + + + diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 8b616c3d7ac..5ad90bf25d6 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -19,11 +19,11 @@ # ############################################################################## -from mx import DateTime -from datetime import datetime, timedelta +from itertools import groupby +from operator import itemgetter +from datetime import datetime from osv import osv, fields from tools.translate import _ -import ir import netsvc import time @@ -178,8 +178,8 @@ class mrp_bom(osv.osv): 'code': fields.char('Reference', size=16), 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the bills of material without removing it."), 'type': fields.selection([('normal','Normal BoM'),('phantom','Sets / Phantom')], 'BoM Type', required=True, - help= "If a sub-product is used in several products, it can be useful to create its own BoM."\ - "Though if you don't want separated production orders for this sub-product, select Set/Phantom as BoM type."\ + help= "If a sub-product is used in several products, it can be useful to create its own BoM. "\ + "Though if you don't want separated production orders for this sub-product, select Set/Phantom as BoM type. "\ "If a Phantom BoM is used for a root product, it will be sold and shipped as a set of components, instead of being produced."), 'method': fields.function(_compute_type, string='Method', method=True, type='selection', selection=[('',''),('stock','On Stock'),('order','On Order'),('set','Set / Pack')]), 'date_start': fields.date('Valid From', help="Validity of this BoM or component. Keep empty if it's always valid."), @@ -250,7 +250,6 @@ class mrp_bom(osv.osv): @param properties: List of related properties. @return: False or BoM id. """ - bom_result = False cr.execute('select id from mrp_bom where product_id=%s and bom_id is null order by sequence', (product_id,)) ids = map(lambda x: x[0], cr.fetchall()) max_prop = 0 @@ -356,14 +355,16 @@ class many2many_domain(fields.many2many): def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} - res = {} + move_obj = obj.pool.get('stock.move') - for prod in obj.browse(cr, user, ids, context=context): - cr.execute("SELECT move_id from mrp_production_move_ids where\ - production_id=%s" % (prod.id)) - m_ids = map(lambda x: x[0], cr.fetchall()) - final = move_obj.search(cr, user, self._domain + [('id', 'in', tuple(m_ids))]) - res[prod.id] = final + res = {}.fromkeys(ids, []) + valid_move_ids = move_obj.search(cr, user, self._domain) # move ids relative to domain argument + cr.execute("SELECT production_id, move_id from mrp_production_move_ids where production_id in %s and move_id in %s", + [tuple(ids), tuple(valid_move_ids)]) + related_move_map = cr.fetchall() + related_move_dict = dict((k, list(set([v[1] for v in itr]))) for k, itr in groupby(related_move_map, itemgetter(0))) + res.update(related_move_dict) + return res class one2many_domain(fields.one2many): @@ -374,13 +375,14 @@ class one2many_domain(fields.one2many): def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): if not context: context = {} - res = {} + move_obj = obj.pool.get('stock.move') - for prod in obj.browse(cr, user, ids, context=context): - cr.execute("SELECT id from stock_move where production_id=%s" % (prod.id)) - m_ids = map(lambda x: x[0], cr.fetchall()) - final = move_obj.search(cr, user, self._domain + [('id', 'in', tuple(m_ids))]) - res[prod.id] = final + res = {}.fromkeys(ids, []) + key = operator.itemgetter(0) + move_ids = move_obj.search(cr, user, self._domain+[('production_id', 'in', tuple(ids))], context=context) + related_move_dict = dict([(o.production_id.id, [o.id]) for o in move_obj.browse(cr, user, move_ids, context=context)]) + res.update(related_move_dict) + return res class mrp_production(osv.osv): @@ -479,7 +481,7 @@ class mrp_production(osv.osv): 'name': lambda x, y, z, c: x.pool.get('ir.sequence').get(y, z, 'mrp.production') or '/', 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.production', context=c), } - _order = 'date_planned asc, priority desc'; + _order = 'priority desc, date_planned asc'; def _check_qty(self, cr, uid, ids): orders = self.browse(cr, uid, ids) @@ -681,7 +683,6 @@ class mrp_production(osv.osv): stock_mov_obj = self.pool.get('stock.move') production = self.browse(cr, uid, production_id) - raw_product_todo = [] final_product_todo = [] produced_qty = 0 @@ -800,7 +801,6 @@ class mrp_production(osv.osv): """ Changes state to In Production and writes starting date. @return: True """ - move_ids = [] self.write(cr, uid, ids, {'state': 'in_production', 'date_start': time.strftime('%Y-%m-%d %H:%M:%S')}) return True diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index ba7ebef1973..71fbfd0851d 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -33,7 +33,7 @@ - Property Categories + Property Groups ir.actions.act_window mrp.property.group form @@ -64,7 +64,6 @@ form - @@ -82,8 +81,8 @@ - + @@ -132,7 +131,7 @@ - + @@ -192,9 +191,11 @@ - - + + + +
@@ -252,15 +253,18 @@ form - - - - + + - - - - + + + + + + + + + @@ -276,12 +280,25 @@ + + mrp.routing.search + mrp.routing + tree + + + + + + + + Routings ir.actions.act_window mrp.routing form + Routings define the assembly operations to be done in work centers for manufacturing a certain product. They are usually attached to bills of materials which will define the assembly of products required for manufacture or for finished products. @@ -358,16 +375,14 @@ - + - - + - - + @@ -497,10 +512,10 @@ + - @@ -625,16 +640,16 @@ states="done,cancel"/> - + -