add cenhomes addons

This commit is contained in:
2025-03-04 16:53:07 +07:00
parent 081505ce33
commit 4b8cd12232
144 changed files with 19868 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import models
+37
View File
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
{
'name': "crm test",
'summary': """
crm test""",
'description': """
""",
'author': "Cenhomes",
'website': "https://www.cenhomes.vn",
# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/16.0/odoo/addons/base/data/ir_module_category_data.xml
# for the full list
'category': 'Uncategorized',
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['base', 'web', 'crm'],
# always loaded
'data': [
# 'views/a.xml',
],
'assets': {
'web.assets_common': [
],
'web.assets_backend': [
'custom_crm/static/src/components/**/*',
'custom_crm/static/src/xml/**/*',
'custom_crm/static/src/views/**/*',
],
},
}
+3
View File
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import models
+5
View File
@@ -0,0 +1,5 @@
from odoo import models
class CrmLeadCustomTien(models.Model):
_inherit = "crm.lead"
@@ -0,0 +1,10 @@
/** @odoo-module **/
import {CalendarCommonRenderer} from "@web/views/calendar/calendar_common/calendar_common_renderer";
import {CalendarCommonPopover} from "@web/views/calendar/calendar_common/calendar_common_popover";
CalendarCommonRenderer.components = {
Popover: CalendarCommonPopover,
};
CalendarCommonRenderer.template = "web.CalendarCommonRenderer";
CalendarCommonRenderer.eventTemplate = "web.CalendarCommonRenderer.event_custom";
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-name="web.CalendarCommonRenderer.event_custom" t-inherit="web.CalendarCommonRenderer.event" t-inherit-mode="primary">
<xpath expr="//div[@class='o_event_title']" position="replace">
<div style="">
<div class="o_event_title" t-esc="title"/>
<div class="o_event_title" t-esc="rawRecord.expected_revenue"/>
<div class="o_event_title" t-esc="rawRecord.phone"/>
</div>
</xpath>
</t>
</templates>
@@ -0,0 +1,35 @@
/** @odoo-module **/
import { KanbanRenderer } from "@web/views/kanban/kanban_renderer";
import { session } from "@web/session";
import { useService } from "@web/core/utils/hooks";
const { onWillStart } = owl;
console.log(2222)
export class CrmKanbanRendererCustom extends KanbanRenderer {
setup() {
console.log(1111111)
super.setup();
this.user = useService("user");
this.showRecurringRevenue = false;
onWillStart(async () => {
this.showRecurringRevenue =
this.props.list.model.progressAttributes.recurring_revenue_sum_field &&
(await this.user.hasGroup("crm.group_use_recurring_revenues"));
});
}
getRecurringRevenueGroupAggregate(group) {
const rrField = this.props.list.model.progressAttributes.recurring_revenue_sum_field;
const value = group.getAggregates(rrField.name);
const title = rrField.string || this.env._t("Count");
let currency = false;
if (value && rrField.currency_field) {
currency = session.currencies[session.company_currency_id];
}
return { value, currency, title };
}
}
CrmKanbanRendererCustom.template = "crm.CrmKanbanRenderer.custom";
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-name="crm.CrmKanbanRenderer.custom" t-inherit="web.KanbanRenderer" t-inherit-mode="primary" owl="1">
<xpath expr="//div[hasclass('o_kanban_counter_progress')]" position="attributes">
<attribute name="class" remove="w-75" add="w-50" separator=" "/>
</xpath>
<xpath expr="//div[hasclass('o_kanban_counter_progress')]" position="after">
<div>asdfasdfsaf
</div>
</xpath>
<KanbanAnimatedNumber position="after">
<t t-if="showRecurringRevenue">
<t t-set="rrmAggregate" t-value="getRecurringRevenueGroupAggregate(group)"/>
<KanbanAnimatedNumber
value="rrmAggregate.value"
title="rrmAggregate.title"
duration="1000"
currency="aggregate.currency"
animationClass="'o_kanban_grow_huge'"
>
<t t-set-slot="prefix">
<strong>+</strong>
</t>
</KanbanAnimatedNumber>
</t>
</KanbanAnimatedNumber>
</t>
</templates>
@@ -0,0 +1,18 @@
/** @odoo-module **/
import { registry } from "@web/core/registry";
import { kanbanView } from "@web/views/kanban/kanban_view";
import { CrmKanbanModel } from "@crm/views/crm_kanban/crm_kanban_model";
import { CrmKanbanArchParser } from "@crm/views/crm_kanban/crm_kanban_arch_parser";
import { CrmKanbanRendererCustom } from "@custom_crm/views/crm_kanban_renderer";
export const crmKanbanView = {
...kanbanView,
ArchParser: CrmKanbanArchParser,
// Makes it easier to patch
Controller: class extends kanbanView.Controller {},
Model: CrmKanbanModel,
Renderer: CrmKanbanRendererCustom,
};
registry.category("views").add("crm_kanban1", crmKanbanView);
@@ -0,0 +1,28 @@
// /** @odoo-module **/
//
// import {KanbanRenderer} from "@web/views/kanban/kanban_renderer";
// import {KanbanAnimatedNumber} from "@web/views/kanban/kanban_animated_number";
// import {KanbanColumnQuickCreate} from "@web/views/kanban/kanban_column_quick_create";
// import {KanbanRecord} from "@web/views/kanban/kanban_record";
// import {KanbanRecordQuickCreate} from "@web/views/kanban/kanban_record_quick_create";
// import {DropdownItem} from "@web/core/dropdown/dropdown_item";
// import { Dropdown } from "@web/core/dropdown/dropdown";
//
// // KanbanRenderer.props = [
// // "archInfo",
// // "Compiler?", // optional in stable for backward compatibility
// // "list",
// // "openRecord",
// // "readonly",
// // "forceGlobalClick?",
// // "noContentHelp?",
// // ];
// KanbanRenderer.components = {
// Dropdown,
// DropdownItem,
// KanbanAnimatedNumber,
// KanbanColumnQuickCreate,
// KanbanRecord,
// KanbanRecordQuickCreate,
// };
// KanbanRenderer.template = "web.CalendarCommonRenderer.counter";
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<!-- <t t-name="web.CalendarCommonRenderer.counter" t-inherit="web.KanbanRenderer" t-inherit-mode="primary">-->
<!-- <xpath expr="//div[@class='o_kanban_counter position-relative d-flex align-items-center justify-content-between']" position="after">-->
<!-- <div>asdfasdfsaf-->
<!-- </div>-->
<!-- </xpath>-->
<!-- </t>-->
</templates>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<templates>
<t t-name="web.KanbanView.GroupTest" t-inherit="web.KanbanView.Group" t-inherit-mode="primary">
<xpath expr="//div[hasclass('o_kanban_header_title')]" position="after">
<span>Subtitle</span>
</xpath>
</t>
</templates>
+12
View File
@@ -0,0 +1,12 @@
<odoo>
<record id="view_crm_lead_kanban_inherit" model="ir.ui.view">
<field name="name">crm.lead.kanban.inherit</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.view_crm_lead_kanban"/>
<field name="arch" type="xml">
<xpath expr="//kanban" position="attributes">
<attribute name="js_class" remove="crm_kanban" add="crm_kanban1"/>
</xpath>
</field>
</record>
</odoo>