Skip to content

Commit

Permalink
Merge pull request #313 from itpp-labs/17.0
Browse files Browse the repository at this point in the history
Syncing from upstream itpp-labs/sync-addons (17.0)
  • Loading branch information
bt-admin authored Feb 28, 2025
2 parents 2ab02dc + 13636ae commit 1126350
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .DINAR/build-date.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Odoo 17 build with new deps
Fresh Odoo 17 build
3 changes: 2 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
env:
browser: true
es6: true

# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
parserOptions:
ecmaVersion: 2017
ecmaVersion: 2022
sourceType: module

# Globals available in Odoo that shouldn't produce errorings
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repos:
args:
- --plugin=@prettier/plugin-xml
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v7.32.0
rev: v8.24.0
hooks:
- id: eslint
verbose: true
Expand Down
22 changes: 19 additions & 3 deletions partner_telegram/static/src/js/telegram_widget.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
/** @odoo-module **/
/** Copyright 2024 Ivan Yelizariev <https://twitter.com/yelizariev> **/
/** Copyright 2024-2025 Ivan Yelizariev <https://twitter.com/yelizariev> **/

import { EmailField } from "@web/views/fields/email/email_field";
import { _t } from "@web/core/l10n/translation";
import { registry } from "@web/core/registry";

class TelegramField extends EmailField {}

TelegramField.template = "partner_contact.TelegramField";

export const telegramField = {
component: TelegramField,
displayName: _t("Telegram"),
supportedTypes: ["char"],
extractProps: ({ attrs }) => ({
placeholder: attrs.placeholder,
}),
};

registry.category("fields").add("telegram", telegramField);

class FormTelegramField extends TelegramField {}
FormTelegramField.template = "partner_contact.FormTelegramField";

registry.category("fields").add("telegram", TelegramField);
registry.category("fields").add("form.telegram", FormTelegramField);
export const formTelegramField = {
...telegramField,
component: FormTelegramField,
};

registry.category("fields").add("form.telegram", formTelegramField);
4 changes: 2 additions & 2 deletions partner_telegram/static/src/xml/telegram_widget.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2024 Ivan Yelizariev <https://twitter.com/yelizariev>
<!-- Copyright 2024-2025 Ivan Yelizariev <https://twitter.com/yelizariev>
License MIT (https://opensource.org/licenses/MIT). -->
<templates xml:space="preserve">
<t t-name="partner_contact.TelegramField" owl="1">
Expand Down Expand Up @@ -34,7 +34,7 @@
>
<xpath expr="//input" position="after">
<a
t-if="props.value"
t-if="props.record.data[props.name]"
t-att-href="props.record.data.telegram_url"
class="ms-3 d-inline-flex align-items-center"
>
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
markdown
pyyaml

0 comments on commit 1126350

Please sign in to comment.