+ You will find here all the invoices related to this contract.
+ If you want to create a new invoice for this contract, you should use
+ the invoicing menu on the contract form view instead.
+
+
+
+
Contracts to Renew
@@ -359,6 +376,10 @@
name="%(action_hr_tree_invoiced_all)d"
type="action"
context="{'search_default_account_id': [active_id], 'default_account_id': active_id}"/>
+
diff --git a/openerp/addons/base/ir/ir_attachment.py b/openerp/addons/base/ir/ir_attachment.py
index 70b4b3c935a..cb9429dcda0 100644
--- a/openerp/addons/base/ir/ir_attachment.py
+++ b/openerp/addons/base/ir/ir_attachment.py
@@ -219,11 +219,7 @@ class ir_attachment(osv.osv):
# datas is false, but file_size and checksum are not (computed as datas is an empty string)
if not value:
# reset computed fields
-<<<<<<< HEAD
super(ir_attachment, self).write(cr, SUPERUSER_ID, [id], vals, context=context)
-=======
- super(ir_attachment, self).write(cr, SUPERUSER_ID, [id], {'file_size' : 0, 'checksum' : None, 'mimetype' : None, 'index_content' : None}, context=context)
->>>>>>> [IMP] ir_ui_view: add context check in postprocess_and_fields
return True
if context is None:
context = {}
@@ -231,21 +227,8 @@ class ir_attachment(osv.osv):
attach = self.browse(cr, uid, id, context=context)
fname_to_delete = attach.store_fname
location = self._storage(cr, uid, context)
-<<<<<<< HEAD
# compute the index_content field
vals['index_content'] = self._index(cr, SUPERUSER_ID, bin_data, attach.datas_fname, attach.mimetype),
-=======
- # compute the field depending of datas
- bin_data = value.decode('base64')
- mimetype = self._compute_mimetype(bin_data)
- checksum = self._compute_checksum(bin_data)
- vals = {
- 'file_size': len(bin_data),
- 'checksum' : checksum,
- 'mimetype' : mimetype,
- 'index_content' : self._index(cr, SUPERUSER_ID, bin_data, attach.datas_fname, mimetype),
- }
->>>>>>> [IMP] ir_ui_view: add context check in postprocess_and_fields
if location != 'db':
# create the file
fname = self._file_write(cr, uid, value, checksum)
@@ -275,7 +258,6 @@ class ir_attachment(osv.osv):
return hashlib.sha1(bin_data).hexdigest()
return False
-<<<<<<< HEAD
def _compute_mimetype(self, values):
""" compute the mimetype of the given values
:param values : dict of values to create or write an ir_attachment
@@ -287,14 +269,6 @@ class ir_attachment(osv.osv):
if 'datas' in values:
mimetype = guess_mimetype(values.get('datas').decode('base64'))
return mimetype
-=======
- def _compute_mimetype(self, bin_data):
- """ compute the mimetype of the given datas
- :param bin_data : binary data
- :return mime : string indicating the mimetype, or application/octet-stream by default
- """
- return guess_mimetype(bin_data)
->>>>>>> [IMP] ir_ui_view: add context check in postprocess_and_fields
def _index(self, cr, uid, bin_data, datas_fname, file_type):
""" compute the index content of the given filename, or binary data.
@@ -455,11 +429,7 @@ class ir_attachment(osv.osv):
ids = [ids]
self.check(cr, uid, ids, 'write', context=context, values=vals)
# remove computed field depending of datas
-<<<<<<< HEAD
for field in ['file_size', 'checksum']:
-=======
- for field in ['file_size', 'checksum', 'mimetype']:
->>>>>>> [IMP] ir_ui_view: add context check in postprocess_and_fields
vals.pop(field, False)
return super(ir_attachment, self).write(cr, uid, ids, vals, context)
@@ -487,16 +457,11 @@ class ir_attachment(osv.osv):
def create(self, cr, uid, values, context=None):
# remove computed field depending of datas
-<<<<<<< HEAD
for field in ['file_size', 'checksum']:
values.pop(field, False)
# if mimetype not given, compute it !
if 'mimetype' not in values:
values['mimetype'] = self._compute_mimetype(values)
-=======
- for field in ['file_size', 'checksum', 'mimetype']:
- values.pop(field, False)
->>>>>>> [IMP] ir_ui_view: add context check in postprocess_and_fields
self.check(cr, uid, [], mode='write', context=context, values=values)
return super(ir_attachment, self).create(cr, uid, values, context)