Skip to content

Commit 7dd6954

Browse files
committed
[MERGE] forward port of branch 7.0 up to 0c4bc1c
2 parents e7a0b1b + 0c4bc1c commit 7dd6954

File tree

8 files changed

+54
-21
lines changed

8 files changed

+54
-21
lines changed

.bzrignore

-15
This file was deleted.

.gitignore

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# sphinx build directories
2+
_build/
3+
4+
# dotfiles
5+
.*
6+
!.gitignore
7+
# compiled python files
8+
*.py[co]
9+
# setup.py egg_info
10+
*.egg-info
11+
# emacs backup files
12+
*~
13+
# hg stuff
14+
*.orig
15+
status
16+
# odoo filestore
17+
openerp/filestore
18+
# generated for windows installer?
19+
install/win32/*.bat
20+
install/win32/meta.py
21+
22+
# various virtualenv
23+
/bin/
24+
/build/
25+
/dist/
26+
/include/
27+
/lib/
28+
/man/
29+
/share/
30+
/src/

addons/delivery/sale.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def delivery_set(self, cr, uid, ids, context=None):
7474
if not grid_id:
7575
raise osv.except_osv(_('No Grid Available!'), _('No grid matching for this carrier!'))
7676

77-
if order.state != 'draft':
77+
if order.state not in ('draft', 'sent'):
7878
raise osv.except_osv(_('Order not in Draft State!'), _('The order state have to be draft to add delivery lines.'))
7979

8080
grid = grid_obj.browse(cr, uid, grid_id, context=context)

addons/mail/mail_thread.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,14 @@ def _message_extract_payload(self, message, save_original=False):
11321132
body = u''
11331133
if save_original:
11341134
attachments.append(('original_email.eml', message.as_string()))
1135-
if not message.is_multipart() or 'text/' in message.get('content-type', ''):
1135+
1136+
# Be careful, content-type may contain tricky content like in the
1137+
# following example so test the MIME type with startswith()
1138+
#
1139+
# Content-Type: multipart/related;
1140+
# boundary="_004_3f1e4da175f349248b8d43cdeb9866f1AMSPR06MB343eurprd06pro_";
1141+
# type="text/html"
1142+
if not message.is_multipart() or message.get('content-type', '').startswith("text/"):
11361143
encoding = message.get_content_charset()
11371144
body = message.get_payload(decode=True)
11381145
body = tools.ustr(body, encoding, errors='replace')

addons/purchase/purchase.py

+6
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ def action_cancel_draft(self, cr, uid, ids, context=None):
503503
if not len(ids):
504504
return False
505505
self.write(cr, uid, ids, {'state':'draft','shipped':0})
506+
for purchase in self.browse(cr, uid, ids, context=context):
507+
self.pool['purchase.order.line'].write(cr, uid, [l.id for l in purchase.order_line], {'state': 'draft'})
506508
for p_id in ids:
507509
# Deleting the existing instance of workflow for PO
508510
self.delete_workflow(cr, uid, [p_id]) # TODO is it necessary to interleave the calls?
@@ -598,6 +600,8 @@ def action_cancel(self, cr, uid, ids, context=None):
598600
_('You must first cancel all receptions related to this purchase order.'))
599601
self.pool.get('account.invoice') \
600602
.signal_invoice_cancel(cr, uid, map(attrgetter('id'), purchase.invoice_ids))
603+
self.pool['purchase.order.line'].write(cr, uid, [l.id for l in purchase.order_line],
604+
{'state': 'cancel'})
601605
self.write(cr,uid,ids,{'state':'cancel'})
602606

603607
self.signal_purchase_cancel(cr, uid, ids)
@@ -908,6 +912,8 @@ def copy_data(self, cr, uid, id, default=None, context=None):
908912
def unlink(self, cr, uid, ids, context=None):
909913
procurement_ids_to_cancel = []
910914
for line in self.browse(cr, uid, ids, context=context):
915+
if line.state not in ['draft', 'cancel']:
916+
raise osv.except_osv(_('Invalid Action!'), _('Cannot delete a purchase order line which is in state \'%s\'.') %(line.state,))
911917
if line.move_dest_id:
912918
procurement_ids_to_cancel.extend(procurement.id for procurement in line.move_dest_id.procurements)
913919
if procurement_ids_to_cancel:

addons/sale/sale.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -515,14 +515,18 @@ def action_invoice_create(self, cr, uid, ids, grouped=False, states=None, date_i
515515
if grouped:
516516
res = self._make_invoice(cr, uid, val[0][0], reduce(lambda x, y: x + y, [l for o, l in val], []), context=context)
517517
invoice_ref = ''
518+
origin_ref = ''
518519
for o, l in val:
519-
invoice_ref += o.name + '|'
520+
invoice_ref += (o.client_order_ref or o.name) + '|'
521+
origin_ref += (o.origin or o.name) + '|'
520522
self.write(cr, uid, [o.id], {'state': 'progress'})
521523
cr.execute('insert into sale_order_invoice_rel (order_id,invoice_id) values (%s,%s)', (o.id, res))
522524
#remove last '|' in invoice_ref
523-
if len(invoice_ref) >= 1:
525+
if len(invoice_ref) >= 1:
524526
invoice_ref = invoice_ref[:-1]
525-
invoice.write(cr, uid, [res], {'origin': invoice_ref, 'name': invoice_ref})
527+
if len(origin_ref) >= 1:
528+
origin_ref = origin_ref[:-1]
529+
invoice.write(cr, uid, [res], {'origin': origin_ref, 'name': invoice_ref})
526530
else:
527531
for order, il in val:
528532
res = self._make_invoice(cr, uid, order, il, context=context)

addons/stock/stock.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2395,7 +2395,7 @@ def action_done(self, cr, uid, ids, context=None):
23952395
picking_ids.append(move.picking_id.id)
23962396
if move.move_dest_id.id and (move.state != 'done'):
23972397
# Downstream move should only be triggered if this move is the last pending upstream move
2398-
other_upstream_move_ids = self.search(cr, uid, [('id','!=',move.id),('state','not in',['done','cancel']),
2398+
other_upstream_move_ids = self.search(cr, uid, [('id','not in',move_ids),('state','not in',['done','cancel']),
23992399
('move_dest_id','=',move.move_dest_id.id)], context=context)
24002400
if not other_upstream_move_ids:
24012401
self.write(cr, uid, [move.id], {'move_history_ids': [(4, move.move_dest_id.id)]})

openerp/addons/base/security/ir.model.access.csv

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
"access_multi_company_default manager","multi_company_default Manager","model_multi_company_default","group_erp_manager",1,1,1,1
109109
"access_ir_filter all","ir_filters all","model_ir_filters",,1,1,1,1
110110
"access_ir_config_parameter","ir_config_parameter","model_ir_config_parameter",,1,0,0,0
111+
"access_ir_config_parameter_system","ir_config_parameter_system","model_ir_config_parameter","group_system",1,1,1,1
111112
"access_ir_mail_server","ir_mail_server","model_ir_mail_server","group_system",1,1,1,1
112113
"access_ir_actions_client","ir_actions_client all","model_ir_actions_client",,1,0,0,0
113114
"access_ir_needaction_mixin","ir_needaction_mixin","model_ir_needaction_mixin",,1,1,1,1

0 commit comments

Comments
 (0)