[IMP] improve view reduce css depencency

bzr revid: rgaopenerp-20120807102123-c9fq33cz7r2pjked
This commit is contained in:
RGA(OpenERP)
2012-08-07 15:51:23 +05:30
parent 7cf4fb8779
commit 1d0beb5779
4 changed files with 30 additions and 79 deletions
+25 -12
View File
@@ -8,20 +8,33 @@
<field eval="2" name="priority"/>
<field name="arch" type="xml">
<form string="Journal Item" layout="manual" version="7.0">
<group>
<h3>
<field name="partner_id" widget="many2one_pager"/>
</h3>
<div class="oe_right">
<label for="last_reconciliation_date"/>
<field name="last_reconciliation_date"/>
<label for="latest_date"/>
<field name="latest_date" />
</div>
<div class="oe_button_container">
<button string="Reconcile" name="%(action_view_account_move_line_reconcile)d" widget="list_button" type="action"/>
<button string="Nothing to Reconcile" name="skip_partner" widget="btn_extend" type="object"/>
<field name="reconciliation_progress" widget="progressbar"/>
<a type="button" class="oe_pager_button" data-pager-action="previous">Previous</a>
<a type="button" class="oe_pager_button" data-pager-action="next">Next</a>
<field name="partner_id"/>
(<span class="oe_pager_index_extend">0</span><span class="oe_pager_separator"> / </span><span class="oe_pager_count_extend">0</span>)
</h3>
<div>
<label for="last_reconciliation_date"/>
<field name="last_reconciliation_date" />
<label for="latest_date"/>
<field name="latest_date"/>
</div>
<div>
<button string="Reconcile" name="%(action_view_account_move_line_reconcile)d" widget="list_button" type="action"/>
<button string="Nothing to Reconcile" name="skip_partner" widget="btn_extend" type="object"/>
<field name="reconciliation_progress" widget="progressbar"/>
</div>
<div name="div4">
</div>
</group>
</form>
</field>
</record>
@@ -68,30 +68,7 @@ instance.account.extend_form_view = instance.web.FormView.extend({
})
},
})
instance.account.many2one_pager = instance.web.form.FieldMany2One.extend({
template: "FieldMany2One_Pager",
display_string: function(str) {
var self = this;
if (!this.get("effective_readonly")) {
this.$input.val(str);
} else {
this.$element.find('a.oe_form_uri')
.unbind('click')
.text(str)
.click(function () {
self.do_action({
type: 'ir.actions.act_window',
res_model: self.field.relation,
res_id: self.get("value"),
context: self.build_context(),
views: [[false, 'form']],
target: 'current'
});
return false;
});
}
},
})
instance.account.btn_extend = instance.web.form.WidgetButton.extend({
on_click: function() {
var self = this;
@@ -11,46 +11,7 @@
<t t-name="ExtendedFormView">
<div class="oe_formview">
<div class="oe_form_container"/>
</div>
</t>
<t t-name="FieldMany2One_Pager">
<span class="oe_form_field_many2one oe_form_field_with_button">
<ul class="oe_pager_group">
<li>
<a type="button" data-pager-action="previous">Previous</a>
</li>
<li>
<a type="button" data-pager-action="next">Next</a>
</li>
</ul>
<ul class="oe_pager_m2o">
<li>
<a t-if="widget.get('effective_readonly')" href="#" class="oe_form_uri"/>
</li>
<li>
(<span class="oe_pager_index_extend">0</span><span class="oe_pager_separator"> / </span><span class="oe_pager_count_extend">0</span>)
</li>
</ul>
<t t-if="!widget.get('effective_readonly')">
<button class="oe_button oe-m2o-cm-button" title="Open Resource">
<img t-att-src='_s + "/web/static/src/img/icons/terp-folder-yellow.png"'/>
</button>
<div>
<input type="text"
t-att-id="widget.id_for_label"
t-att-tabindex="widget.node.attrs.tabindex"
t-att-autofocus="widget.node.attrs.autofocus"
t-att-placeholder="widget.node.attrs.placeholder"
/>
<span class="oe-m2o-drop-down-button">
<img t-att-src='_s + "/web/static/src/img/down-arrow.png"'/>
</span>
</div>
</t>
</span>
</t>
</div>
</t>
</templates>
@@ -6,11 +6,11 @@
<field name="model">account.move.reconciliation</field>
<field name="inherit_id" ref="account.view_account_move_reconciliation_form_view"/>
<field name="arch" type="xml">
<field name="reconciliation_progress" position="after">
<xpath expr="//div[@name='div4']" position="inside">
<label for="followup_date"/>
<field name="followup_date"/>
<field name="max_followup_id"/>
</field>
</xpath>
</field>
</record>
</data>