4 答案
An example with contract_file and contract_file_name (file name depends on code of contracts throw a function for this example).
in python class :
_columns = {
'contract_file':fields.binary("Contract file (PDF)"),
'contract_file_name': fields.function(_get_contract_file_name, type="char", size=255, readonly=True, method=True),
}
contract_file_name can be a simple char field
in xml :
<field name="contract_file" filename="contract_file_name"/>
<field name="contract_file_name" invisible="1"/>
don't set invisible="1" if you want a field to set explicitly the file name
Hi,
Refer the following link for filename. It may help you.
https://bugs.launchpad.net/openerp-web/+bug/1252458