<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/mrp/controller, 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>[FIX] base: preserve mime type for uploaded Word documents</title>
<updated>2020-10-16T07:49:06+00:00</updated>
<author>
<name>Nicolas Galler</name>
<email>ngl@odoo.com</email>
</author>
<published>2020-10-12T10:22:06+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=2820ec7d5763a5856274709a4d2024267313106b'/>
<id>2820ec7d5763a5856274709a4d2024267313106b</id>
<content type='text'>
Behavior before the fix:

- When uploading an office 2007 attachment (.xlsx / .docx) as a regular
(non admin) user, the preview shows it as text, and the download option
by default saves it as a text document (in certain browsers, at least).
This stems from an over-aggressive check on mime type (anything that
contains 'xml' **anywhere** in the mime type is taken to be XML, but the
mime type for an Office document is
`application/vnd.openxmlformats-officedocument.wordprocessingml.document`
so it falls in the XML case.

Behavior after the fix:

- The mime type is preserved
- Mime type for XML-like documents (including HTML and SVG) continues to
be validated

opw-2352712

closes odoo/odoo#60145

X-original-commit: 6ec5e44e4a2109c62827fbcd93521d64881b3116
Related: odoo/enterprise#14154
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
Signed-off-by: Nicolas Galler &lt;nicocrm@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Behavior before the fix:

- When uploading an office 2007 attachment (.xlsx / .docx) as a regular
(non admin) user, the preview shows it as text, and the download option
by default saves it as a text document (in certain browsers, at least).
This stems from an over-aggressive check on mime type (anything that
contains 'xml' **anywhere** in the mime type is taken to be XML, but the
mime type for an Office document is
`application/vnd.openxmlformats-officedocument.wordprocessingml.document`
so it falls in the XML case.

Behavior after the fix:

- The mime type is preserved
- Mime type for XML-like documents (including HTML and SVG) continues to
be validated

opw-2352712

closes odoo/odoo#60145

X-original-commit: 6ec5e44e4a2109c62827fbcd93521d64881b3116
Related: odoo/enterprise#14154
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
Signed-off-by: Nicolas Galler &lt;nicocrm@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] mrp: create mrp.document through mrp.eco</title>
<updated>2020-03-30T14:42:12+00:00</updated>
<author>
<name>svs-odoo</name>
<email>svs@odoo.com</email>
</author>
<published>2020-03-25T15:55:52+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=c1f3596bd32efcbec40e66c29930ccdc29072f92'/>
<id>c1f3596bd32efcbec40e66c29930ccdc29072f92</id>
<content type='text'>
How to reproduce:
  - Open PLM app, open an Engineering Change Order;
  - Click on "Update Documents";
  - Try to upload a document -&gt; Traceback.

As we did not cast res_id as integer, the check method of ir.attachment
crashes when accessing company_id on a malformed recordset of ECO
because the domain generated by _filter_access_rules_python is:

  `['|', ('company_id', '=', False), ('company_id', 'in', [2, 1])]`

This route is also used when adding attachment to a `product.product`.
In this case the check didn't work either but somehow passed because no
domain is generated by `_filter_access_rules_python`.
The following snippet shows that if there was one, it would also crash:

```
In [16]: records
Out[16]: product.product('25',)

In [17]: records.stock_move_ids
Out[17]: stock.move()

In [18]: self.env['product.product'].browse(25)
Out[18]: product.product(25,)

In [19]: self.env['product.product'].browse(25).stock_move_ids
Out[19]: stock.move(41, 13)
```

task-2223153

closes odoo/odoo#48515

Signed-off-by: Simon Lejeune (sle) &lt;sle@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
How to reproduce:
  - Open PLM app, open an Engineering Change Order;
  - Click on "Update Documents";
  - Try to upload a document -&gt; Traceback.

As we did not cast res_id as integer, the check method of ir.attachment
crashes when accessing company_id on a malformed recordset of ECO
because the domain generated by _filter_access_rules_python is:

  `['|', ('company_id', '=', False), ('company_id', 'in', [2, 1])]`

This route is also used when adding attachment to a `product.product`.
In this case the check didn't work either but somehow passed because no
domain is generated by `_filter_access_rules_python`.
The following snippet shows that if there was one, it would also crash:

```
In [16]: records
Out[16]: product.product('25',)

In [17]: records.stock_move_ids
Out[17]: stock.move()

In [18]: self.env['product.product'].browse(25)
Out[18]: product.product(25,)

In [19]: self.env['product.product'].browse(25).stock_move_ids
Out[19]: stock.move(41, 13)
```

task-2223153

closes odoo/odoo#48515

Signed-off-by: Simon Lejeune (sle) &lt;sle@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] mrp: mrp_document</title>
<updated>2020-03-04T10:12:46+00:00</updated>
<author>
<name>Ankita Raval</name>
<email>anr@odoo.com</email>
</author>
<published>2019-12-10T13:15:08+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=65513ef3f92d82806d03bd5fe55c7f9af4f1484d'/>
<id>65513ef3f92d82806d03bd5fe55c7f9af4f1484d</id>
<content type='text'>
Purpose:
Modernizes and facilitates files upload in manufacturing app.

In this Commit:
  - Show the image in Kanban.
  - Allow to access a preview of the file when clicking on it in the
    Kanban view.
  - Add a 'Edit', 'Delete' and 'Download' in kanban card dropdown menu.
  - Add Upload button in control panel to upload document which will
    create new record of `mrp.document` and also add a testcase for it.

task-1960733

closes odoo/odoo#42168

Related: odoo/enterprise#8977
Signed-off-by: Simon Lejeune (sle) &lt;sle@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Purpose:
Modernizes and facilitates files upload in manufacturing app.

In this Commit:
  - Show the image in Kanban.
  - Allow to access a preview of the file when clicking on it in the
    Kanban view.
  - Add a 'Edit', 'Delete' and 'Download' in kanban card dropdown menu.
  - Add Upload button in control panel to upload document which will
    create new record of `mrp.document` and also add a testcase for it.

task-1960733

closes odoo/odoo#42168

Related: odoo/enterprise#8977
Signed-off-by: Simon Lejeune (sle) &lt;sle@openerp.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
