Skip to content

[10.0][MIG][base_export_manager] Full migration to version 10#870

Merged
pedrobaeza merged 18 commits into
OCA:10.0from
Tecnativa:10.0-base_export_manager
Aug 16, 2017
Merged

[10.0][MIG][base_export_manager] Full migration to version 10#870
pedrobaeza merged 18 commits into
OCA:10.0from
Tecnativa:10.0-base_export_manager

Conversation

@yajo

@yajo yajo commented Jun 22, 2017

Copy link
Copy Markdown
Member

I was becoming crazy with git... versions 8 and 9 of the addon diverged.

Now, features from both versions will be available for 10.0.

I'm thinking on removing transbot commits, since translations are gonna be broken anyways (either missing v9 strings or v8 ones).

This resumes work form #712.

@Tecnativa

oca-transbot and others added 16 commits June 21, 2017 14:51
- Improve user instructions in README.
- Require some required fields.
- Allow to select models from a list.
- Allow to select up to 3 fields from dynamic lists.
- Improve translations.
- More tests.
- Translate column labels.

Some methods have been renamed, so version tag is raised to 8.0.2.0.0.
…nes.

Depending on the context where the record is created, it gets `resource` or `model_id`. The problem is that Odoo checks constrains before inverses, so constrains would fail always.

Test added to ensure future versions contemplate all use cases.
[FIX][base_export_manager] Fix "Expected singleton" bug.

If you had a field that got translated in more than 1 addon, you'd possibly getto this error:

      File "/opt/odoo/0079_ahk_openerp/oca/base_export_manager/models/ir_exports_line.py", line 105, in _compute_label
        field.name)),
      File "/opt/odoo/common/openerp/v8/openerp/fields.py", line 825, in __get__
        record.ensure_one()
      File "/opt/odoo/common/openerp/v8/openerp/models.py", line 5355, in ensure_one
        raise except_orm("ValueError", "Expected singleton: %s" % self)
    except_orm: ('ValueError', 'Expected singleton: ir.translation(4899, 703976)')

With this patch, now we let Odoo return the translated string by using its
standard method to do so, so we have to care for less.

* Move installation outside a data file.

This makes the whole installation to be able to roll back if something goes
wrong, instead of entering an error loop.

* Include envorionment in its manager.

* Add 4th field

* Move to api.multi, refactoring some stuff.

- Add some comments in complex parts.
- Rename `onchange_name` to `_onchange_name` (guidelines).
- Make `_compute_name`'s try block shorter and easier to understand.

* Allow R/W of name directly in model.

* Update tests to cover new behaviors.
@yajo yajo added this to the 10.0 milestone Jun 22, 2017
@yajo yajo self-assigned this Jun 22, 2017
@pedrobaeza pedrobaeza mentioned this pull request Jun 22, 2017
63 tasks

@yvaucher yvaucher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the test to fix. Code review 👍 + tested locally (only the export access right and the visibility of the button didn't try export profiles)

check_label = " (res.partner) (parent_id/name)"
self.assertEqual(export_line.with_context(lang="en_US").label,
"Related Company/Name (parent_id/name)")
"Related Company (res.partner)/Name" + check_label)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to fail:

FAIL: test_get_label_string (odoo.addons.base_export_manager.tests.test_ir_exports_line.TestIrExportsLineCase)
Traceback (most recent call last):
`   File "/home/travis/build/OCA/server-tools/base_export_manager/tests/test_ir_exports_line.py", line 42, in test_get_label_string
`     "Related Company (res.partner)/Name" + check_label)
` AssertionError: u'Related Company/Name (parent_id/name)' != 'Related Company (res.partner)/Name (res.partner) (parent_id/name)'
FAILED
Module base_export_manager: 1 failures, 0 errors

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Little changes, but overall OK

from openerp import models, fields, api, exceptions
from openerp.tools.translate import _
from odoo import models, fields, api, exceptions
from odoo.tools.translate import _

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import _ also from odoo

@chienandalu chienandalu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested funcionality:

  • Create an export list and check that it's added to the new export view.
  • Create an export from the new view and check that appears on its model view.
  • Restrict export for a users group and check that export is not available anymore on the affected views.

@OCA OCA deleted a comment from yajo Jul 3, 2017
@pedrobaeza

Copy link
Copy Markdown
Member

@yvaucher please give your approval.

@pedrobaeza

Copy link
Copy Markdown
Member

As @yvaucher's comment is attended and he doesn't answer, I proceed to merge.

@pedrobaeza
pedrobaeza merged commit 69995cf into OCA:10.0 Aug 16, 2017
@pedrobaeza
pedrobaeza deleted the 10.0-base_export_manager branch August 16, 2017 12:25
SiesslPhillip pushed a commit to grueneerde/OCA-server-tools that referenced this pull request Nov 20, 2024
Updating from latest OCA 15.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants