Skip to content

Conversation

@kurkop
Copy link

@kurkop kurkop commented Oct 26, 2015

This commit add changes to PR #276 (fix bug when export many2many fields).

Updated:

module_prototyper/models/module_prototyper.py:
    Added set_keep_external_ids method: Set the the keep_external_ids from the wizard keep_external_ids will help to update all external ids or keep exsting ones.
    Added topological_sort method: Items must be provided in the form of an iterable, where the key has a tuple.
    Modify generate_data_files method: Added code to construct a better data file.
    Added order_data method: Create a hierarchy to export external ids, using a level dependent of parent.
    Added generate_external_id method: Create all external ids to later export.
    Added fixup_data method: Order, generate external ids and load all data to export.
    Added deps_detect method: Detect depedencies on the data fields.
    Add fields_ignore to some methods: This variable transport a information related by "Circular dependency cleaning" from wizard 'volatile" to export methods.

module_prototyper/wizard/module_prototyper_module_export.py:
    Added fields (keep_external_ids, fields_selected, fields_selected_initial, fields_not_selected): Keep_external_ids guaranted that the external_ids in the database are not rewrite when export module. fields_selected* is used to store the cleanup data when exists a circular dependency.
    dep_solve, action export, zip_files override: This override guaranted the correct "circular dependency cleaning" in exporting methods (see fields_ignore).

module_prototyper/wizard/module_prototyper_module_export_view.xml:
    Added fields_selected, fields_selected_initial, fields_not_selected to the export wizard.

module_prototyper/templates/8.0/data/model_name.xml.template:
    Added logic to generate fields with all addtional information.

@kurkop
Copy link
Author

kurkop commented Oct 26, 2015

@max3903 This is the new PR, contains a new commit. Please close PR: #276

@max3903 max3903 mentioned this pull request Nov 2, 2015
@max3903 max3903 changed the title 8.0 prototype export multiple reference oca kurkop 8.0 prototype export multiple reference Nov 3, 2015
@max3903 max3903 added this to the 8.0 milestone Nov 3, 2015
@max3903
Copy link
Member

max3903 commented Nov 3, 2015

@kurkop I did some testing on Runbot and tried to install the generated module. Few things to fix:

  • __openerp__.py

Category and summary are on the same line:

    'category': 'Tools',    'summary': 'Testing',

Data keyword contains demo file and demo keyword is wrong:

    # always loaded
    'data': [
            'views/crm_lead_view.xml',
            'views/crm_lead_menus.xml',
            'data/crm_lead.xml',
            'demo/crm_lead.xml',
    ],
    # only loaded in demonstration mode
    'demo': [
            'All leads',
    ],

If you can, we should remove the description keyword and output the content in a README.rst file

  • models/model.py

I created a char file with a length and I got an error message when installing the generated module. The coma after readonly is missing:

    # Notes to developers.
    test = fields.Char(
        string=_("Test"),
        required=False,
        translate=True,
        readonly=False
        size=50,
        help=_("Helper"),
    )

@max3903
Copy link
Member

max3903 commented Nov 3, 2015

@kurkop Can you also bump the version of the prototyper to 8.0.0.4.0 ? Thanks!

@max3903 max3903 mentioned this pull request Nov 3, 2015
11 tasks
@max3903 max3903 changed the title 8.0 prototype export multiple reference [8.0] prototype export data and demo files Nov 3, 2015
@kurkop
Copy link
Author

kurkop commented Nov 4, 2015

@max3903 I can't see the openerp.py errors:

https://github.com/kurkop/server-tools/blob/8.0-prototype-export-multiple-reference-oca-kurkop/module_prototyper/__openerp__.py

If you can, we should remove the description keyword and output the content in a README.rst file

    models/model.py

This file not exists in module_prototyper. (models/model.py)

I'm confused?

@moylop260
Copy link
Contributor

@kurkop
Thanks for you contribution.

There are old beta messages. Your fix is welcome (if you want)

