44 lines
1.6 KiB
Python
44 lines
1.6 KiB
Python
import time
|
|
|
|
from odoo import models, Command, _
|
|
from odoo.addons.account.models.chart_template import template
|
|
|
|
|
|
class AccountChartTemplate(models.AbstractModel):
|
|
_inherit = "account.chart.template"
|
|
|
|
@template(model='account.move', demo=True)
|
|
def _account_accountant_account_move_demo(self, template_code):
|
|
return {
|
|
'demo_invoice_deferred': {
|
|
'move_type': 'out_invoice',
|
|
'partner_id': 'base.res_partner_1',
|
|
'invoice_user_id': 'base.user_admin',
|
|
'invoice_date': time.strftime('%Y-01-01'),
|
|
'invoice_line_ids': [
|
|
Command.create({
|
|
'name': _('Subscription 12 months'),
|
|
'quantity': 1,
|
|
'price_unit': 120,
|
|
'deferred_start_date': time.strftime('%Y-01-01'),
|
|
'deferred_end_date': time.strftime('%Y-12-31'),
|
|
}),
|
|
],
|
|
},
|
|
'demo_bill_deferred': {
|
|
'move_type': 'in_invoice',
|
|
'partner_id': 'base.res_partner_1',
|
|
'invoice_user_id': False,
|
|
'invoice_date': time.strftime('%Y-01-01'),
|
|
'invoice_line_ids': [
|
|
Command.create({
|
|
'name': _('Insurance 12 months'),
|
|
'quantity': 1,
|
|
'price_unit': 1200,
|
|
'deferred_start_date': time.strftime('%Y-01-01'),
|
|
'deferred_end_date': time.strftime('%Y-12-31'),
|
|
}),
|
|
],
|
|
},
|
|
}
|