Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions viin_brand/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,35 @@
from . import apriori
from . import controllers


def replace_odoo_branding_in_mail_templates(env):
"""Replace Odoo branding in all mail.template body_html and subject (jsonb) via raw SQL.

ORM write on Html fields with translate=True doesn't reliably replace
link text inside sanitized HTML. Raw SQL on jsonb::text bypasses this.

This function is idempotent — safe to call from multiple post_init_hooks.
The last branding module to install catches all remaining templates.
"""
# Order matters: specific patterns first, generic catch-all last.
replacements = [
('https://www.odoo.com/page/tour', 'https://viindoo.com/page/viindoo-solution'),
('https://www.odoo.com', 'https://viindoo.com'),
('http://yourcompany.odoo.com', 'http://yourcompany.viindoo.com'),
('>Odoo Tour</a>', '>Viindoo Tour</a>'),
('>Odoo</a>', '>Viindoo</a>'),
('alt="Odoo"', 'alt="Viindoo"'),
# Generic catch-all (must be last)
('Odoo', 'Viindoo'),
]
for old, new in replacements:
env.cr.execute(
"UPDATE mail_template SET body_html = REPLACE(body_html::text, %s, %s)::jsonb"
" WHERE body_html::text LIKE %s",
(old, new, f'%{old}%'),
)
# Also replace in subject field
env.cr.execute(
"UPDATE mail_template SET subject = REPLACE(subject::text, 'Odoo', 'Viindoo')::jsonb"
" WHERE subject::text LIKE '%%Odoo%%'",
)
6 changes: 3 additions & 3 deletions viin_brand/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
'name_vi_VN': "Ứng dụng với thương hiệu Viindoo",

'summary': """
Set Viindoo Brandings for Odoo app.
Set Viindoo Brandings.
""",

'summary_vi_VN': """
Thiết lập thương hiệu Viindoo cho ứng dụng Odoo
Thiết lập thương hiệu Viindoo.
""",

