};
ns.assign_order_part_id_to_all = function() {
- var order_part_id = $('#quoations_and_orders_order_id').val();
- $('#quotations_and_orders_form SELECT[name="sections[].order_part_id"]').each(function(idx, elt) {
+ var order_part_id = $('#quotations_and_orders_order_id').val();
+ var order_part_name = $('#quotations_and_orders_order_id_name').val();
+
+ $('#quotations_and_orders_form INPUT[name="sections[].order_part_id"]').each(function(idx, elt) {
$(elt).val(order_part_id);
});
+
+ $('#quotations_and_orders_form [id^=quotations_and_orders_sections_order_pard_id_]').filter(function() {
+ return $(this).attr('id') && $(this).attr('id').match("^quotations_and_orders_sections_order_pard_id_[0-9]+_name$");
+ }).each(function(idx, elt) {
+ $(elt).val(order_part_name);
+ });
};
// -------------------------------------------------------------------------
<tr>
<td>[% LxERP.t8("Assign the following article to all sections") %]:</td>
<td>
- [% P.part_picker('quotations_and_orders_dummy', INSTANCE_CONF.get_requirement_spec_section_order_part_id, convertible_unit=SELF.h_unit_name, id='quoations_and_orders_order_id', style=style) %]
+ [% P.part_picker('quotations_and_orders_dummy', INSTANCE_CONF.get_requirement_spec_section_order_part_id, convertible_unit=SELF.h_unit_name, id='quotations_and_orders_order_id', style=style) %]
[% L.button_tag('kivi.requirement_spec.assign_order_part_id_to_all()', LxERP.t8('Assign article')) %]
</td>
</tr>
<td>[% HTML.escape(section.fb_number) %]</td>
<td>[% HTML.escape(section.title) %]</td>
<td>[% HTML.escape(P.truncate(section.description)) %]</td>
- <td>[% P.part_picker('sections[].order_part_id', section.order_part_id, convertible_unit=SELF.h_unit_name, id='quoations_and_orders_sections_order_pard_id_' _ loop.count, style=style) %]</td>
+ <td>[% P.part_picker('sections[].order_part_id', section.order_part_id, convertible_unit=SELF.h_unit_name, id='quotations_and_orders_sections_order_pard_id_' _ loop.count, style=style) %]</td>
</tr>
[% END %]
</tbody>