profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/joao-p-marques/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
João Marques joao-p-marques @Tecnativa Portugal jmarques.icu

PR opened Tecnativa/doodba-copier-template

Reviewers
Add enterprise module handling

Like we do for OCA and private modules, allow to quickly install, resetdb and test enterprise modules.

+36 -9

0 comment

1 changed file

pr created time in 15 hours

push eventTecnativa/doodba-copier-template

João Marques

commit sha 073e69f3f54082f587dbad7cdec0d012378ad8ac

Add enterprise module handling Like we do for OCA and private modules, allow to quickly install, resetdb and test enterprise modules.

view details

push time in 15 hours

create barnchTecnativa/doodba-copier-template

branch : add-enterprise-modules-handling

created branch time in 15 hours

PullRequestReviewEvent

Pull request review commentOCA/account-payment

[12.0][IMP+FIX] account_payment_term_partner_holiday: Change addon to depends account_payment_term_extension

 def _onchange_payment_term_date_invoice(self):      @api.onchange("date_due")     def _onchange_date_due_account_payment_term_partner_holiday(self):-        if self.date_due and self.partner_id:+        """Is necessary to re-calculate only when payment_term_id is not set+        to prevent date_due is changed again and apply +10 days for example+        according to payment term.+        """

If you are adding a docstring, it would be better to explain the full behavior of the method. I think this would make it clearer:

        """Recompute the due date to the next available date according to
        the holiday periods set in the partner.
        
        It must only be re-calculated when a payment term is not set.
        This prevents the due date to be changed again and that another 
        given number of days are added according to what is set on the 
        payment term.
        """

Or something like that, if you think it is not completely right...

victoralmau

comment created time in 2 days

Pull request review commentOCA/account-payment

[12.0][IMP+FIX] account_payment_term_partner_holiday: Change addon to depends account_payment_term_extension

 # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).  from odoo import api, fields, models+from dateutil.relativedelta import relativedelta   class AccountPaymentTerm(models.Model):     _inherit = "account.payment.term"      @api.one     def compute(self, value, date_ref=False):+        """If date_to_check has changed is because initial date is in holiday+        period and these change make necessary to re-compute again to be sure+        that date returnes is according to payment term (+10 days or custom+        payment days).+        """         result = super().compute(value=value, date_ref=date_ref)[0]         ctx = self.env.context         partner_id = ctx.get("move_partner_id", ctx.get("default_partner_id"))         if partner_id:             partner = self.env["res.partner"].browse(partner_id)             result2 = []             for item in result:-                new_date_item = partner._get_valid_due_date(item[0])-                if new_date_item != item[0]:-                    result2.append((fields.Date.to_string(new_date_item), item[1]))-                else:-                    result2.append(item)+                new_item = (item[0], item[1])+                date_to_check = item[0]+                res_is_date_in_holiday = partner.is_date_in_holiday(date_to_check)+                while res_is_date_in_holiday:+                    date_to_check = res_is_date_in_holiday[1] + relativedelta(days=1)+                    date_to_check = fields.Date.to_string(date_to_check)+                    res = super().compute(+                        value=value, date_ref=date_to_check+                    )[0]+                    res_is_date_in_holiday = partner.is_date_in_holiday(res[0][0])+                # Need to re-compute according to initial comment+                if date_to_check != item[0]:+                    res = super().compute(+                        value=value, date_ref=date_to_check+                    )[0]+                    date_to_check = res[0][0]+                new_item = (date_to_check, item[1])+                result2.append(new_item)

If this is the actual desired behavior (always recompute the date), I think this can be simplified, following the current logic:

                new_date_item = partner._get_valid_due_date(item[0])
                if new_date_item != item[0]:
                    # Re-compute
                    res = super().compute(
                        value=value, date_ref=new_date_item
                    )[0]
                    result2.append(res[0])
                else:
                    result2.append(item)
            result = result2

This way, you avoid:

  1. Repeating code that you already have in res.partner for the incremental date check
  2. Re-compute the payment term result date twice (as for your explanation, you just need to recompute once when you already have the first available date computed)
victoralmau

comment created time in 2 days

Pull request review commentOCA/account-payment

