Odoo Help

1

Getting field value from Wizard?

By
DM
on 10/23/15, 6:21 AM 575 views

Hello Odoo community,

I created a wizard which has 2 fields start date and end date, with in the wizard user can choose the date and im trying to use that date value to filter invoice report but for some reason i cant retrieve my start date from the wizard it comes as empty all the time. Any suggestion or any ideas what im doing wrong

Code example

from openerp import fields,api
from openerp.osv import orm


class post_invoice_wizard(orm.TransientModel):
_name = 'post.invoice.wizard'
start_date = fields.Date('Start Date')
   end_date = fields.Date('End Date')

@api.model
def _post_invoice_ids(self):
for rec in self:
           post_invoice_ids=self.env['posted.invoice.report'].search([('date_invoice', '>=', rec.start_date)])
return post_invoice_ids
1

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
Serpent Consulting Services Pvt. Ltd.
http://www.serpentcs.com
4361
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 10/23/15, 6:49 AM

Hi Darius,

I have doubt in @api.model which you have used for your method and I guess you should use @api.multi instead.

Documentation:

1: Decorators

2: API Guideline 

Hope this will help you.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

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

Question tools

1 follower(s)

Stats

Asked: 10/23/15, 6:21 AM
Seen: 575 times
Last updated: 10/23/15, 9:17 AM