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