0
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'),
        }

    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
 #  if rec.psd_allow_logo:
         #      self.pool.get('stock.transfer').write(cr, uid, ids, {'psd_allow_logo' : True}, context=context)
            # else:
         #      self.pool.get('stock.transfer').write(cr, uid, ids, {'psd_allow_logo' : False}, context=context)

indent_report()

我正在尝试更改 indent_report.psd_allow_logo 时更改 stock_transfer.psd_allow_logo 但写入不起作用,我什至尝试过

4

1 回答 1

0
    self.pool.get('stock.transfer').write(cr,uid,active_ids[0],{'psd_allow_logo':rec.psd_allow_logo})

将其添加到 indent.report 解决了问题,我缺少 active_ids

于 2016-09-26T06:12:14.390 回答