Permalink
Browse files

Merge pull request #715 from Rusllan/12.0-automerge-786373537733ebfac…

…9ce2a54a9d62dc4df3c8e11

12.0 automerge 7863735
  • Loading branch information...
yelizariev committed Dec 29, 2018
2 parents 3ee046c + 4eb3c3c commit f11ee752311754e62b3d5d6caafdbe99eb292db1
Showing with 431 additions and 21 deletions.
  1. 0 attachment_large_object/{__openerp__.py → __manifest__.py}
  2. 0 auth_signup_confirmation/{__openerp__.py → __manifest__.py}
  3. 0 auth_signup_confirmation_crm/{__openerp__.py → __manifest__.py}
  4. 0 autostaging_base/{__openerp__.py → __manifest__.py}
  5. 0 autostaging_project_task/{__openerp__.py → __manifest__.py}
  6. 0 barcode_widget/{__openerp__.py → __manifest__.py}
  7. 0 base_session_store_psql/{__openerp__.py → __manifest__.py}
  8. 0 crm_expected_revenue/{__openerp__.py → __manifest__.py}
  9. 0 crm_next_action/{__openerp__.py → __manifest__.py}
  10. 0 currency_rate_update/{__openerp__.py → __manifest__.py}
  11. +1 −1 currency_rate_update/currency_rate_update.xml
  12. 0 custom_menu_bar/{__openerp__.py → __manifest__.py}
  13. 0 delivery_sequence/{__openerp__.py → __manifest__.py}
  14. 0 delivery_special/{__openerp__.py → __manifest__.py}
  15. 0 fleet_odometer_oil/{__openerp__.py → __manifest__.py}
  16. 0 fleet_odometer_track_changes/{__openerp__.py → __manifest__.py}
  17. +0 −6 gamification_extra/README.rst
  18. 0 hr_public_holidays_ics_import/{__openerp__.py → __manifest__.py}
  19. 0 import_csv_fix_field_limit/{__openerp__.py → __manifest__.py}
  20. 0 invoice_sale_order_line_group/{__openerp__.py → __manifest__.py}
  21. +1 −1 invoice_sale_order_line_group/views/invoice_sale_order_line_group.xml
  22. +2 −2 invoice_sale_order_line_group/wizard/create_grouped_invoice.xml
  23. 0 ir_actions_todo_repeat/{__openerp__.py → __manifest__.py}
  24. 0 ir_attachment_force_storage/{__openerp__.py → __manifest__.py}
  25. +3 −1 ir_attachment_s3/controllers/main.py
  26. +0 −1 ir_attachment_s3/models/ir_attachment.py
  27. +1 −1 ir_attachment_url/__manifest__.py
  28. +6 −0 ir_attachment_url/doc/changelog.rst
  29. +33 −1 ir_attachment_url/models/binary_fields.py
  30. +3 −0 ir_attachment_url/models/image.py
  31. 0 product_category_taxes/{__openerp__.py → __manifest__.py}
  32. 0 product_tags/{__openerp__.py → __manifest__.py}
  33. 0 project_description/{__openerp__.py → __manifest__.py}
  34. 0 project_gantt8/{__openerp__.py → __manifest__.py}
  35. 0 project_kanban_customer/{__openerp__.py → __manifest__.py}
  36. 0 project_tags/{__openerp__.py → __manifest__.py}
  37. +1 −1 project_tags/view/project_tag_view.xml
  38. 0 project_task_auto_staging/{__openerp__.py → __manifest__.py}
  39. 0 project_task_order_kanban_state/{__openerp__.py → __manifest__.py}
  40. 0 project_task_search_custom/{__openerp__.py → __manifest__.py}
  41. 0 project_timelog/{__openerp__.py → __manifest__.py}
  42. +4 −4 project_timelog/views/project_timelog_views.xml
  43. 0 reminder_crm_next_action/{__openerp__.py → __manifest__.py}
  44. 0 reminder_hr_recruitment/{__openerp__.py → __manifest__.py}
  45. 0 reminder_issue_deadline/{__openerp__.py → __manifest__.py}
  46. 0 res_partner_country_code/{__openerp__.py → __manifest__.py}
  47. 0 res_partner_phone/{__openerp__.py → __manifest__.py}
  48. 0 res_users_signature/{__openerp__.py → __manifest__.py}
  49. +1 −1 res_users_signature/res_users_signature_views.xml
  50. 0 res_users_signature_hr/{__openerp__.py → __manifest__.py}
  51. 0 sale_order_hide_tax/{__openerp__.py → __manifest__.py}
  52. 0 thecage_data/{__openerp__.py → __manifest__.py}
  53. 0 web_calendar_quick_navigation/{__openerp__.py → __manifest__.py}
  54. 0 web_calendar_repeat_form/{__openerp__.py → __manifest__.py}
  55. +3 −0 web_debranding/tests/test_developer_mode_menu_elements.py
  56. 0 web_gantt8/{__openerp__.py → __manifest__.py}
  57. 0 web_iframe/{__openerp__.py → __manifest__.py}
  58. 0 web_iframe_pages/{__openerp__.py → __manifest__.py}
  59. +1 −1 web_iframe_pages/web_iframe_pages_views.xml
  60. +46 −0 web_multi_attachment_base/README.rst
  61. +1 −0 web_multi_attachment_base/__init__.py
  62. +40 −0 web_multi_attachment_base/__manifest__.py
  63. +4 −0 web_multi_attachment_base/doc/changelog.rst
  64. +28 −0 web_multi_attachment_base/doc/index.rst
  65. BIN web_multi_attachment_base/static/description/icon.png
  66. +71 −0 web_multi_attachment_base/static/description/index.html
  67. +7 −0 web_multi_attachment_base/static/src/css/drop_attachments.css
  68. +142 −0 web_multi_attachment_base/static/src/js/kanban_view.js
  69. +19 −0 web_multi_attachment_base/static/src/xml/web_kanban.xml
  70. +12 −0 web_multi_attachment_base/views/template.xml
  71. 0 web_polymorphic_field/{__openerp__.py → __manifest__.py}
  72. 0 web_sessions_management/{__openerp__.py → __manifest__.py}
  73. 0 web_tour_extra/{__openerp__.py → __manifest__.py}
  74. +1 −0 web_website/models/ir_property.py
