Openerp 如何在到期日过后自动添加管理费以打开发票?
有人能帮我在到期日过后自动向未结发票中添加费用吗?例如,我在res.company中设置了一个管理费,当发票超过到期日时调用该管理费 问候,,Openerp 如何在到期日过后自动添加管理费以打开发票?,openerp,Openerp,有人能帮我在到期日过后自动向未结发票中添加费用吗?例如,我在res.company中设置了一个管理费,当发票超过到期日时调用该管理费 问候,, Joe如果需要自动执行,请添加一个调度程序。计划程序功能应在到期日后搜索所有未结发票,并添加带有管理费的新发票行,或将管理费添加到现有发票行。 例如,下面是可用于创建调度程序的数据xml。 XML部分 运行自动发票计划程序 1. 天 -1 Python部分 #Its just a example function.make necessary cha
Joe如果需要自动执行,请添加一个
调度程序。计划程序功能应在到期日后搜索所有未结发票,并添加带有管理费的新发票行,或将管理费添加到现有发票行。
例如,下面是可用于创建调度程序的数据xml。
XML部分
运行自动发票计划程序
1.
天
-1
Python部分
#Its just a example function.make necessary changes
#Inherit the account_invoice and add the function
import time
def automatic_invoice_scheduler(self, cr, uid, ids,context=None):
ids = self.search(cr, uid,[('date_invoice','<=',time.strftime('%Y-%m-%d %H:%M:%S'),('state','open'),('due_added','=',False)], context=context)
#due added is a new field you have to add so that once the due
# is added then its invoice id is not added in the scheduler
###########################
#Add your code here.add the due_fees to the invoice lines
#write the due_added boolean field to true
###########################
return True
#这只是一个示例函数。进行必要的更改
#继承帐户\u发票并添加函数
导入时间
def自动发票计划程序(self、cr、uid、ids、context=None):
ids=self.search(cr,uid,[('date\u invoice','Im试图使用函数有什么想法吗?谢谢OmaL,你有函数的例子吗?我有点困惑如何继续。我应该在哪里添加xml?
#Its just a example function.make necessary changes
#Inherit the account_invoice and add the function
import time
def automatic_invoice_scheduler(self, cr, uid, ids,context=None):
ids = self.search(cr, uid,[('date_invoice','<=',time.strftime('%Y-%m-%d %H:%M:%S'),('state','open'),('due_added','=',False)], context=context)
#due added is a new field you have to add so that once the due
# is added then its invoice id is not added in the scheduler
###########################
#Add your code here.add the due_fees to the invoice lines
#write the due_added boolean field to true
###########################
return True