************* Module module_prototyper
module_prototyper/__init__.py:1: [E7901(rst-syntax-error), ] data/README.rst:47 Unexpected possible title overline or transition.|Treating it as ordinary text because it's so short.
************* Module module_prototyper.__openerp__
module_prototyper/__openerp__.py:1: [C8201(no-utf8-coding-comment), ] No UTF-8 coding comment found: Use `# coding: utf-8` or `# -*- coding: utf-8 -*-`
************* Module module_prototyper.models.ir_model_fields
module_prototyper/models/ir_model_fields.py:1: [C8201(no-utf8-coding-comment), ] No UTF-8 coding comment found: Use `# coding: utf-8` or `# -*- coding: utf-8 -*-`
module_prototyper/models/ir_model_fields.py:27: [C8104(class-camelcase), ir_model_fields] Use `CamelCase` "IrModelFields" in class name "ir_model_fields". You can use oca-autopep8 of https://github.com/OCA/maintainer-tools to auto fix it.
module_prototyper/models/ir_model_fields.py:36: [W8103(translation-field), ir_model_fields] Translation method _("string") in fields is not necessary.
module_prototyper/models/ir_model_fields.py:41: [W8103(translation-field), ir_model_fields] Translation method _("string") in fields is not necessary.
module_prototyper/models/ir_model_fields.py:44: [W8103(translation-field), ir_model_fields] Translation method _("string") in fields is not necessary.
module_prototyper/models/ir_model_fields.py:47: [W8103(translation-field), ir_model_fields] Translation method _("string") in fields is not necessary.
************* Module module_prototyper.models.licenses
module_prototyper/models/licenses.py:1: [C8201(no-utf8-coding-comment), ] No UTF-8 coding comment found: Use `# coding: utf-8` or `# -*- coding: utf-8 -*-`
************* Module module_prototyper.models.module_prototyper
module_prototyper/models/module_prototyper.py:1: [C8201(no-utf8-coding-comment), ] No UTF-8 coding comment found: Use `# coding: utf-8` or `# -*- coding: utf-8 -*-`
************* Module module_prototyper.tests.test_prototype
module_prototyper/tests/test_prototype.py:1: [C8201(no-utf8-coding-comment), ] No UTF-8 coding comment found: Use `# coding: utf-8` or `# -*- coding: utf-8 -*-`
************* Module module_prototyper.tests.test_prototype_module_export
module_prototyper/tests/test_prototype_module_export.py:1: [C8201(no-utf8-coding-comment), ] No UTF-8 coding comment found: Use `# coding: utf-8` or `# -*- coding: utf-8 -*-`
module_prototyper/tests/test_prototype_module_export.py:27: [C8104(class-camelcase), test_prototype_module_export] Use `CamelCase` "TestPrototypeModuleExport" in class name "test_prototype_module_export". You can use oca-autopep8 of https://github.com/OCA/maintainer-tools to auto fix it.
************* Module module_prototyper.wizard.module_prototyper_module_export
module_prototyper/wizard/module_prototyper_module_export.py:1: [C8201(no-utf8-coding-comment), ] No UTF-8 coding comment found: Use `# coding: utf-8` or `# -*- coding: utf-8 -*-`

@max3903
Copy link
Member

max3903 commented Nov 4, 2015

@kurkop The errors I mentioned are in the generated module, not in the prototyper.

@max3903
Copy link
Member

max3903 commented Nov 20, 2015

@kurkop Few remaining things to fix:

  • the README.rst is not exported (and I don't know how to) although I added the template
  • the data and demo section of the exported __openerp__.py looks like this:
    # always loaded
    'data': [
            'data/res_partner.xml',
            'demo/res_partner.xml',
    ],
    # only loaded in demonstration mode
    'demo': [
            'ir.filters(17,)',
    ],
  • the exported class file do not use CamelCase so the exported module would fail Travis tests.

@kurkop
Copy link
Author

kurkop commented Dec 1, 2015

@max3903 excuse me, but I don't understand how fix errors to coverage testing. Do you can fix these?

@max3903
Copy link
Member

max3903 commented Dec 2, 2015

@kurkop Coveralls is red because the test coverage decreased. If you add a test to pass through new lines of code, it will increase and get green.

Let me know if you can fix the 3 items I mentioned above.

@max3903 max3903 self-assigned this Dec 28, 2015
kurkop and others added 7 commits December 28, 2015 11:58
…templates/8.0/data/model_name.xml.template, module_prototyper/wizard/module_prototyper_module_export.py, module_prototyper/wizard/module_prototyper_module_export_view.xml): Added and override methods/views that generate files during export.
…templates/8.0/data/model_name.xml.template): added suport to many2many field when export data
[IMP] Bump version. Add contributor.
[FIX] Pylint messages
[IMP] Bump version. Add contributor.
[ADD] README.rst.template
@kurkop kurkop force-pushed the 8.0-prototype-export-multiple-reference-oca-kurkop branch from 77744f7 to 7363b45 Compare December 28, 2015 17:01
StefanRijnhart pushed a commit to StefanRijnhart/server-tools that referenced this pull request Feb 26, 2017
Web mail send using composition wizard instead of 'mailto:'
@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Oct 31, 2021
@github-actions github-actions bot closed this Dec 5, 2021
SiesslPhillip pushed a commit to grueneerde/OCA-server-tools that referenced this pull request Nov 20, 2024
Syncing from upstream OCA/server-tools (10.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs fixing stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants