[IMP]GOLEM Activity enhancements : new tree view, better duplicate handling, translation fix

This commit is contained in:
Fabien Bourgeois 2016-07-05 15:39:15 +02:00
parent e03757ca4b
commit c92645158c
3 changed files with 25 additions and 7 deletions

View File

@ -461,8 +461,8 @@ msgstr "Prix de vente"
#. module: golem_activity
#: field:golem.activity,season_id:0
msgid "Seasons"
msgstr "Saisons"
msgid "Season"
msgstr "Saison"
#. module: golem_activity
#: help:golem.activity,categ_id:0

View File

@ -32,12 +32,16 @@ class GolemActivity(models.Model):
_inherits = {'product.template': 'product_id'}
_rec_name = 'activity_name'
season_id = fields.Many2one('golem.season', string='Seasons',
required=True)
# Copy the default code
default_code = fields.Char(copy=True)
# Own fields
season_id = fields.Many2one('golem.season', string='Season',
copy=False, required=True)
animator_id = fields.Many2one('res.partner', string='Animator',
domain=[('is_company', '=', False)])
date_start = fields.Date('Start date')
date_end = fields.Date('End date')
date_start = fields.Date('Start date', copy=False)
date_end = fields.Date('End date', copy=False)
@api.constrains('date_start', 'date_end')
def _check_period(self):

View File

@ -74,6 +74,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</field>
</record>
<!-- Trees -->
<record model="ir.ui.view" id="view_tree">
<field name="name">GOLEM Activity Tree/List</field>
<field name="model">golem.activity</field>
<field name="arch" type="xml">
<tree string="GOLEM Activities">
<field name="default_code" />
<field name="name" />
<field name="season_id" />
<field name="animator_id" />
</tree>
</field>
</record>
<!-- Searches -->
<record id="view_filter" model="ir.ui.view">
<field name="name">GOLEM Activity Filters</field>
@ -81,6 +95,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="arch" type="xml">
<search>
<field name="activity_name" />
<field name="categ_id" widget="many2one" />
<field name="season_id" widget="many2one" />
<filter name="season_default" string="Default season"
domain="[('is_current', '=', True)]" />
@ -92,7 +107,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</field>
</record>
<!-- Actions -->
<record id="action" model="ir.actions.act_window">
<field name="name">GOLEM Activities</field>