[MERGE] from trunk
bzr revid: xmo@openerp.com-20130923111950-uk163cp891zl021h
This commit is contained in:
commit
be59c06403
|
@ -10,7 +10,7 @@
|
|||
</record>
|
||||
|
||||
<record id="main_partner" model="res.partner">
|
||||
<field name="name">Dunder Mufflin</field>
|
||||
<field name="name">YourCompany</field>
|
||||
<field name="street">1725 Slough Ave.</field>
|
||||
<field name="city">Scranton</field>
|
||||
<field name="zip">18540</field>
|
||||
|
@ -85,7 +85,7 @@ BZrmED0AAAAASUVORK5CYII=
|
|||
</record>
|
||||
|
||||
<record id="main_company" model="res.company">
|
||||
<field name="name">Dunder Mufflin</field>
|
||||
<field name="name">YourCompany</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ class ir_attachment(osv.osv):
|
|||
The default implementation is the file:dirname location that stores files
|
||||
on the local filesystem using name based on their sha1 hash
|
||||
"""
|
||||
_order = 'id desc'
|
||||
def _name_get_resname(self, cr, uid, ids, object, method, context):
|
||||
data = {}
|
||||
for attachment in self.browse(cr, uid, ids, context=context):
|
||||
|
|
|
@ -167,6 +167,10 @@
|
|||
<rng:ref name="any"/>
|
||||
</rng:oneOrMore>
|
||||
</rng:group>
|
||||
<rng:group>
|
||||
<rng:attribute name="file"/>
|
||||
<rng:empty/>
|
||||
</rng:group>
|
||||
<rng:group>
|
||||
<rng:attribute name="ref"/>
|
||||
<rng:empty/>
|
||||
|
|
|
@ -175,6 +175,13 @@ def _eval_xml(self, node, pool, cr, uid, idref, context=None):
|
|||
if t == 'html':
|
||||
return _process("".join([etree.tostring(n, encoding='utf-8')
|
||||
for n in node]), idref)
|
||||
if node.get('file'):
|
||||
import openerp.tools
|
||||
import base64
|
||||
fp = openerp.tools.file_open(node.get('file'))
|
||||
result = base64.b64encode(fp.read())
|
||||
return result
|
||||
|
||||
if t == 'file':
|
||||
from ..modules import module
|
||||
path = node.text.strip()
|
||||
|
|
Loading…
Reference in New Issue