Skip to content

Commit

Permalink
Various form fixes
Browse files Browse the repository at this point in the history
- State filters
- Include partner title and state in forms
- Fix some default values
- Only process form that has been submitted in page
  • Loading branch information
ecino committed May 30, 2018
1 parent 4baacb9 commit d5e248c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sbc_compassion/models/partner_compassion.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ def _compute_nb_letters(self):
('partner_id', '=', partner.id)
])

@api.model
def create(self, vals):
if 'spoken_lang_ids' not in vals:
lang_ids = self.env['res.lang.compassion'].search([
('lang_id.code', '=', vals.get('lang', self.env.lang))
]).ids
vals['spoken_lang_ids'] = [(6, 0, lang_ids)]
return super(ResPartner, self).create(vals)

@api.multi
def open_letters(self):
""" Open the tree view correspondence of partner """
Expand Down

0 comments on commit d5e248c

Please sign in to comment.