@@ -5,7 +5,7 @@
<field name="name">Update Rates service</field>
<field name="model">currency.rate.update.service</field>
<field name="arch" type="xml">
<tree string="Rates">
<tree>
<field name="service"/>
<field name="currency_to_update"/>

This file was deleted.

Oops, something went wrong.
@@ -6,7 +6,7 @@
<field name="name">sale.order.line.tree</field>
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<tree string="Sales Orders Lines">
<tree>
<field name="sequence" widget="handle"/>
<field name="state" invisible="1"/>
<field name="th_weight" invisible="1"/>
@@ -23,14 +23,14 @@
<notebook invisible="1">
<page string="Invoiced">
<field name="invoiced_line_ids" mode="tree" nolabel="1">
<tree string="Invoiced lines" editable="False" create="0" delete="false">
<tree editable="False" create="0" delete="false">
<field name="write_date"/>
</tree>
</field>
</page>
<page string="Draft">
<field name="draft_line_ids" mode="tree" nolabel="1">
<tree string="Draft lines" editable="False" create="0" delete="false">
<tree editable="False" create="0" delete="false">
<field name="write_date"/>
</tree>
</field>
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
import logging
@@ -22,6 +21,9 @@ def content_image(self, xmlid=None, model='ir.attachment', id=None, field='datas

res = super(BinaryExtended, self).content_image(xmlid, model, id, field, filename_field, unique, filename, mimetype, download, width, height)

# TODO: if model=="product.product" and field in ('image', 'image_small', 'image_medium')
# we need to make similar trick, because those fields are computed resizes of image_variant
# with sizes 64*64, 128*128, 1024*1024
if not (res.status_code == 301 and (width or height)):
return res

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016-2018 Ildar Nasyrov <https://it-projects.info/team/iledarn>
# Copyright 2016-2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
import base64
@@ -3,7 +3,7 @@
"summary": """Use attachment URL and upload data to external storage""",
"category": "Tools",
"images": [],
"version": "12.0.1.1.7",
"version": "12.0.1.1.8",
"application": False,

"author": "IT-Projects LLC, Ildar Nasyrov",
@@ -1,3 +1,9 @@
`1.1.8`
-------

- **Fix** When a link to a picture that does not have an extension is written in a binary field, its mimetype is not determined, which leads to an "binascii.Error: decoding with base64 codec failed (Error: Incorrect padding)"
- **Improvement:** The `index_content` field is filled for attachments when a link to a file is written in a binary field.

`1.1.7`
-------

@@ -1,8 +1,33 @@
# Copyright 2017 Dinar Gabbasov <https://www.it-projects.info/team/GabbasovDinar>
# Copyright 2018 Rafis Bikbov <https://www.it-projects.info/team/RafiZz>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo import fields
import mimetypes
import requests

from odoo.tools.mimetypes import guess_mimetype
from . import image


def get_mimetype_and_optional_content_by_url(url):
mimetype = mimetypes.guess_type(url)[0]
content = None

# head request for content-type header getting
if not mimetype:
with requests.head(url) as r:
mimetype = getattr(r, 'headers', {}).get('Content-Type')

index_content = mimetype and mimetype.split('/')[0]
if not mimetype or index_content == 'text':
with requests.get(url) as r:
content = getattr(r, 'content')
if not mimetype and content:
mimetype = guess_mimetype(content)

return mimetype, content


class Binary(fields.Binary):

def write(self, records, value):
@@ -20,13 +45,18 @@ def write(self, records, value):
if value and image.is_url(value):
with records.env.norecompute():
if value:
mimetype, content = get_mimetype_and_optional_content_by_url(value)
index_content = records.env['ir.attachment']._index(content, None, mimetype)

# update the existing attachments
atts.write({
'url': value,
'mimetype': mimetypes.guess_type(value)[0],
'mimetype': mimetype,
'datas': None,
'type': 'url',
'index_content': index_content,
})

# create the missing attachments
for record in (records - records.browse(atts.mapped('res_id'))):
atts.create({
@@ -36,6 +66,8 @@ def write(self, records, value):
'res_id': record.id,
'type': 'url',
'url': value,
'mimetype': mimetype,
'index_content': index_content,
})
else:
atts.unlink()
@@ -1,3 +1,6 @@
# Copyright 2017 Dinar Gabbasov <https://www.it-projects.info/team/GabbasovDinar>
# Copyright 2018 Rafis Bikbov <https://www.it-projects.info/team/RafiZz>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo import tools
import re

@@ -68,7 +68,7 @@
<field name="name">project_tags.project_tag.tree</field>
<field name="model">project_tags.project_tag</field>
<field name="arch" type="xml">
<tree string="project_tag"
<tree
>
<field name="name"
/>
@@ -8,7 +8,7 @@
<field name="priority" eval="999"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='timesheet_ids']/tree" position="replace">
<tree editable="bottom" string="Timesheet Activities" default_order="date">
<tree editable="bottom" default_order="date">
<field name="name" attrs="{'readonly': [('status', '=', 'nonactive')]}"/>
<field name="status" invisible="1"/>
<field name="user_current" invisible="1"/>
@@ -105,7 +105,7 @@
<field name="name">timelog</field>
<field name="model">project.timelog</field>
<field name="arch" type="xml">
<tree string="My timelog" create="false" edit="true" >
<tree create="false" edit="true" >
<field name="work_id" string="Subtask"/>
<field name="start_datetime" />
<field name="end_datetime" />
@@ -120,7 +120,7 @@
<field name="name">timelog</field>
<field name="model">project.timelog</field>
<field name="arch" type="xml">
<tree string="Timelog" create="false" edit="true" >
<tree create="false" edit="true" >
<field name="user_id" string="User"/>
<field name="work_id" sting="Subtask"/>
<field name="start_datetime" />
@@ -218,7 +218,7 @@
<field name="name">account.analytic.line.ext.tree</field>
<field name="model">account.analytic.line</field>
<field name="arch" type="xml">
<tree string="Project Task Work">
<tree>
<field name="user_id" invisible="1"/>
<field name="name" readonly="1"/>
<field name="account_id" readonly="1"/>
@@ -32,7 +32,7 @@
<field name="model">res.users.signature</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Signatures">
<tree>
<field name="name"/>
<field name="comment"/>
</tree>
@@ -22,6 +22,9 @@ def test_01_remove_developer_mode_menu_elements(self):
console.log('page is loading');
return;
}
setTimeout(function(){
// request ..../res.users/is_admin may take some time
// TODO: add a way to check that it's a time to check result (variable on loading in web_debranding/static/src/js/user_menu.js ?)
if ($('a[data-menu="debug"]').length > 0 || $('a[data-menu="debugassets"]').length > 0) {
console.log('error', 'Developer mode menu elements are displayed for not admin user');
} else {
File renamed without changes.
File renamed without changes.
@@ -15,7 +15,7 @@
<field name="name">web_iframe_pages.page.tree</field>
<field name="model">web_iframe_pages.page</field>
<field name="arch" type="xml">
<tree string="IFrame" editable="top">
<tree editable="top">
<field name="menu_id_parent_id" context="{'default_iframe_pages_group':True}"/>
<field name="menu_id_name"/>
<field name="link"/>
@@ -0,0 +1,46 @@
.. image:: https://img.shields.io/badge/license-LGPL--3-blue.png
:target: https://www.gnu.org/licenses/lgpl
:alt: License: LGPL-3

=============================
Upload Multiple Attachments
=============================

The technical module to upload multiple attachments at once.

Use it with `Upload Multiple Images at Once <https://apps.odoo.com/apps/modules/11.0/multi_attachment_product_image/>`__

Credits
=======

Contributors
------------
* `Dinar Gabbasov <https://it-projects.info/team/DinarGabbasov>`__
* `Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>`__

Sponsors
--------
* `IT-Projects LLC <https://it-projects.info>`__

Maintainers
-----------
* `IT-Projects LLC <https://it-projects.info>`__

To get a guaranteed support you are kindly requested to purchase the module at `odoo apps store <https://apps.odoo.com/apps/modules/11.0/web_multi_attachment_base/>`__.

Thank you for understanding!

`IT-Projects Team <https://www.it-projects.info/team>`__

Further information
===================

Demo: http://runbot.it-projects.info/demo/misc-addons/11.0

HTML Description: https://apps.odoo.com/apps/modules/11.0/web_multi_attachment_base/

Usage instructions: `<doc/index.rst>`_

Changelog: `<doc/changelog.rst>`_

Tested on Odoo 11.0 97dbb8c6af4c6af0622497b276bdfb40ee0a3215
@@ -0,0 +1 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
@@ -0,0 +1,40 @@
# Copyright 2018 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar>
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": """Upload Multiple Attachments""",
"summary": """The technical module to upload multiple attachments at once""",
"category": "Extra Tools",
# "live_test_url": "",
"images": [],
"version": "11.0.1.0.0",
"application": False,

"author": "IT-Projects LLC, Dinar Gabbasov, Kolushov Alexandr",
"support": "apps@it-projects.info",
"website": "https://it-projects.info/team/GabbasovDinar",
"license": "LGPL-3",
"price": 19.00,
"currency": "EUR",

"depends": [
"web"
],
"external_dependencies": {"python": [], "bin": []},
"data": [
"views/template.xml",
],
"qweb": [
"static/src/xml/web_kanban.xml"
],
"demo": [
],

"post_load": None,
"pre_init_hook": None,
"post_init_hook": None,
"uninstall_hook": None,

"auto_install": False,
"installable": False,
}
@@ -0,0 +1,4 @@
`1.0.0`
-------

- Init version
@@ -0,0 +1,28 @@
=============================
Upload Multiple Attachments
=============================

Installation
============

* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way

Usage
=====

To use this module add a model for attachments and specify the attribute **drop_attachments_field = '1'** into the corresponding kanban view.

For example::

<field name="something_image_ids" mode="kanban">
<kanban string="Something Images"
drop_attachments_field='1'>
<field name="name"/>
<field name="image" />

...

</kanban>
</field>

Where something_image_ids is a One2many field to the model with images.
Binary file not shown.
Oops, something went wrong.

0 comments on commit f11ee75

Please sign in to comment.