我希望获得特定(静态)帐户和合作伙伴来执行新帐户.move和account.move.line。我怎么能这样做?
我还有其他的问题。我把它放在代码注释中。
self.journal_entry = self.env['account.move'].create({
'journal_id': journal, #i dont understand this value
'partner_id': self.container.partner.id, #i need this value static
'date': fields.Date.context_today(self)
})
credit_line = self.env['account.move.line'].create({
'move_id': self.journal_entry.id, #its this autoincrement?
'account_id': self.product.revenue_account, # i need this value static
'partner_id': self.container.partner.id, # i need this value static
'name': 'Finish '+self.job_name, # i'm generate this value
'credit': self.cost # i have this value
})
答案 0 :(得分:0)
journal_id - 期刊录入 partner_id - container.partner.id - 您可以设置默认的合作伙伴ID。 move_id - 期刊的ID - 期刊(line_ids = fields.One2many(' account.move.line',' move_id',string ='期刊项目', states = {'已发布':[(' readonly',True)]},copy = True)) 它没有增加
account_id = fields.Many2one(' account.account',string =' Account',required = True,index = True, ondelete =" cascade",domain = [(' deprecated',' =',False)],default = lambda self:self._context.get(& #39; account_id',False))