Odoo Ayuda

0

0
1 Respuesta
0
thanhps Vietnam
28/5/19 0:44

I found the solution below

@api.onchange('partner_id')
def _onchange_partner(self):
if self.partner_id and self.partner_id.credit_limit_expired:
expire_date = self.partner_id.credit_limit_expired
title = _("Warning for %s") % self.partner_id.name

if expire_date < fields.Date.today() + datetime.timedelta(days=-7):
message = _(
"Credit limit setting was expired on %s. \n Please update their credit limit.\n") % expire_date.strftime(
'%Y-%m-%d')
warning = {
'title': title,
'message': message
}
return {'warning': warning}
return {}
Realizar una pregunta
Writer
Etiquetas
Keep Informed
1 seguidor(es)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now