Odoo Help

Welcome!

This community 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.

0

Modifiying value from a transient to a non transient object

By
Omi Harjani
on 9/26/16, 1:27 AM 118 views
class stock_transfer(osv.osv):
 _inherit="stock.transfer"
_columns={'psd_allow_logo':fields.boolean('Alow Logo'),
 }
stock_transfer()
class indent_report(osv.osv_memory):
 _inherit = "indent.report"
_columns = {
     'psd_allow_logo':fields.boolean('Alow Logo'),'psd_allow_logo':fields.boolean('Alow Logo'),
     }
def write(self, cr, uid, ids, psd_allow_logo, context = None):
    res = super(indent_report, self).write(cr, uid, ids, values, context = active_ids)
if 'psd_allow_logo' in values:
       for res in self.browse(cr, uid, ids, context = active_ids):
           self.pool.get('stock.transfer').write(cr, uid, [res.stock_transfer_id.id], {'psd_allow_logo': values['psd_allow_logo'],}, context = active_ids)
    return res}
indent_report()
#i'm trying to write the value from indent_report.psd_allow_logo to stock_transfer.psd_allow_logo But the write function is'nt working.
0
Omi Harjani
On 9/26/16, 2:16 AM
self.pool.get('stock.transfer').write(cr,uid,active_ids[0],{'psd_allow_logo':rec.psd_allow_logo})
#adding that to indent.report solved the issue, i was missing active_ids

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/26/16, 1:27 AM
Seen: 118 times
Last updated: 9/26/16, 2:16 AM