forked from Yaltik/golem
[BUG] Add option saison field
This commit is contained in:
parent
f3260ca757
commit
26c592204b
@ -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')
|
||||||
|
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user