mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-23 04:22:04 -06:00
[IMP] Add required to mail and subject fields in file.document.condition when type is normal
This commit is contained in:
parent
1396b72c96
commit
7a03c0c10d
@ -128,13 +128,16 @@ class file_document_condition(orm.Model):
|
|||||||
return self.get_file_document_condition_type(cr, uid, context=context)
|
return self.get_file_document_condition_type(cr, uid, context=context)
|
||||||
|
|
||||||
def get_file_document_condition_type(self, cr, uid, context=None):
|
def get_file_document_condition_type(self, cr, uid, context=None):
|
||||||
return [('normal', 'Normal'), ('test', 'TEST')]
|
return [('normal', 'Normal')]
|
||||||
_columns = {
|
_columns = {
|
||||||
'from_email': fields.char('Email', size=64),
|
'from_email': fields.char('Email', size=64),
|
||||||
'mail_subject': fields.char('Mail Subject', size=64),
|
'mail_subject': fields.char('Mail Subject', size=64),
|
||||||
'type': fields.selection(_get_file_document_condition_type,
|
'type': fields.selection(_get_file_document_condition_type,
|
||||||
'Type', help="Create your own type if the normal type do not correspond to your need", required=True),
|
'Type', help="Create your own type if the normal type \
|
||||||
'file_extension' : fields.char('File Extension', size=64, help="File extension or file name", required=True),
|
do not correspond to your need", required=True),
|
||||||
|
'file_extension' : fields.char('File Extension', size=64,
|
||||||
|
help="File extension or file name",
|
||||||
|
required=True),
|
||||||
'server_id': fields.many2one('fetchmail.server', 'Server Mail'),
|
'server_id': fields.many2one('fetchmail.server', 'Server Mail'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,20 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="view_file_document_condition_form" model="ir.ui.view">
|
||||||
|
<field name="name">view_file_document_condition_form</field>
|
||||||
|
<field name="model">file.document.condition</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form string="Configuration for File Document">
|
||||||
|
<field name="from_email" attrs="{'required': [('type', '=', 'normal')]}"/>
|
||||||
|
<field name="mail_subject" attrs="{'required': [('type', '=', 'normal')]}"/>
|
||||||
|
<field name="type"/>
|
||||||
|
<field name="file_extension"/>
|
||||||
|
<field name="server_id"/>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<record id="action_file_document_configuration" model="ir.actions.act_window">
|
<record id="action_file_document_configuration" model="ir.actions.act_window">
|
||||||
<field name="name">Configuration</field>
|
<field name="name">Configuration</field>
|
||||||
<field name="res_model">file.document.condition</field>
|
<field name="res_model">file.document.condition</field>
|
||||||
|
Loading…
Reference in New Issue
Block a user