[BUG] Add option saison field

This commit is contained in:
michel 2018-02-15 10:15:54 +01:00
parent f3260ca757
commit 26c592204b
2 changed files with 2 additions and 9 deletions

View File

@ -44,14 +44,7 @@ class GolemPaymentSchedule(models.Model):
day_ids = fields.Many2many('golem.payment.schedule.day', string='Days')
occurences = fields.Integer(compute='_compute_occurences')
@api.model
def _default_season(self):
""" Get default season """
domain = [('is_default', '=', True)]
return self.env['golem.season'].search(domain, limit=1)
season_id = fields.Many2one('golem.season', string='Seasons',
readonly=True, default=_default_season)
season_id = fields.Many2one('golem.season', 'Season', required=True)
@api.depends('day_ids')

View File

@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<sheet>
<group>
<field name="name" />
<field name="season_id" />
<field name="season_id" options="{'no_open': True, 'no_create': True}" />
<field name="day_ids" widget="many2many_tags" />
<field name="occurences" />
</group>