odoo-10 如何使用自定义模块创建没有发票的日记帐分录? (参考下图)

odoo-10 How to create journal entries without invoices using custom module ? (Refer below picture)

我想从我的自定义模块创建一个日记条目,但我不知道我必须从 account.payment 或 account.move 继承哪个模块,以及如果我要选择我必须遵循哪些步骤其中之一,我尝试了这 2 种模型,但我没有创建日记账分录,我创建了带有货币和金额的订单行 class,我创建了付款日期输入,并在其他页面中创建了付款信息,但是我想我在付款信息中遗漏了一些东西,您可以在下图中看到它。

class my_module(models.Model):
_name = 'my_module.models'
_inherit = ['mail.thread', 'ir.needaction_mixin','account.move']


name = fields.Char(string='my_module Reference')
field1 = fields.Monetary(string='Total Currency')
field2 = fields.Many2one('account.journal',string='Journal')
field3 = fields.One2many('my_module.currency','lines_id', string='currency Lines')
field4 = fields.Selection([('inbound', 'Inbound'), ('outbound', 
'Outbound')], required=True)

我从 account_asset 模型中找到了这个方法,我认为这个人就是做这个工作的,就是这样我还没有编辑它,因为我还不知道如何使用它:

Payment info image

可以通过调用该模型的创建函数从 python 创建任何模型的新记录。

例如:

move = self.env['account.move'].create({'field_1': value, 'field_2': value})

确保您在帐户 .move 中传递了所有必填字段