<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/barcodes/static/src/js/form_view_barcode_handler.js, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[REF] barcode, *: update code to new JS framework</title>
<updated>2017-04-11T17:44:38+00:00</updated>
<author>
<name>Christophe Matthieu</name>
<email>chm@odoo.com</email>
</author>
<published>2017-03-29T15:25:18+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=920df597d3d7174723736a395e94dc8ff413c70b'/>
<id>920df597d3d7174723736a395e94dc8ff413c70b</id>
<content type='text'>
With the new views, the barcode mechanisms were completely broken,
because the view and widget JS code was totally changed.

This commit update and refactor all that code to make it work with the
new design philosophy.  Also, it update the coding style.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With the new views, the barcode mechanisms were completely broken,
because the view and widget JS code was totally changed.

This commit update and refactor all that code to make it work with the
new design philosophy.  Also, it update the coding style.
</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] web,*: remove 'web.model' and 'web.dataModel</title>
<updated>2017-04-11T17:44:38+00:00</updated>
<author>
<name>Géry Debongnie</name>
<email>ged@odoo.com</email>
</author>
<published>2017-03-05T08:34:56+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=e5740270568404d71a3bc093074a085c9c2eded8'/>
<id>e5740270568404d71a3bc093074a085c9c2eded8</id>
<content type='text'>
Use this.rpc instead of Model object, with web.ajax if necessary.

nb: EventDispatcherMixin include now the custom_events managment instead
of widget
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use this.rpc instead of Model object, with web.ajax if necessary.

nb: EventDispatcherMixin include now the custom_events managment instead
of widget
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web, barcodes: attrs processing in kanban</title>
<updated>2017-04-11T17:44:38+00:00</updated>
<author>
<name>qsm-odoo</name>
<email>qsm@odoo.com</email>
</author>
<published>2017-02-22T12:34:13+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=fba8d0e5cdf9b52b8b9000ade77b69093b5681d6'/>
<id>fba8d0e5cdf9b52b8b9000ade77b69093b5681d6</id>
<content type='text'>
Commit cef659783514f8935cc46a496f71063d022e8dac changed the way domains
are computed but forgot to change the values representation used by the
Kanban view. This commit fixes that and adds tests to make sure it does
not happen again.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit cef659783514f8935cc46a496f71063d022e8dac changed the way domains
are computed but forgot to change the values representation used by the
Kanban view. This commit fixes that and adds tests to make sure it does
not happen again.
</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] web, *: redesign all JS views</title>
<updated>2017-04-11T17:44:38+00:00</updated>
<author>
<name>Géry Debongnie</name>
<email>ged@odoo.com</email>
</author>
<published>2017-03-05T09:05:56+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=905e01921f3c3ef43ace6fc537d1d8c0d280002c'/>
<id>905e01921f3c3ef43ace6fc537d1d8c0d280002c</id>
<content type='text'>
This commit introduce a full redesign of all JS views.  We started
basically from scratch.  The goal was to unify all the various views
under a common framework, to make them testable, to make then usable in
different conditions (in studio, or in the frontend), and to make our
lives easier.

Some important points are:
- we introduced new coding guidelines (camelCase, 80 chars width, ...)
- we have a brand new testing framework (still QUnit based)
- kanban view moved to the web addon
- calendar view (formerly web_calender) moved to web as well
- the tree view was removed
- all new code should be documented

We hope that this code is the start of a new era for the Odoo web
client, we want to have a high quality codebase, well documented, well
tested, well designed.

Work done by the framework team: mostly aab, ged, chm, dmo, qsm
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit introduce a full redesign of all JS views.  We started
basically from scratch.  The goal was to unify all the various views
under a common framework, to make them testable, to make then usable in
different conditions (in studio, or in the frontend), and to make our
lives easier.

Some important points are:
- we introduced new coding guidelines (camelCase, 80 chars width, ...)
- we have a brand new testing framework (still QUnit based)
- kanban view moved to the web addon
- calendar view (formerly web_calender) moved to web as well
- the tree view was removed
- all new code should be documented

We hope that this code is the start of a new era for the Odoo web
client, we want to have a high quality codebase, well documented, well
tested, well designed.

Work done by the framework team: mostly aab, ged, chm, dmo, qsm
</pre>
</div>
</content>
</entry>
<entry>
<title>[MERGE] forward port branch saas-11 up to f1583504ceb</title>
<updated>2017-01-10T12:46:17+00:00</updated>
<author>
<name>Christophe Simonis</name>
<email>chs@odoo.com</email>
</author>
<published>2017-01-10T12:46:17+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=482fd04167410885264d5903ea621682f5f917db'/>
<id>482fd04167410885264d5903ea621682f5f917db</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] barcodes: form view barcode handler: concurrency</title>
<updated>2017-01-09T15:36:00+00:00</updated>
<author>
<name>Simon Lejeune</name>
<email>sle@openerp.com</email>
</author>
<published>2016-11-15T21:22:31+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=17adc2e09ec67ea4a2325b1cc5bfaf93e7d968c1'/>
<id>17adc2e09ec67ea4a2325b1cc5bfaf93e7d968c1</id>
<content type='text'>
Suppose the following usecase: you scan the first product of the
picking. A server onchange is then triggered. You scan the same product
a second time, before the first onchange has returned. You expect that
the first onchange is completely executed before running the second one.
This was not the case. Moreover, some onchanges were not be able to
work with the invalid  state of the formview at some times, and crashed.

The previous implementation was wrong because id didn't run the main
barcode processing mechanism inside a Mutex. It was also wrong because
it didn't correctly wait for the onchange to execute (a previous  barcode
onchanges or some classic ones) before setting the barcode field.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Suppose the following usecase: you scan the first product of the
picking. A server onchange is then triggered. You scan the same product
a second time, before the first onchange has returned. You expect that
the first onchange is completely executed before running the second one.
This was not the case. Moreover, some onchanges were not be able to
work with the invalid  state of the formview at some times, and crashed.

