I have field remain points have value i want when press button send and convert workflow to state send the value in field remain points value decreases by one
class sms_status(models.Model):
_name = 'sms.status'
_description = 'SMS Status'
title = fields.Char('Title')
ms_body = fields.Text('Message Body')
ms_length = fields.Integer(String='Message Length')
date = fields.Datetime('DateTime')
rem_points = fields.Integer('Remain Pouints')
user_id = fields.Many2one('res.users', 'User')
state = fields.Selection([('draft', 'New'), ('request', 'Send')], 'Status', default="draft")
line_ids = fields.One2many( 'sms.status.line', 'contact_line', 'refernce contact')
@api.v7
# wkf Send Message
def wkf_send(self, cr, uid, ids, context=None):
total = 0.0
for rec in self.browse(cr, uid, ids, context=context):
total = rec.rem_points-1
return self.write(cr, uid, ids, {'state': 'request'}, context=context
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- Müşteri İlişkileri Yönetimi
- e-Commerce
- Muhasebe
- Envanter
- PoS
- Project
- MRP
Bu soru işaretlendi
1861
Görünümler
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Üye Ol