mirror of
https://github.com/NaN-tic/trytond-activity.git
synced 2023-12-14 02:12:57 +01:00
parent
56c7626fb2
commit
2b795b647c
|
@ -60,6 +60,7 @@ class ActivityType(sequence_ordered(), DeactivableMixin, ModelSQL, ModelView):
|
|||
name = fields.Char('Name', required=True, translate=True)
|
||||
color = fields.Char('Color', help='HTML color (hexadecimal)')
|
||||
default_duration = fields.TimeDelta('Default Duration')
|
||||
default_description = fields.Text("Default Description")
|
||||
|
||||
|
||||
class ActivityReference(ModelSQL, ModelView):
|
||||
|
@ -283,10 +284,13 @@ class Activity(Workflow, ModelSQL, ModelView):
|
|||
return resource.party.id
|
||||
return None
|
||||
|
||||
@fields.depends('activity_type', 'duration')
|
||||
@fields.depends('activity_type', '_parent_activity_type.default_description',
|
||||
'duration', 'description')
|
||||
def on_change_activity_type(self):
|
||||
if not self.activity_type:
|
||||
return
|
||||
if not self.description and self.activity_type.default_description:
|
||||
self.description = self.activity_type.default_description
|
||||
if not self.duration is None:
|
||||
return
|
||||
self.duration = self.activity_type.default_duration
|
||||
|
|
|
@ -110,6 +110,10 @@ msgctxt "field:activity.type,color:"
|
|||
msgid "Color"
|
||||
msgstr "Color"
|
||||
|
||||
msgctxt "field:activity.type,default_description:"
|
||||
msgid "Default description"
|
||||
msgstr "Descripció per defecte"
|
||||
|
||||
msgctxt "field:activity.type,default_duration:"
|
||||
msgid "Default Duration"
|
||||
msgstr "Duració per defecte"
|
||||
|
|
|
@ -110,6 +110,10 @@ msgctxt "field:activity.type,color:"
|
|||
msgid "Color"
|
||||
msgstr "Color"
|
||||
|
||||
msgctxt "field:activity.type,default_description:"
|
||||
msgid "Default description"
|
||||
msgstr "Descripción por defecto"
|
||||
|
||||
msgctxt "field:activity.type,default_duration:"
|
||||
msgid "Default Duration"
|
||||
msgstr "Duración por defecto"
|
||||
|
|
2
setup.py
2
setup.py
|
@ -49,7 +49,7 @@ requires += [get_require_version('trytond_company')]
|
|||
|
||||
tests_require = [
|
||||
get_require_version('proteus'),
|
||||
|
||||
|
||||
]
|
||||
|
||||
series = '%s.%s' % (major_version, minor_version)
|
||||
|
|
|
@ -12,4 +12,7 @@ contains the full copyright notices and license terms. -->
|
|||
<field name="color"/>
|
||||
<label name="sequence"/>
|
||||
<field name="sequence"/>
|
||||
<newline/>
|
||||
<separator name="default_description" colspan="6"/>
|
||||
<field name="default_description" colspan="6"/>
|
||||
</form>
|
||||
|
|
Loading…
Reference in a new issue