Skip to content

Commit

Permalink
Cancel Demaurex gifts
Browse files Browse the repository at this point in the history
  • Loading branch information
ecino committed Jun 19, 2015
1 parent 79d93f2 commit bf5df17
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sponsorship_switzerland/model/contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
class contracts(orm.Model):
_inherit = 'recurring.contract'

def create(self, cr, uid, vals, context=None):
""" Sponsor Demaurex needs cancel_gifts_on_termination. """
demaurex_ids = self.pool.get('res.partner').search(cr, uid, [
('ref', '=', '1502623')], context=context)
if vals.get('partner_id') in demaurex_ids:
vals['cancel_gifts_on_termination'] = True
return super(contracts, self).create(cr, uid, vals, context)

def _get_gmc_states(self, cr, uid, context=None):
""" Adds a new gmc state for tracking sponsorships for which we have
to order the new picture of the child. Remove 'casestudy' and
Expand Down

0 comments on commit bf5df17

Please sign in to comment.