[12.0][IMP+FIX] account_payment_term_partner_holiday: Change addon to depends account_payment_term_extension

 # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).  from odoo import api, fields, models+from dateutil.relativedelta import relativedelta   class AccountPaymentTerm(models.Model):     _inherit = "account.payment.term"      @api.one     def compute(self, value, date_ref=False):+        """If date_to_check has changed is because initial date is in holiday+        period and these change make necessary to re-compute again to be sure+        that date returnes is according to payment term (+10 days or custom+        payment days).+        """

As with before, maybe a more complete explanation would be clearer here:

        """Compute the due date taking into account the holiday periods
        set in the partner.
         
        Once an initial date resulting of the payment term is computed, compute the first 
        available date after that.
        Then, recompute the due date applying the payment term to the 
        previously computed date.
        """
victoralmau

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

startedlowdefy/lowdefy-example-reporting

started time in 3 days

startedawesome-selfhosted/awesome-selfhosted

started time in 3 days

Pull request review commentOCA/calendar

[MIG] resource_booking: migrate to v13

+cssselect+freezegun

Thanks for the insights :+1:

@Yajo I see you moved the entire file to test-requirements.txt. Is cssselect only for the tests as well? I thought only freezegun was...

Yajo

comment created time in 3 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentOCA/oca-custom

[14.0][MIG] oca_custom: Migration to 14.0

+# Copyright (C) 2016-Today: Odoo Community Association (OCA)+# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).++from odoo import fields, models+++class ResPartner(models.Model):+    _inherit = "res.partner"++    github_login = fields.Char(readonly=False)

This field was changed in the refactor to v14. Now it is called github_name. IMHO, that makes more sense, as it is a field shared across all github related models, and is not always a “login”. I have done migration scripts in the refactor, so you would just need to change this to:

    github_name = fields.Char(readonly=False)
ernestotejeda

comment created time in 3 days

PullRequestReviewEvent

Pull request review commentOCA/oca-custom

[14.0][MIG] oca_custom: Migration to 14.0

+===================+OCA Custom Settings+===================++.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!+   !! This file is generated by oca-gen-addon-readme !!+   !! changes will be overwritten.                   !!+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!++.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png+    :target: https://odoo-community.org/page/development-status+    :alt: Beta+.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png+    :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html+    :alt: License: AGPL-3+.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Foca--custom-lightgray.png?logo=github+    :target: https://github.com/OCA/oca-custom/tree/14.0/oca_custom+    :alt: OCA/oca-custom+.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png+    :target: https://translation.odoo-community.org/projects/oca-custom-14-0/oca-custom-14-0-oca_custom+    :alt: Translate me on Weblate+.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png+    :target: https://runbot.odoo-community.org/runbot/273/14.0+    :alt: Try me on Runbot++|badge1| |badge2| |badge3| |badge4| |badge5| ++Custom module for OCA Instance.++**Table of contents**++.. contents::+   :local:++Known issues / Roadmap+======================++* Make the github_login field from connector_github editable so it can be set

This is already done by the module, right? Can this point be removed?

ernestotejeda

comment created time in 3 days

PullRequestReviewEvent

Pull request review commentOCA/calendar

[MIG] resource_booking: migrate to v13

+cssselect+freezegun

This is just a doubt, not a real issue:

If this is a test requirement, should it go to test-requirements.txt? Also, is it correct to have it in external_dependencies in the manifest if it is only used for the tests?

Yajo

comment created time in 3 days

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

PR closed Tecnativa/docker-mailserver

Bump actions/stale from 3 to 4

