• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OCA / openupgradelib / 261 / 2
0%
master: 0%

Build:
DEFAULT BRANCH: master
Ran 21 Jan 2017 03:53PM UTC
Files 4
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Jan 2017 03:53PM UTC coverage: 26.166%. Remained the same
261.2

Pull #66

travis-ci

web-flow
[ADD] convert_binary_field_to_attachment

This method converts the 8.0 binary fields to attachments like Odoo 9.0
makes with the new attachment=True attribute. It has to be called on
post-migration script, as there's a call to get the res_name of the
target model, which is not yet loaded on pre-migration.

You need to rename the involved column in pre-migration script if you
don't want to lose your data in the process.

This method also removes after the conversion the source column for
avoiding data duplication.

This is done through Odoo ORM, because there's a lot of logic associated
with guessing MIME type, format and length, file saving in store...
that is doesn't worth to recreate it via SQL as there's not too much
performance problem.

:param env: Odoo environment
:param field_spec: A dictionary with the ORM model name as key, and as
    dictionary values a tuple with:
        * field name to be converted as attachment as first element.
        * SQL column name that contains actual data as second element. If
          the second element is None, then the column name is taken
          calling `get_legacy_name` method, which is the typical technique.

* field name to be converted as attachment as first element.
* SQL column name that contains actual data as second element. If
  the second element is None, then the column name is taken
  calling `get_legacy_name` method.
Pull Request #66: [ADD] convert_binary_field_to_attachment

129 of 493 relevant lines covered (26.17%)

0.26 hits per line

Source Files on job 261.2
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 261
  • Travis Job 261.2
  • 56d1e0e7 on github
  • Prev Job for on master (#257.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc