Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
How to do it ?:
print '== Check postcode =================================================================='
code_check = self.env['post.coder'].search([('postcode','=',self.buyer_postcode)])# reading code, if code exist
it show me the code correctly, If code doesn't exist False is printed on screen. So now i would like to update record and add street name where the code is or if code not exist in database add new record.
if code_check is False:
# this condition apparently doesn't work
print 'Post code:', code_check.postcode
#execute(""" UPDATE post_coder SET street = %s WHERE postcode = %s""" %(self.buyer_address_1,self.buyer_postcode))
print ' Post code updated'
How using non python query add or update record in table ?
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
|Asked: 2/4/16, 5:41 PM|
|Seen: 5933 times|
|Last updated: 12/16/16, 6:03 AM|