Bumps actions/stale from 3 to 4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/stale/releases">actions/stale's releases</a>.</em></p> <blockquote> <h2>v4.0.0</h2> <p>⚠️ This version contains breaking changes ⚠️</p> <h3>Features</h3> <ul> <li><strong>options:</strong> simplify config by removing skip stale message options (<a href="https://github-redirect.dependabot.com/actions/stale/issues/457">#457</a>) (<a href="https://github.com/actions/stale/commit/6ec637d238067ab8cc96c9289dcdac280bbd3f4a">6ec637d</a>), closes <a href="https://github-redirect.dependabot.com/actions/stale/issues/405">#405</a> <a href="https://github-redirect.dependabot.com/actions/stale/issues/455">#455</a></li> <li><strong>output:</strong> print output parameters (<a href="https://github-redirect.dependabot.com/actions/stale/issues/458">#458</a>) (<a href="https://github.com/actions/stale/commit/3e6d35b685f0b2fa1a69be893fa07d3d85e05ee0">3e6d35b</a>)</li> </ul> <h3>Bug Fixes</h3> <ul> <li><strong>dry-run:</strong> forbid mutations in dry-run (<a href="https://github-redirect.dependabot.com/actions/stale/issues/500">#500</a>) (<a href="https://github.com/actions/stale/commit/f1017f33dd159ea51366375120c3e6981d7c3097">f1017f3</a>), closes <a href="https://github-redirect.dependabot.com/actions/stale/issues/499">#499</a></li> <li><strong>logs:</strong> coloured logs (<a href="https://github-redirect.dependabot.com/actions/stale/issues/465">#465</a>) (<a href="https://github.com/actions/stale/commit/5fbbfba142860ea6512549e96e36e3540c314132">5fbbfba</a>)</li> <li><strong>operations:</strong> fail fast the current batch to respect the operations limit (<a href="https://github-redirect.dependabot.com/actions/stale/issues/474">#474</a>) (<a href="https://github.com/actions/stale/commit/5f6f311ca6aa75babadfc7bac6edf5d85fa3f35d">5f6f311</a>), closes <a href="https://github-redirect.dependabot.com/actions/stale/issues/466">#466</a></li> <li><strong>label comparison</strong>: make label comparison case insensitive <a href="https://github-redirect.dependabot.com/actions/stale/pull/517">#517</a>, closes <a href="https://github-redirect.dependabot.com/actions/stale/pull/516">#516</a></li> <li><strong>filtering comments by actor could have strange behavior</strong>: "stale" comments are now detected based on if the message is the stale message not <em>who</em> made the comment(<a href="https://github-redirect.dependabot.com/actions/stale/pull/519">#519</a>), fixes <a href="https://github-redirect.dependabot.com/actions/stale/pull/441">#441</a>, <a href="https://github-redirect.dependabot.com/actions/stale/pull/509">#509</a>, <a href="https://github-redirect.dependabot.com/actions/stale/pull/518">#518</a></li> </ul> <h3>Breaking Changes</h3> <ul> <li>The options <code>skip-stale-issue-message</code> and <code>skip-stale-pr-message</code> were removed. Instead, setting the options <code>stale-issue-message</code> and <code>stale-pr-message</code> will be enough to let the stale workflow add a comment. If the options are unset, a comment will not be added which was the equivalent of setting <code>skip-stale-issue-message</code> to <code>true</code>.</li> <li>The <code>operations-per-run</code> option will be more effective. After migrating, you could face a failed-fast process workflow if you let the default value (30) or set it to a small number. In that case, you will see a warning at the end of the logs (if enabled) indicating that the workflow was stopped sooner to avoid consuming too much API calls. In most cases, you can just increase this limit to make sure to process everything in a single run.</li> </ul> <h2>v3.0.19</h2> <ul> <li>Enhance logs to provide more detailed output</li> <li>Split certain options to be more granular for Pull Requests vs Issues: <ul> <li>any-of-issue-labels</li> <li>any-of-pr-labels</li> <li>remove-issue-stale-when-updated</li> <li>remove-pr-stale-when-updated</li> </ul> </li> <li>Dependency updates</li> </ul> <h2>v3.0.18</h2> <ul> <li>Add <code>any-of-labels</code> option</li> <li>Add <code>only-issue-labels</code>, <code>only-pr-labels</code></li> <li>Clean up, testing and dependency version bumps</li> </ul> <h2>v3.0.17</h2> <ul> <li>Bug fixes, refactoring and milestone exemption</li> </ul> <h2>v3.0.16</h2> <ul> <li>Minor bugfixes and logging improvements</li> </ul> <h2>v3.0.15</h2> <ul> <li>Add milestone exemption</li> <li>Add start date filtering</li> <li>Add conditional days before close to different types of issues</li> <li>Better logging and updated dependencies</li> </ul> <h2>v3.0.14</h2> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions/stale/blob/main/CHANGELOG.md">actions/stale's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/actions/stale/compare/v3.0.19...v4.0.0">4.0.0</a> (2021-07-14)</h2> <h3>Features</h3> <ul> <li><strong>options:</strong> simplify config by removing skip stale message options (<a href="https://github-redirect.dependabot.com/actions/stale/issues/457">#457</a>) (<a href="https://github.com/actions/stale/commit/6ec637d238067ab8cc96c9289dcdac280bbd3f4a">6ec637d</a>), closes <a href="https://github-redirect.dependabot.com/actions/stale/issues/405">#405</a> <a href="https://github-redirect.dependabot.com/actions/stale/issues/455">#455</a></li> <li><strong>output:</strong> print output parameters (<a href="https://github-redirect.dependabot.com/actions/stale/issues/458">#458</a>) (<a href="https://github.com/actions/stale/commit/3e6d35b685f0b2fa1a69be893fa07d3d85e05ee0">3e6d35b</a>)</li> </ul> <h3>Bug Fixes</h3> <ul> <li><strong>dry-run:</strong> forbid mutations in dry-run (<a href="https://github-redirect.dependabot.com/actions/stale/issues/500">#500</a>) (<a href="https://github.com/actions/stale/commit/f1017f33dd159ea51366375120c3e6981d7c3097">f1017f3</a>), closes <a href="https://github-redirect.dependabot.com/actions/stale/issues/499">#499</a></li> <li><strong>logs:</strong> coloured logs (<a href="https://github-redirect.dependabot.com/actions/stale/issues/465">#465</a>) (<a href="https://github.com/actions/stale/commit/5fbbfba142860ea6512549e96e36e3540c314132">5fbbfba</a>)</li> <li><strong>operations:</strong> fail fast the current batch to respect the operations limit (<a href="https://github-redirect.dependabot.com/actions/stale/issues/474">#474</a>) (<a href="https://github.com/actions/stale/commit/5f6f311ca6aa75babadfc7bac6edf5d85fa3f35d">5f6f311</a>), closes <a href="https://github-redirect.dependabot.com/actions/stale/issues/466">#466</a></li> <li><strong>label comparison</strong>: make label comparison case insensitive <a href="https://github-redirect.dependabot.com/actions/stale/pull/517">#517</a>, closes <a href="https://github-redirect.dependabot.com/actions/stale/pull/516">#516</a></li> <li><strong>filtering comments by actor could have strange behavior</strong>: "stale" comments are now detected based on if the message is the stale message not <em>who</em> made the comment(<a href="https://github-redirect.dependabot.com/actions/stale/pull/519">#519</a>), fixes <a href="https://github-redirect.dependabot.com/actions/stale/pull/441">#441</a>, <a href="https://github-redirect.dependabot.com/actions/stale/pull/509">#509</a>, <a href="https://github-redirect.dependabot.com/actions/stale/pull/518">#518</a></li> </ul> <h3>Breaking Changes</h3> <ul> <li>The options <code>skip-stale-issue-message</code> and <code>skip-stale-pr-message</code> were removed. Instead, setting the options <code>stale-issue-message</code> and <code>stale-pr-message</code> will be enough to let the stale workflow add a comment. If the options are unset, a comment will not be added which was the equivalent of setting <code>skip-stale-issue-message</code> to <code>true</code>.</li> <li>The <code>operations-per-run</code> option will be more effective. After migrating, you could face a failed-fast process workflow if you let the default value (30) or set it to a small number. In that case, you will see a warning at the end of the logs (if enabled) indicating that the workflow was stopped sooner to avoid consuming too much API calls. In most cases, you can just increase this limit to make sure to process everything in a single run.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/stale/commit/cdf15f641adb27a71842045a94023bef6945e3aa"><code>cdf15f6</code></a> Prep for v4 (<a href="https://github-redirect.dependabot.com/actions/stale/issues/510">#510</a>)</li> <li><a href="https://github.com/actions/stale/commit/a78d0b721efa37c9728b061243233a58c7490ca5"><code>a78d0b7</code></a> Make label comparison case insensitive (<a href="https://github-redirect.dependabot.com/actions/stale/issues/517">#517</a>)</li> <li><a href="https://github.com/actions/stale/commit/d901397e11003589e1757a92b7312613c7f2bd9b"><code>d901397</code></a> Filter comments by content instead of actor (<a href="https://github-redirect.dependabot.com/actions/stale/issues/519">#519</a>)</li> <li><a href="https://github.com/actions/stale/commit/678bfc7a5922eeb440317b84cc7d119dd4504244"><code>678bfc7</code></a> docs(readme): update the permissions docs to reflect the requirements of the ...</li> <li><a href="https://github.com/actions/stale/commit/d3bfc506854e1df749b4398adcd2834777b4cbf8"><code>d3bfc50</code></a> Revert "feat(options): add new options to avoid stale base on comments (<a href="https://github-redirect.dependabot.com/actions/stale/issues/494">#494</a>)...</li> <li><a href="https://github.com/actions/stale/commit/f2ae27a59bdc3a9fea7d54e66289c5929a52d21d"><code>f2ae27a</code></a> build(deps-dev): bump <code>@​typescript-eslint/parser</code> from 4.22.1 to 4.26.1 (<a href="https://github-redirect.dependabot.com/actions/stale/issues/496">#496</a>)</li> <li><a href="https://github.com/actions/stale/commit/4d1e45b7968abe0bdc23e764f1308022560ff04d"><code>4d1e45b</code></a> build(deps-dev): bump typescript from 4.2.4 to 4.3.2 (<a href="https://github-redirect.dependabot.com/actions/stale/issues/490">#490</a>)</li> <li><a href="https://github.com/actions/stale/commit/92d4fc69d8b9218539d1a930c56a619f1f5da09d"><code>92d4fc6</code></a> 📝 Add requested permissions (<a href="https://github-redirect.dependabot.com/actions/stale/issues/492">#492</a>)</li> <li><a href="https://github.com/actions/stale/commit/1efddcbe9ff0497885b9746a8ea5fa0314286053"><code>1efddcb</code></a> feat(options): add new options to avoid stale base on comments (<a href="https://github-redirect.dependabot.com/actions/stale/issues/494">#494</a>)</li> <li><a href="https://github.com/actions/stale/commit/f1017f33dd159ea51366375120c3e6981d7c3097"><code>f1017f3</code></a> fix(dry-run): forbid mutations in dry-run (<a href="https://github-redirect.dependabot.com/actions/stale/issues/500">#500</a>)</li> <li>Additional commits viewable in <a href="https://github.com/actions/stale/compare/v3...v4">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