The previous implementation was wrong because id didn't run the main
barcode processing mechanism inside a Mutex. It was also wrong because
it didn't correctly wait for the onchange to execute (a previous  barcode
onchanges or some classic ones) before setting the barcode field.
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] barcodes: _set_quantity_listener</title>
<updated>2016-10-19T14:14:00+00:00</updated>
<author>
<name>Pierre Masereel</name>
<email>pim@odoo.com</email>
</author>
<published>2016-10-10T15:50:03+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=57c7b1d3a1dc874113ec262905672fd63f52db74'/>
<id>57c7b1d3a1dc874113ec262905672fd63f52db74</id>
<content type='text'>
Before, the '_set_quantity_listener' function was opening a 'window.prompt'
which had different comportment depending the navigator. For example,
the focus was not allways on the input field, the enter key 'Cancel'
the prompt or 'validate' it.

So to improve the usability and the consistancy we used a dialog instead
a prompt, to manage the focus and the 'Enter' key pressed when we want to
set a quantity.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before, the '_set_quantity_listener' function was opening a 'window.prompt'
which had different comportment depending the navigator. For example,
the focus was not allways on the input field, the enter key 'Cancel'
the prompt or 'validate' it.

So to improve the usability and the consistancy we used a dialog instead
a prompt, to manage the focus and the 'Enter' key pressed when we want to
set a quantity.
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] barcodes: set_quantity traceback on mobile</title>
<updated>2016-10-14T10:22:22+00:00</updated>
<author>
<name>Pierre Masereel</name>
<email>pim@odoo.com</email>
</author>
<published>2016-10-10T14:51:58+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=852e2c557e3449db2f367fca69d9c6a778996ae4'/>
<id>852e2c557e3449db2f367fca69d9c6a778996ae4</id>
<content type='text'>
When we are trying to set the quantity on a mobile device, we get
a traceback saying that we cannot call the 'find' function on the
elements returned by '_get_records'.

This '_get_records' function returns a 'Collection' when called on a tree
view and an 'Array' when called on a kanban view. When we are working
on a mobile device, most of the one2many are displayed as kanban.
The thing is when we work with the object returned by '_get_records' we
call a 'find' method on it, which is implemented by Odoo's Collection class.

So when we call 'find' on an 'Array' we actually call 'Array.prototype.find' which
is implemented on most desktop browser and on some mobile browser [1]. This is what
caused the traceback on Chrome in Android.

To fix this issue, we enforce '_get_records' to always return an 'Array' and we ensure
that, when working on this 'Array', we use '_.find'.

[1] https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When we are trying to set the quantity on a mobile device, we get
a traceback saying that we cannot call the 'find' function on the
elements returned by '_get_records'.

This '_get_records' function returns a 'Collection' when called on a tree
view and an 'Array' when called on a kanban view. When we are working
on a mobile device, most of the one2many are displayed as kanban.
The thing is when we work with the object returned by '_get_records' we
call a 'find' method on it, which is implemented by Odoo's Collection class.

So when we call 'find' on an 'Array' we actually call 'Array.prototype.find' which
is implemented on most desktop browser and on some mobile browser [1]. This is what
caused the traceback on Chrome in Android.

To fix this issue, we enforce '_get_records' to always return an 'Array' and we ensure
that, when working on this 'Array', we use '_.find'.

[1] https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] barcodes: correctly unbind quantity event listener</title>
<updated>2016-09-15T14:20:18+00:00</updated>
<author>
<name>Simon Lejeune</name>
<email>sle@openerp.com</email>
</author>
<published>2016-09-15T14:17:17+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=6647e1f8a98b0fac4310a17c016df0a1a33e13b7'/>
<id>6647e1f8a98b0fac4310a17c016df0a1a33e13b7</id>
<content type='text'>
The quantity event handler is not correctly unbound when its action
is deleted, resulting in multiple window.prompt asking the quantity
of the products if you go mulitple times trough a view when a widget
implementing the barcode thing is used.

There seems to be a bug in the framework ("barcode_scanned" events
are registered the same way than the "keypress" one on core.bus
but they don't have suffer from the same issue).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The quantity event handler is not correctly unbound when its action
is deleted, resulting in multiple window.prompt asking the quantity
of the products if you go mulitple times trough a view when a widget
implementing the barcode thing is used.

There seems to be a bug in the framework ("barcode_scanned" events
are registered the same way than the "keypress" one on core.bus
but they don't have suffer from the same issue).
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] barcodes: first qualify the quantity event before handling it</title>
<updated>2016-03-18T12:11:25+00:00</updated>
<author>
<name>Joren Van Onder</name>
<email>jov@odoo.com</email>
</author>
<published>2016-03-18T11:45:49+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=fe76e6bc364de1566bfea3492715607502ad2477'/>
<id>fe76e6bc364de1566bfea3492715607502ad2477</id>
<content type='text'>
Introduced by 5bb64d40d0b94b252c2e29e6a050ae37fbd87b0f. Before doing
anything we should first ensure that the quantity keypress event targets
body (and that it is a number, but that's less important). Before this
we didn't do that and thus the _display_no_edit_mode_warning was given
when people where just typing in the associated thread of a picking.

opw-672350
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduced by 5bb64d40d0b94b252c2e29e6a050ae37fbd87b0f. Before doing
anything we should first ensure that the quantity keypress event targets
body (and that it is a number, but that's less important). Before this
we didn't do that and thus the _display_no_edit_mode_warning was given
when people where just typing in the associated thread of a picking.

opw-672350
</pre>
</div>
</content>
</entry>
</feed>
