0
如何將參數從一個env傳遞到另一個模塊。目標是在付款嚮導中獲得發票總額,以便用戶瞭解他要註冊的金額。將數值從一個模塊傳輸到Odoo中的另一個模塊
class org_invoice(models.Model):
_name = 'org.invoice'
@api.multi
def register_payment(self):
object= self.env['org.reg_payment']
write_obj = object.create({'amount': self.total})
return {'name': "Register Payment",
'type': 'ir.actions.act_window',
'res_model': 'org.reg_payment',
'res_id': write_obj,
'view_id': False,
'view_type': 'form',
'view_mode': 'form',
'target': 'new',
'domain': '[]',
}
class org_reg_payment(models.Model):
_name = 'org.reg_payment'
name = fields.Char()
accounts = fields.Many2one('org.accounts')
amount = fields.Float()
工作!感謝@Alessandro,這是我們昨天討論的同一個問題。讚賞 –
R.I.P英文@OmeedTotakhel – Naveen
@Naveen ahhaha當你不睡覺2晚這是發生什麼 –