+1 -1

2 comments

1 changed file

dependabot[bot]

pr closed time in 4 days

PullRequestReviewEvent

Pull request review commentOCA/interface-github

14.0 mig GitHub connector odoo

+# Copyright (C) 2016-Today: Odoo Community Association (OCA)+# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).++import logging+import os+from os.path import join as opj

These imports are redundant, and both opj() and os.path.join() are used here. Maybe this could be unified?

OpenCode

comment created time in 8 days

Pull request review commentOCA/interface-github

14.0 mig GitHub connector odoo

+# Copyright 2020 Tecnativa - Pedro M. Baeza

This file would be removed, according to the migration guidelines: https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-14.0#tasks-to-do-in-the-migration

OpenCode

comment created time in 8 days

Pull request review commentOCA/interface-github

14.0 mig GitHub connector odoo

+# Copyright (C) 2016-Today: Odoo Community Association (OCA)+# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).++import base64+import logging+import os++from docutils.core import publish_string++from odoo import _, api, fields, models, tools+from odoo.tools import html_sanitize+from odoo.tools.safe_eval import safe_eval++from odoo.addons.base.models.ir_module import MyWriter++_logger = logging.getLogger(__name__)+++class OdooModuleVersion(models.Model):+    _name = "odoo.module.version"+    _description = "Odoo Module Version"+    _order = "name, technical_name"++    _ICON_PATH = [+        "static/src/img/",+        "static/description/",+    ]++    # Constant Section+    _SETTING_OVERRIDES = {+        "embed_stylesheet": False,+        "doctitle_xform": False,+        "output_encoding": "unicode",+        "xml_declaration": False,+        "file_insertion_enabled": False,+        "raw_enabled": False,+    }++    _ODOO_TYPE_SELECTION = [+        ("verticalization", "Vertical Solutions"),+        ("localization", "Localization"),+        ("connector", "Connector"),+        ("other", "Other"),+    ]++    # Column Section+    name = fields.Char(string="Name", readonly=True, index=True)++    technical_name = fields.Char(+        string="Technical Name",+        readonly=True,+        index=True,+        help="Technical Name of the Module (Folder name).",+    )++    complete_name = fields.Char(+        string="Complete Name", compute="_compute_complete_name", store=True+    )++    auto_install = fields.Boolean(string="Auto Install", readonly=True)++    icon = fields.Char(string="Icon Path (Manifest)", readonly=True)++    module_id = fields.Many2one(+        comodel_name="odoo.module",+        string="Module",+        required=True,+        ondelete="cascade",+        index=True,+        auto_join=True,+        readonly=True,+    )++    repository_branch_id = fields.Many2one(+        comodel_name="github.repository.branch",+        string="Repository Branch",+        readonly=True,+        required=True,+        ondelete="cascade",+    )++    repository_id = fields.Many2one(+        comodel_name="github.repository",+        string="Repository",+        readonly=True,+        related="repository_branch_id.repository_id",+        store=True,+    )++    organization_serie_id = fields.Many2one(+        comodel_name="github.organization.serie",+        string="Organization Serie",+        readonly=True,+        store=True,+        compute="_compute_organization_serie_id",+    )++    license = fields.Char(string="License (Manifest)", readonly=True)++    license_id = fields.Many2one(+        comodel_name="odoo.license",+        string="License",+        readonly=True,+        compute="_compute_license_id",+        store=True,+    )++    summary = fields.Char(string="Summary (Manifest)", readonly=True)++    depends = fields.Char(string="Dependencies (Manifest)", readonly=True)++    dependency_module_ids = fields.Many2many(+        comodel_name="odoo.module",+        string="Dependencies",+        relation="module_version_dependency_rel",+        column1="module_version_id",+        column2="dependency_module_id",+        store=True,+        compute="_compute_dependency_module_ids",+    )++    website = fields.Char(string="Website (Manifest)", readonly=True)++    external_dependencies = fields.Char(+        string="External Dependencies (Manifest)", readonly=True+    )++    description_rst = fields.Char(string="RST Description (Manifest)", readonly=True)++    description_rst_html = fields.Html(+        string="HTML the RST Description",+        readonly=True,+        compute="_compute_description_rst_html",+        store=True,+    )++    version = fields.Char(string="Version (Manifest)", readonly=True)++    author = fields.Char(string="Author (Manifest)", readonly=True)++    author_ids = fields.Many2many(+        string="Authors",+        comodel_name="odoo.author",+        relation="github_module_version_author_rel",+        column1="module_version_id",+        column2="author_id",+        multi="author",+        compute="_compute_author",+        store=True,+    )++    author_ids_description = fields.Char(+        string="Authors (Text)", compute="_compute_author", multi="author", store=True+    )++    lib_python_ids = fields.Many2many(+        comodel_name="odoo.lib.python",+        string="Python Lib Dependencies",+        relation="module_version_lib_python_rel",+        column1="module_version_id",+        column2="lib_python_id",+        multi="lib",+        compute="_compute_lib",+        store=True,+    )++    lib_python_ids_description = fields.Char(+        string="Python Lib Dependencies (Text)",+        compute="_compute_lib",+        multi="lib",+        store=True,+    )++    lib_bin_ids = fields.Many2many(+        comodel_name="odoo.lib.bin",+        string="Bin Lib Dependencies",+        relation="module_version_lib_bin_rel",+        column1="module_version_id",+        column2="lib_bin_id",+        multi="lib",+        compute="_compute_lib",+        store=True,+    )++    lib_bin_ids_description = fields.Char(+        string="Bin Lib Dependencies (Text)",+        compute="_compute_lib",+        multi="lib",+        store=True,+    )++    odoo_type = fields.Selection(+        string="Odoo Type",+        selection=_ODOO_TYPE_SELECTION,+        store=True,+        compute="_compute_odoo_type",+    )++    image = fields.Binary(string="Icon Image", readonly=True, attachment=True)++    github_url = fields.Char(+        string="Github URL", compute="_compute_github_url", store=True, readonly=True+    )++    category_id = fields.Many2one(+        comodel_name="odoo.category", string="Category", readonly=True+    )++    full_module_path = fields.Char(+        string="Full Local Path to the module",+    )++    # Overload Section+    def unlink(self):+        # Analyzed repository branches should be reanalyzed+        if not self._context.get("dont_change_repository_branch_state", False):+            repository_branch_obj = self.env["github.repository.branch"]+            repository_branch_obj.search(+                [+                    ("id", "in", self.mapped("repository_branch_id").ids),+                    ("state", "=", "analyzed"),+                ]+            ).write({"state": "to_analyze"})+        return super(OdooModuleVersion, self).unlink()++    # Compute Section+    @api.depends(+        "repository_id.organization_id.github_name",+        "repository_id.name",+        "repository_branch_id.name",+        "repository_branch_id.local_path",+        "full_module_path",+    )+    def _compute_github_url(self):+        for version in self:+            repo_id = version.repository_id+            version.github_url = (+                "https://github.com/{organization_name}/"+                "{repository_name}/tree/{branch_name}/{rest_path}".format(+                    organization_name=repo_id.organization_id.github_name,+                    repository_name=repo_id.name,+                    branch_name=version.repository_branch_id.name,+                    rest_path=(version.full_module_path or "")[+                        len(version.repository_branch_id.local_path or "") + 1 :+                    ],+                )+            )++    @api.depends("repository_branch_id.repository_id.name")+    def _compute_odoo_type(self):+        for version in self:+            repository_name = version.repository_branch_id.repository_id.name+            if repository_name.startswith("l10n-"):+                version.odoo_type = "localization"+            elif repository_name.startswith("connector-"):+                version.odoo_type = "connector"+            elif repository_name.startswith("vertical-"):+                version.odoo_type = "verticalization"+            else:+                version.odoo_type = "other"++    @api.depends("technical_name", "repository_branch_id.complete_name")+    def _compute_complete_name(self):+        for version in self:+            version.complete_name = (+                version.repository_branch_id.complete_name+                + "/"+                + version.technical_name+            )++    @api.depends("description_rst")+    def _compute_description_rst_html(self):+        for version in self:+            if version.description_rst:+                try:+                    output = publish_string(+                        source=version.description_rst,+                        settings_overrides=self._SETTING_OVERRIDES,+                        writer=MyWriter(),+                    )+                except Exception:+                    output = (+                        "<h1 style='color:red;'>"+                        + _("Incorrect RST Description")+                        + "</h1>"+                    )+            else:+                output = html_sanitize(+                    "<h1 style='color:gray;'>" + _("No Version Found") + "</h1>"+                )+            version.description_rst_html = html_sanitize(output)++    @api.depends("depends")+    def _compute_dependency_module_ids(self):+        module_obj = self.env["odoo.module"]+        for version in self:+            modules = []+            for module_name in version.depends.split(","):

