我在时间表详细信息中添加了两个字段,我想在account_analytic_line表中添加这两个字段的值,我该怎么做?
这是.py文件
from osv import osv, fields
class hr_analytic_timesheet(osv.osv):
_inherit = "hr.analytic.timesheet"
_columns = {
'start_at1':fields.char('Start at', size=170),
'end_at1':fields.char('End at', size=170),
}
hr_analytic_timesheet()
这是 view.xml 文件
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="hr_timesheet_inherit">
<field name="name">hr.timesheet.sheet.form</field>
<field name="model">hr_timesheet_sheet.sheet</field>
<field name="type">form</field>
<field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='unit_amount']" position="after">
<field name="start_at1" />
<field name="end_at1" />
</xpath>
</field>
</record>
</data>
</openerp>