视图学习 - odoochain/OCB GitHub Wiki
在视图渲染中经常会出现新增加的字段出现找不到错误的问题,参考sale_ebay
我们可以拿project_enterprise与project是设置视图继承做例子
<field name="inherit_id" ref="project.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//label[@for='module_hr_timesheet']" position="attributes">
<attribute name="string">Timesheets</attribute>
</xpath>
</field>
升级以后修改了字段任务日志为工时单
另外在res.config.settings.view.form.inherit.hr.payroll中设置
<div class="row mt16 o_settings_container" id="hr_payroll_accountant">
<div class="col-lg-6 col-12 o_setting_box">
<div class="o_setting_left_pane">
<field name="module_hr_payroll_account"/>
</div>
<div class="o_setting_right_pane">
<label for="module_hr_payroll_account" string="Payroll Entries"/>
<div class="text-muted">
Post payroll slips in accounting
</div>
</div>
</div>
<div class="col-lg-6 col-12 o_setting_box" attrs="{'invisible': [('module_hr_payroll_account', '=', False)]}">
<div class="o_setting_left_pane">
<field name="module_hr_payroll_account_sepa"/>
</div>
<div class="o_setting_right_pane">
<label for="module_hr_payroll_account_sepa" string="Payroll SEPA"/>
<div class="text-muted">
Create SEPA payment
</div>
</div>
</div>
</div>
然后在res.config.settings.view.form.inherit.hr.payroll.holidays中继承:
<?xml version="1.0"?>
<xpath expr="//div[@id='hr_payroll_accountant']" position="after">
<h2>Time Off</h2>
<div class="row mt16 o_settings_container">
<div class="col-lg-6 col-12 o_setting_box">
<div class="o_setting_left_pane"/>
<div class="o_setting_right_pane">
<label for="deferred_time_off_manager" string="Deferred Time Off"/>
<div class="text-muted">
Postpone time off after payslip validation
</div>
<div class="content-group">
<div class="row mt16">
<label string="Responsible" for="deferred_time_off_manager" class="col-lg-3 o_light_label"/>
<field name="deferred_time_off_manager"/>
</div>
</div>
</div>
</div>
</div>
</xpath>
```
## 关于15的新特性和wdget\navar
15比14高多少不知道,widget有所改进。其实在snailmail_account中有
`<widget name="iap_buy_more_credits" service_name="snailmail"/>`
也就是增加一个购买邮递信用的知识链接