When testing, if I try to create a version manually, I get this error:

AttributeError: 'bool' object has no attribute 'split'

Are you meant to do this manually? If not, can a new error message be displayed to avoid hitting the error?

OpenCode

comment created time in 8 days

Pull request review commentOCA/interface-github

14.0 mig GitHub connector odoo

+* Once installed, go to your organization, and set extra settings:++1. The name of your organization in the author keys of the manifest odoo+   modules
1. The name of your organization in the author keys of the manifest odoo
   modules (in the **Default Author Text** field)
OpenCode

comment created time in 8 days

Pull request review commentOCA/interface-github

14.0 mig GitHub connector odoo

+# Copyright (C) 2016-Today: Odoo Community Association (OCA)+# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).++import base64+import logging+import os++from docutils.core import publish_string++from odoo import _, api, fields, models, tools+from odoo.tools import html_sanitize+from odoo.tools.safe_eval import safe_eval++from odoo.addons.base.models.ir_module import MyWriter++_logger = logging.getLogger(__name__)+++class OdooModuleVersion(models.Model):+    _name = "odoo.module.version"+    _description = "Odoo Module Version"+    _order = "name, technical_name"++    _ICON_PATH = [+        "static/src/img/",+        "static/description/",+    ]++    # Constant Section+    _SETTING_OVERRIDES = {+        "embed_stylesheet": False,+        "doctitle_xform": False,+        "output_encoding": "unicode",+        "xml_declaration": False,+        "file_insertion_enabled": False,+        "raw_enabled": False,+    }++    _ODOO_TYPE_SELECTION = [+        ("verticalization", "Vertical Solutions"),+        ("localization", "Localization"),+        ("connector", "Connector"),+        ("other", "Other"),+    ]++    # Column Section+    name = fields.Char(string="Name", readonly=True, index=True)++    technical_name = fields.Char(+        string="Technical Name",+        readonly=True,+        index=True,+        help="Technical Name of the Module (Folder name).",+    )++    complete_name = fields.Char(+        string="Complete Name", compute="_compute_complete_name", store=True+    )++    auto_install = fields.Boolean(string="Auto Install", readonly=True)++    icon = fields.Char(string="Icon Path (Manifest)", readonly=True)++    module_id = fields.Many2one(+        comodel_name="odoo.module",+        string="Module",+        required=True,+        ondelete="cascade",+        index=True,+        auto_join=True,+        readonly=True,+    )++    repository_branch_id = fields.Many2one(+        comodel_name="github.repository.branch",+        string="Repository Branch",+        readonly=True,+        required=True,+        ondelete="cascade",+    )++    repository_id = fields.Many2one(+        comodel_name="github.repository",+        string="Repository",+        readonly=True,+        related="repository_branch_id.repository_id",+        store=True,+    )++    organization_serie_id = fields.Many2one(+        comodel_name="github.organization.serie",+        string="Organization Serie",+        readonly=True,+        store=True,+        compute="_compute_organization_serie_id",+    )++    license = fields.Char(string="License (Manifest)", readonly=True)++    license_id = fields.Many2one(+        comodel_name="odoo.license",+        string="License",+        readonly=True,+        compute="_compute_license_id",+        store=True,+    )++    summary = fields.Char(string="Summary (Manifest)", readonly=True)++    depends = fields.Char(string="Dependencies (Manifest)", readonly=True)++    dependency_module_ids = fields.Many2many(+        comodel_name="odoo.module",+        string="Dependencies",+        relation="module_version_dependency_rel",+        column1="module_version_id",+        column2="dependency_module_id",+        store=True,+        compute="_compute_dependency_module_ids",+    )++    website = fields.Char(string="Website (Manifest)", readonly=True)++    external_dependencies = fields.Char(+        string="External Dependencies (Manifest)", readonly=True+    )++    description_rst = fields.Char(string="RST Description (Manifest)", readonly=True)++    description_rst_html = fields.Html(+        string="HTML the RST Description",+        readonly=True,+        compute="_compute_description_rst_html",+        store=True,+    )++    version = fields.Char(string="Version (Manifest)", readonly=True)++    author = fields.Char(string="Author (Manifest)", readonly=True)++    author_ids = fields.Many2many(+        string="Authors",+        comodel_name="odoo.author",+        relation="github_module_version_author_rel",+        column1="module_version_id",+        column2="author_id",+        multi="author",+        compute="_compute_author",+        store=True,+    )++    author_ids_description = fields.Char(+        string="Authors (Text)", compute="_compute_author", multi="author", store=True+    )++    lib_python_ids = fields.Many2many(+        comodel_name="odoo.lib.python",+        string="Python Lib Dependencies",+        relation="module_version_lib_python_rel",+        column1="module_version_id",+        column2="lib_python_id",+        multi="lib",+        compute="_compute_lib",+        store=True,+    )++    lib_python_ids_description = fields.Char(+        string="Python Lib Dependencies (Text)",+        compute="_compute_lib",+        multi="lib",+        store=True,+    )++    lib_bin_ids = fields.Many2many(+        comodel_name="odoo.lib.bin",+        string="Bin Lib Dependencies",+        relation="module_version_lib_bin_rel",+        column1="module_version_id",+        column2="lib_bin_id",+        multi="lib",+        compute="_compute_lib",+        store=True,+    )++    lib_bin_ids_description = fields.Char(+        string="Bin Lib Dependencies (Text)",+        compute="_compute_lib",+        multi="lib",+        store=True,+    )++    odoo_type = fields.Selection(+        string="Odoo Type",+        selection=_ODOO_TYPE_SELECTION,+        store=True,+        compute="_compute_odoo_type",+    )++    image = fields.Binary(string="Icon Image", readonly=True, attachment=True)++    github_url = fields.Char(+        string="Github URL", compute="_compute_github_url", store=True, readonly=True+    )++    category_id = fields.Many2one(+        comodel_name="odoo.category", string="Category", readonly=True+    )++    full_module_path = fields.Char(+        string="Full Local Path to the module",+    )++    # Overload Section+    def unlink(self):+        # Analyzed repository branches should be reanalyzed+        if not self._context.get("dont_change_repository_branch_state", False):+            repository_branch_obj = self.env["github.repository.branch"]+            repository_branch_obj.search(+                [+                    ("id", "in", self.mapped("repository_branch_id").ids),+                    ("state", "=", "analyzed"),+                ]+            ).write({"state": "to_analyze"})+        return super(OdooModuleVersion, self).unlink()
        return super().unlink()
OpenCode

comment created time in 8 days