'description': """
Expand Down Expand Up @@ -38,7 +38,7 @@
'category': 'Hidden',
'version': '0.1',
'depends': ['base'],
'installable': False,
'installable': True,
'auto_install': True,
'price': 9.9,
'currency': 'EUR',
Expand Down
25 changes: 12 additions & 13 deletions viin_brand/apriori.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# modules_website is a mapping from old module website to new module website by to_base
from markupsafe import Markup
modules_website = {
# odoo
'account': 'https://viindoo.com/intro/invoicing',
Expand Down Expand Up @@ -40,18 +39,18 @@
}


# mail_template_terms is a mapping from old term to new term in email template by to_base
# mail_template_terms is a mapping from old term to new term in email template.
# Used by viin_brand_mail's _render_field override to replace branding at render time.
# Order matters: specific patterns first, generic catch-all last.
mail_template_terms = [
(Markup('https://www.odoo.com?utm_source=db&amp;utm_medium=portalinvite" style="color: #875A7B;">Odoo</a>'), Markup('<a target="_blank" href="https://viindoo.com?utm_source=db&amp;utm_medium=portalinvite" style="color: #7f4282;">Viindoo</a>')),
(Markup('<a target="_blank" href="https://www.odoo.com?utm_source=db&amp;utm_medium=gamification" style="color: #875A7B;">Odoo</a>'), Markup('<a target="_blank" href="https://viindoo.com?utm_source=db&amp;utm_medium=gamification" style="color: #7f4282;">Viindoo</a>')),
(Markup('<a target="_blank" href="https://www.odoo.com?utm_source=db&amp;utm_medium=email" style="color: #875A7B;">Odoo</a>'), Markup('<a target="_blank" href="https://viindoo.com?utm_source=db&amp;utm_medium=email" style="color: #7f4282;">Viindoo</a>')),
(Markup('<a target="_blank" href="https://www.odoo.com?utm_source=db&amp;utm_medium=auth" style="color: #875A7B;">Odoo</a>'), Markup('<a target="_blank" href="https://viindoo.com?utm_source=db&amp;utm_medium=auth" style="color: #7f4282;">Viindoo</a>')),
(Markup('<a target="_blank" href="https://www.odoo.com?utm_source=db&amp;utm_medium=website" style="color: #875A7B;">Odoo</a>'), Markup('<a target="_blank" href="https://viindoo.com?utm_source=db&amp;utm_medium=website" style="color: #7f4282;">Viindoo</a>')),
(Markup('<a target="_blank" href="https://www.odoo.com?utm_source=db&amp;utm_medium=forum" style="color: #875A7B;">Odoo</a>'), Markup('<a target="_blank" href="https://viindoo.com?utm_source=db&amp;utm_medium=forum" style="color: #7f4282;">Viindoo</a>')),
(Markup('<a href="https://www.odoo.com/page/tour?utm_source=db&amp;utm_medium=auth" style="color: #875A7B;">Odoo Tour</a>'), Markup('<a href="https://viindoo.com/page/viindoo-solution?utm_source=db&amp;utm_medium=auth" style="color: #7f4282;">Viindoo Tour</a>')),
(Markup('<a target="_blank" href="https://www.odoo.com">Odoo</a>'), Markup('<a target="_blank" href="https://www.viindoo.com">Viindoo</a>')),
(Markup('<a target="_blank" href="https://www.odoo.com" style="color: #875A7B;">Odoo</a>'), Markup('<a target="_blank" href="https://www.viindoo.com" style="color: #7f4282;">Viindoo</a>')),
(Markup('<a target="_blank" href="https://www.odoo.com" style="text-decoration:none;background-color:transparent;color:#875A7B;">Odoo</a>'), Markup('<a target="_blank" href="https://www.viindoo.com" style="text-decoration:none;background-color:transparent;color:#875A7B;">Viindoo</a>')),
(Markup('<a href="https://www.odoo.com?utm_source=db&amp;utm_medium=auth" target="_blank">Powered by <span>Odoo</span></a>'), Markup('<a href="https://viindoo.com?utm_source=db&amp;utm_medium=auth" target="_blank">Powered by <span>Viindoo</span></a>')),
# URL replacements (must come before text replacements)
('https://www.odoo.com/page/tour', 'https://viindoo.com/page/viindoo-solution'),
('https://www.odoo.com', 'https://viindoo.com'),
('http://yourcompany.odoo.com', 'http://yourcompany.viindoo.com'),
# Specific text replacements
('>Odoo Tour</a>', '>Viindoo Tour</a>'),
('>Odoo</a>', '>Viindoo</a>'),
('alt="Odoo"', 'alt="Viindoo"'),
# Generic catch-all (must be last)
('Odoo', 'Viindoo'),
]
2 changes: 1 addition & 1 deletion viin_brand/controllers/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class Database(DB):

def _render_template(self, **d):
res = super(Database, self)._render_template()
res = super()._render_template(**d)
if res:
res = res.replace('Odoo', 'Viindoo') \
.replace('https://www.odoo.com/privacy', 'https://viindoo.com/policy/privacy-policy') \
Expand Down
Binary file added viin_brand/static/img/viin_assistant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion viin_brand_account/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
'views/report_statement.xml',
'views/terms_template.xml',
],
'installable': False,
'installable': True,
'auto_install': True,
'price': 0.0,
'currency': 'EUR',
Expand Down
87 changes: 47 additions & 40 deletions viin_brand_account/i18n/vi_VN.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 17.0\n"
"Project-Id-Version: Odoo Server 19.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-25 09:30+0000\n"
"PO-Revision-Date: 2024-07-25 09:30+0000\n"
"POT-Creation-Date: 2026-04-03 08:59+0000\n"
"PO-Revision-Date: 2026-04-03 08:59+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -43,14 +43,37 @@ msgstr ""
"Văn bản bên dưới đóng vai trò gợi ý và không liên quan đến trách nhiệm của "
"Viindoo."

#. module: viin_brand_account
#: model:ir.model.fields,field_description:viin_brand_account.field_account_journal__invoice_reference_model
msgid "Communication Standard"
msgstr "Tiêu chuẩn nội dung"

#. module: viin_brand_account
#: model:ir.model.fields,help:viin_brand_account.field_account_financial_year_op__opening_date
msgid ""
"Date from which the accounting is managed in Viindoo. It is the date of the "
"opening entry."
msgstr ""
"Ngày kể từ khi kế toán được quản lý bởi Viindoo. Nó là ngày của bút toán đầu "
"kì."
"Ngày kể từ khi kế toán được quản lý bởi Viindoo. Nó là ngày của bút toán đầu"
" kì."

#. module: viin_brand_account
#: model:ir.model.fields,field_description:viin_brand_account.field_account_financial_year_op__display_name
#: model:ir.model.fields,field_description:viin_brand_account.field_account_journal__display_name
#: model:ir.model.fields,field_description:viin_brand_account.field_account_move__display_name
#: model:ir.model.fields,field_description:viin_brand_account.field_account_payment__display_name
#: model:ir.model.fields,field_description:viin_brand_account.field_account_payment_register__display_name
msgid "Display Name"
msgstr "Tên hiển thị"

#. module: viin_brand_account
#: model:ir.model.fields,field_description:viin_brand_account.field_account_financial_year_op__id
#: model:ir.model.fields,field_description:viin_brand_account.field_account_journal__id
#: model:ir.model.fields,field_description:viin_brand_account.field_account_move__id
#: model:ir.model.fields,field_description:viin_brand_account.field_account_payment__id
#: model:ir.model.fields,field_description:viin_brand_account.field_account_payment_register__id
msgid "ID"
msgstr ""

#. module: viin_brand_account
#: model_terms:ir.ui.view,arch_db:viin_brand_account.view_move_form
Expand All @@ -75,12 +98,12 @@ msgstr "Sổ nhật ký"
#. module: viin_brand_account
#: model:ir.model,name:viin_brand_account.model_account_move
msgid "Journal Entry"
msgstr "Bút toán sổ nhật ký"
msgstr "Bút toán"

#. module: viin_brand_account
#: model:ir.model.fields,help:viin_brand_account.field_account_journal__inbound_payment_method_line_ids
msgid ""
"Manual: Get paid by any method outside of Viindoo.\n"
"Manual: Get paid by any method outside of the system.\n"
"Payment Providers: Each payment provider has its own Payment Method. Request a transaction on/to a card thanks to a payment token saved by the partner when buying or subscribing online.\n"
"Batch Deposit: Collect several customer checks at once generating and submitting a batch deposit to your bank. Module account_batch_payment is necessary.\n"
"SEPA Direct Debit: Get paid in the SEPA zone thanks to a mandate your partner will have granted to you. Module account_sepa is necessary.\n"
Expand All @@ -93,8 +116,8 @@ msgstr ""
#. module: viin_brand_account
#: model:ir.model.fields,help:viin_brand_account.field_account_journal__outbound_payment_method_line_ids
msgid ""
"Manual: Pay by any method outside of Viindoo.\n"
"Check: Pay bills by check and print it from Viindoo.\n"
"Manual: Pay by any method outside of the system.\n"
"Check: Pay bills by check and print it from the system.\n"
"SEPA Credit Transfer: Pay in the SEPA zone by submitting a SEPA Credit Transfer file to your bank. Module account_sepa is necessary.\n"
msgstr ""
"Hướng dẫn: Thanh toán bằng bất kỳ phương thức nào ngoài Viindoo.\n"
Expand Down Expand Up @@ -134,6 +157,11 @@ msgstr "Ngày Đầu kỳ"
msgid "Outbound Payment Methods"
msgstr "Phương thức thanh toán đi"

#. module: viin_brand_account
#: model:ir.model,name:viin_brand_account.model_account_payment_register
msgid "Pay"
msgstr "Ghi nhận thanh toán"

#. module: viin_brand_account
#: model:ir.model.fields,field_description:viin_brand_account.field_account_payment__payment_method_line_id
#: model:ir.model.fields,field_description:viin_brand_account.field_account_payment_register__payment_method_line_id
Expand All @@ -145,19 +173,14 @@ msgstr "Phương thức thanh toán"
msgid "Payments"
msgstr "Thanh toán"

#. module: viin_brand_account
#: model:ir.model,name:viin_brand_account.model_account_payment_register
msgid "Register Payment"
msgstr "Ghi nhận thanh toán"

#. module: viin_brand_account
#: model:ir.model.fields,help:viin_brand_account.field_account_journal__alias_id
msgid ""
"Send one separate email for each invoice.\n"
"\n"
"Any file extension will be accepted.\n"
"\n"
"Only PDF and XML files will be interpreted by Viindoo"
"Only PDF and XML files will be interpreted by the system"
msgstr ""
"Gửi một email riêng cho mỗi hóa đơn.\n"
"\n"
Expand All @@ -168,25 +191,27 @@ msgstr ""
#. module: viin_brand_account
#: model:ir.model.fields,field_description:viin_brand_account.field_account_bank_statement_line__quick_edit_total_amount
#: model:ir.model.fields,field_description:viin_brand_account.field_account_move__quick_edit_total_amount
#: model:ir.model.fields,field_description:viin_brand_account.field_account_payment__quick_edit_total_amount
msgid "Total (Tax inc.)"
msgstr "Tổng cộng (Kèm thuế)"

#. module: viin_brand_account
#: model:ir.model.fields,help:viin_brand_account.field_account_bank_statement_line__quick_edit_total_amount
#: model:ir.model.fields,help:viin_brand_account.field_account_move__quick_edit_total_amount
#: model:ir.model.fields,help:viin_brand_account.field_account_payment__quick_edit_total_amount
msgid ""
"Use this field to encode the total amount of the invoice.\n"
"System will automatically create one invoice line with default values to match it."
msgstr ""
"Sử dụng trường này để mã hóa tổng số tiền của hóa đơn."
"Hệ thống sẽ tự động tạo một dòng hóa đơn với các giá trị mặc định để phù hợp với nó."
"Sử dụng trường này để mã hóa tổng số tiền của hóa đơn.Hệ thống sẽ tự động "
"tạo một dòng hóa đơn với các giá trị mặc định để phù hợp với nó."

#. module: viin_brand_account
#: model_terms:ir.ui.view,arch_db:viin_brand_account.account_tour_upload_bill
msgid "With Viindoo, you won't have to record bills manually"
msgstr "Với Viindoo, bạn sẽ không phải ghi lại các hóa đơn bằng cách thủ công."
#: model:ir.model.fields,help:viin_brand_account.field_account_journal__invoice_reference_model
msgid ""
"You can choose different models for each type of reference. The default one "
"is the system reference."
msgstr ""
"Bạn có thể chọn các mẫu khác nhau cho từng loại nội dung. Loại mặc định là "
"mẫu của hệ thống."

#. module: viin_brand_account
#: model_terms:ir.ui.view,arch_db:viin_brand_account.view_move_form
Expand All @@ -197,21 +222,3 @@ msgstr "kích hoạt đơn vị tiền tệ của hóa đơn"
#: model_terms:ir.ui.view,arch_db:viin_brand_account.view_move_form
msgid "activate the currency of the invoice"
msgstr "kích hoạt đơn vị tiền tệ của hóa đơn"
#. module: account
#: model_terms:ir.actions.act_window,help:account.action_bank_statement_tree
msgid ""
"Viindoo allows you to reconcile a statement line directly with\n"
" the related sale or purchase invoices."
msgstr ""
"Hệ thống Viindoo cho phép bạn đối soát dòng sao kê trực tiếp với các\n"
" hóa đơn mua hoặc bán hàng liên quan."

#. module: account
#: model_terms:ir.actions.act_window,help:account.res_partner_action_customer
msgid "Viindoo helps you easily track all activities related to a customer."
msgstr "Viindoo giúp bạn dễ dàng theo dõi mọi hoạt động liên quan đến một khách hàng."

#. module: account
#: model_terms:ir.actions.act_window,help:account.res_partner_action_supplier
msgid "Viindoo helps you easily track all activities related to a supplier."
msgstr "Viindoo giúp bạn dễ dàng theo dõi mọi hoạt động liên quan đến nhà cung cấp."
Loading