3
0
Fork 0

[MIG][12.0] web_widget_child_selector

12.0
Enric Tobella 2020-02-19 23:23:44 +01:00 committed by Jaime Arroyo
parent 1aec4c706c
commit 77d7fa0156
4 changed files with 7 additions and 10 deletions

View File

@ -4,7 +4,7 @@
{
'name': 'Web Widget Child Selector',
'summary': "Widget used for navigation on hierarchy fields",
'version': '11.0.1.0.0',
'version': '12.0.1.0.0',
'license': 'AGPL-3',
'author': 'Creu Blanca,Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/web',

View File

@ -13,10 +13,6 @@ odoo.define('web.web_widget_child_selector', function(require) {
'click .o_child_selection_button': '_onChildSelectionClick',
}),
start: function () {
// boolean indicating that the content of the input isn't synchronized
// with the current m2o value (for instance, the user is currently
// typing something in the input, and hasn't selected a value yet).
this.$input_dropdown = this.$('.o_input_dropdown');
this.$input_value = this.$('.o_input_value')
return this._super.apply(this, arguments);

View File

@ -14,7 +14,7 @@
</t>
<t t-name="FieldChildSelectorChild">
<div class="row">
<div t-foreach="childs" t-as="key" class="col-xs-12">
<div t-foreach="childs" t-as="key" class="col-xl-12">
<t t-set="id_for_label" t-value="'o_child_hierarchy_selector_' + _.uniqueId()"/>
<input type="radio" t-att-data-id="childs[key][0]" t-att-data-index="key"
t-att-id="id_for_label" data-type="child" class="o_child_selection_button"/>
@ -34,7 +34,7 @@
</a>
</t>
<t t-if="Object.keys(parents).length > 0">
<i class="fa fa-times o_child_selection_button o_child_selection_clear" aria-hidden="true" data-type="clear"/>
<i class="fa fa-times o_child_selection_button o_child_selection_clear" aria-hidden="false" data-type="clear"/>
</t>
</span>
</t>

View File

@ -8,12 +8,13 @@ class TestWidgetChildSelector(TransactionCase):
def setUp(self):
super().setUp()
self.partner_1 = self.env['res.partner'].create({'name': 'P1'})
self.partner_2 = self.env['res.partner'].create({
ResPartner = self.env['res.partner'].with_context(tracking_disable=True)
self.partner_1 = ResPartner.create({'name': 'P1'})
self.partner_2 = ResPartner.create({
'name': 'P2',
'parent_id': self.partner_1.id
})
self.partner_3 = self.env['res.partner'].create({
self.partner_3 = ResPartner.create({
'name': 'P3',
'parent_id': self.partner_2.id
})