Skip to Content
Menu
This question has been flagged
1 Reply
4939 Views

class invoiceextendtask(models.Model):

_inherit = 'account.invoice'

date_invoice = fields.Date(string='Invoice Date',readonly=True, states={'draft': [('readonly', False)]}, index=True, help="Keep empty to use the current date", default=datetime.today(), copy=False)

is_consult = fields.Boolean(string='Consult')

is_session = fields.Boolean(string='Session')

prod_price = fields.Selection([('member', 'Member Pricelist'), ('non-member', 'Non-Member Pricelist'), ('cigna', 'Cigna Pricelist')], string='Product Pricelist')

referred_to = fields.Many2one('llw.employee', string='Referred To',)

payment_type = fields.Selection([('cash', 'Cash'), ('card', 'Card'), ('hmo', 'HMO'), ('others', 'Others')], string='Payment Type')

session_last = fields.Integer(string='Last session no.', size="10")

session_nextno = fields.Integer(string="Session Number", size="10")

partner_id = fields.Many2one('res.partner', string='Partner', change_default=True,required=True, readonly=True, states={'draft': [('readonly', False)]},track_visibility='always', help="Choose patient name")

@api.onchange('is_session')

def _onchange_partner(self):

part = self.partner_id

if not part:

warning = {

'title': _('Warning!'),

'message': _('You must first select a partner!'),

}

return {'warning': warning}

else:

self.env.cr.execute("SELECT account_invoice.session_last FROM account_invoice where account_invoice.is_session = 't' ")

result = self.env.cr.fetchone()

Avatar
Discard
Best Answer

You can get it using following command:

db_crsr.rowcount
Sudhir Arya
ERP Harbor Consulting Services
Skype:sudhir@erpharbor.com
Website: http://www.erpharbor.com
Avatar
Discard
Related Posts Replies Views Activity
1
Aug 22
13876
1
Dec 19
7318
13
Jul 24
12535
4
Jul 19
10900
1
Jul 18
2861