diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 9814214786a..c641b417e14 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -612,10 +612,11 @@ class account_invoice(osv.osv): line2 = {} for x, y, l in line: tmp = str(l['account_id']) - tmp += '-'+str('tax_code_id' in l and l['tax_code_id'] or "False") - tmp += '-'+str('product_id' in l and l['product_id'] or "False") - tmp += '-'+str('analytic_account_id' in l and l['analytic_account_id'] or "False") - + tmp += '-'+str(l.get('tax_code_id',"False")) + tmp += '-'+str(l.get('product_id',"False")) + tmp += '-'+str(l.get('analytic_account_id',"False")) + tmp += '-'+str(l.get('date_maturity',"False")) + if tmp in line2: am = line2[tmp]['debit'] - line2[tmp]['credit'] + (l['debit'] - l['credit']) line2[tmp]['debit'] = (am > 0) and am or 0.0 diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml index cb6d549a7bd..c5b6de83b64 100644 --- a/addons/account/report/invoice.rml +++ b/addons/account/report/invoice.rml @@ -233,7 +233,8 @@ [[ repeatIn(objects,'o') ]] - [[ setLang(o.partner_id.lang) ]] + JJJJJ [[ o.partner_id.name ]] + [[ setLang(o.partner_id.lang) ]] @@ -300,7 +301,7 @@ [[ o.currency_id.code ]] - [[ format(l.note or removeParentNode('tr')) ]] + [[ format(l.note) or removeParentNode('tr') ]] diff --git a/addons/account_invoice_layout/report/report_account_invoice_layout.rml b/addons/account_invoice_layout/report/report_account_invoice_layout.rml index c9905fc5b68..74d33a8e5ec 100644 --- a/addons/account_invoice_layout/report/report_account_invoice_layout.rml +++ b/addons/account_invoice_layout/report/report_account_invoice_layout.rml @@ -126,7 +126,7 @@ Invoice [[ ((o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')) or removeParentNode('para')) and '' ]] [[ o.number ]] PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma') or removeParentNode('para')) and '' ]] Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]] -Canceled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] +Cancelled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]][[ o.number ]] @@ -163,7 +163,7 @@ - Note : [[ format(a['note'] or removeParentNode('tr')) ]] + Note : [[ format(a['note']) or removeParentNode('tr') ]] @@ -173,8 +173,8 @@ - [[ a['type']=='text' and a['name'] or removeParentNode('blockTable') ]] - [[ a['type']=='text' and '' or removeParentNode('blockTable') ]] + [[ a['type']=='text' and format(a['name']) or removeParentNode('blockTable') ]] + [[ a['type']=='text' and '' ]] [[ a['type']!='break' and removeParentNode('pageBreak')]] @@ -232,7 +232,7 @@ Amount - [[ repeatIn(o.tax_line,'t') ]][[ t.name ]] + [[ repeatIn(o.tax_line,'t') ]][[ t.name ]] [[ '%.2f' % t.base ]] [[ '%.2f' % t.amount]] @@ -257,7 +257,7 @@ -[[ format(o.comment) or '' ]] -[[ format(o.payment_term and o.payment_term.note) or '' ]] +[[ format(o.comment) or removeParentNode('para') ]] +[[ format(o.payment_term and o.payment_term.note) or removeParentNode('para') ]] \ No newline at end of file diff --git a/addons/account_invoice_layout/report/special_message_invoice.rml b/addons/account_invoice_layout/report/special_message_invoice.rml index 154c91dc536..b227ee0c3d0 100644 --- a/addons/account_invoice_layout/report/special_message_invoice.rml +++ b/addons/account_invoice_layout/report/special_message_invoice.rml @@ -130,7 +130,7 @@ Invoice [[ ((o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')) or removeParentNode('para')) and '' ]] [[ o.number ]] PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma') or removeParentNode('para')) and '' ]] Draft Invoice [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]] -Canceled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] +Cancelled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] [[ o.number ]] Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]][[ o.number ]] @@ -165,7 +165,7 @@ - Note : [[ format(a['note'] or removeParentNode('tr')) ]] + Note : [[ format(a['note']) or removeParentNode('tr') ]] @@ -175,8 +175,8 @@ - [[ a['type']=='text' and a['name'] or removeParentNode('blockTable') ]] - [[ a['type']=='text' and '' or removeParentNode('blockTable') ]] + [[ a['type']=='text' and format(a['name']) or removeParentNode('blockTable') ]] + [[ a['type']=='text' and '' ]] [[ a['type']!='break' and removeParentNode('pageBreak')]] @@ -234,7 +234,7 @@ Amount - [[ repeatIn(o.tax_line,'t') ]][[ t.name ]] + [[ repeatIn(o.tax_line,'t') ]][[ t.name ]] [[ '%.2f' % t.base ]] [[ '%.2f' % t.amount]] @@ -259,14 +259,14 @@ -[[ format(o.comment) or '' ]] -[[ format(o.payment_term and o.payment_term.note) or '' ]] +[[ format(o.comment) or removeParentNode('para') ]] +[[ format(o.payment_term and o.payment_term.note) or removeParentNode('para') ]]
[[ repeatIn((spcl_msg(data['form']) and spcl_msg(data['form']).splitlines()) or [], 'note') ]] -[[ note or removeParentNode('para') ]] +[[ format(note) or removeParentNode('para') ]]
diff --git a/addons/crm/crm.py b/addons/crm/crm.py index e42c0a4a455..a4cab48b1c5 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -481,7 +481,9 @@ class crm_case(osv.osv): write['priority'] = action.act_priority if action.act_email_cc: if '@' in (case.email_cc or ''): - write['email_cc'] = case.email_cc+','+action.act_email_cc + emails = case.email_cc.split(",") + if action.act_email_cc not in emails:# and '<'+str(action.act_email_cc)+">" not in emails: + write['email_cc'] = case.email_cc+','+action.act_email_cc else: write['email_cc'] = action.act_email_cc write['date_action_last'] = time.strftime('%Y-%m-%d %H:%M:%S') diff --git a/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py b/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py old mode 100644 new mode 100755 index 11462169b06..11169a4e215 --- a/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py +++ b/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py @@ -101,7 +101,7 @@ class email_parser(object): 'email_cc': self._decode_header(msg['Cc'] or ''), 'canal_id': self.canal_id, 'user_id': False, - 'history_line': [(0, 0, {'description': message['body'], 'email': msg['From'] })], + 'history_line': [(0, 0, {'name': 'Create','section_id': self.section_id,'canal_id': self.canal_id,'description': message['body'], 'email': msg['From'] })], } try: data.update(self.partner_get(self._decode_header(msg['From']))) @@ -111,7 +111,6 @@ class email_parser(object): try: id = self.rpc('crm.case', 'create', data) - except Exception,e: if getattr(e,'faultCode','') and 'AccessError' in e.faultCode: @@ -192,9 +191,8 @@ class email_parser(object): body['body'] = body_data data = { - 'history_line': [(0, 0, {'description': body['body'], 'email': msg['From']})], + 'history_line': [(0, 0, {'name': 'Close','section_id': self.section_id,'canal_id': self.canal_id,'description': body['body'], 'email': msg['From']})], } - act = 'case_close' if 'state' in actions: if actions['state'] in ['draft','close','cancel','open','pending']: @@ -248,7 +246,7 @@ class email_parser(object): self.rpc('crm.case', act, [id]) body2 = '\n'.join(map(lambda l: '> '+l, (body or '').split('\n'))) data = { - 'history_line': [(0, 0, {'description': body, 'email': msg['From'][:84]})], + 'history_line': [(0, 0, {'name': 'Open','section_id': self.section_id,'canal_id': self.canal_id,'description': body, 'email': msg['From'][:84]})], } self.rpc('crm.case', 'write', [id], data) return id diff --git a/addons/document/document_data.xml b/addons/document/document_data.xml index 33c6f80763a..511de005b6f 100644 --- a/addons/document/document_data.xml +++ b/addons/document/document_data.xml @@ -1,6 +1,6 @@ - + .pdf diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index e1f02ec39a6..caef74d4540 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -483,6 +483,14 @@ class mrp_production(osv.osv): result = {'product_uom':uom} return {'value':result} + def bom_id_change(self, cr, uid, ids, product): + if not product: + return {} + res = self.pool.get('mrp.bom').read(cr, uid, [product], ['routing_id'])[0] + routing_id = res['routing_id'] and res['routing_id'][0] + result = {'routing_id':routing_id} + return {'value':result} + def action_picking_except(self, cr, uid, ids): self.write(cr, uid, ids, {'state':'picking_except'}) return True diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 917e971ee2b..83a1b4423a8 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -464,7 +464,7 @@ - + diff --git a/addons/stock/wizard/wizard_location_product.py b/addons/stock/wizard/wizard_location_product.py index 04461d26250..68f49f1b46a 100755 --- a/addons/stock/wizard/wizard_location_product.py +++ b/addons/stock/wizard/wizard_location_product.py @@ -45,7 +45,7 @@ class product_by_location(wizard.interface):