[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') day_ids = fields.Many2many('golem.payment.schedule.day', string='Days')
occurences = fields.Integer(compute='_compute_occurences') occurences = fields.Integer(compute='_compute_occurences')
@api.model season_id = fields.Many2one('golem.season', 'Season', required=True)
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)
@api.depends('day_ids') @api.depends('day_ids')

View File

@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<sheet> <sheet>
<group> <group>
<field name="name" /> <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="day_ids" widget="many2many_tags" />
<field name="occurences" /> <field name="occurences" />
</group> </group>