Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] v12 to v16 #18

Open
wants to merge 8 commits into
base: 16.0
Choose a base branch
from
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
1 change: 1 addition & 0 deletions altinkaya_crm/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions altinkaya_crm/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2023 Yousef Sheta (https://github.com/TrueYouface)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Altinkaya CRM Extension",
"summary": "Adds tracking and conversion rates to orders.",
"description": "This is a CRM module made for Altinkaya.",
"version": "12.0.1.0.0",
"category": "General",
"website": "https://github.com/TrueYouface",
"author": "Yousef Sheta",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": ["crm", "sale"],
"data": [
"views/crm_lead_view.xml",
"views/sale_order_view.xml",
"views/res_partner_view.xml",
],
}
84 changes: 84 additions & 0 deletions altinkaya_crm/i18n/altinkaya_crm.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * altinkaya_crm
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-12-08 09:09+0000\n"
"PO-Revision-Date: 2023-12-08 09:09+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: altinkaya_crm
#: code:addons/altinkaya_crm/models/res_partner.py:15
#: code:addons/customaddons/altinkaya_crm/models/res_partner.py:15
#, python-format
msgid "Company Tax No"
msgstr ""

#. module: altinkaya_crm
#: model:ir.model,name:altinkaya_crm.model_res_partner
msgid "Contact"
msgstr ""

#. module: altinkaya_crm
#: code:addons/altinkaya_crm/models/res_partner.py:20
#: code:addons/customaddons/altinkaya_crm/models/res_partner.py:20
#, python-format
msgid "Incorrect VAT"
msgstr ""

#. module: altinkaya_crm
#: code:addons/altinkaya_crm/models/res_partner.py:18
#: code:addons/customaddons/altinkaya_crm/models/res_partner.py:18
#, python-format
msgid "Individual Tax No"
msgstr ""

#. module: altinkaya_crm
#: model:ir.model,name:altinkaya_crm.model_crm_lead
msgid "Lead/Opportunity"
msgstr ""

#. module: altinkaya_crm
#: model:ir.model.fields,field_description:altinkaya_crm.field_crm_lead__linkedin
msgid "LinkedIn"
msgstr ""

#. module: altinkaya_crm
#: model:ir.model.fields,field_description:altinkaya_crm.field_sale_order__my_team
#: model_terms:ir.ui.view,arch_db:altinkaya_crm.sale_order_search_inherit_sale_altinkaya
msgid "My Team"
msgstr ""

#. module: altinkaya_crm
#: model_terms:ir.ui.view,arch_db:altinkaya_crm.crm_lead_filter_inherit_altinkaya
msgid "My Team Activities"
msgstr ""

#. module: altinkaya_crm
#: model:ir.model.fields,field_description:altinkaya_crm.field_crm_lead__my_team_activity
msgid "My Team Activity"
msgstr ""

#. module: altinkaya_crm
#: model:ir.model,name:altinkaya_crm.model_sale_order
msgid "Sale Order"
msgstr ""

#. module: altinkaya_crm
#: model_terms:ir.ui.view,arch_db:altinkaya_crm.res_partner_view_form_inherit_altinkaya
msgid "VAT Status"
msgstr ""

#. module: altinkaya_crm
#: model:ir.model.fields,field_description:altinkaya_crm.field_res_partner__vat_status
#: model:ir.model.fields,field_description:altinkaya_crm.field_res_users__vat_status
msgid "Vat Status"
msgstr ""
84 changes: 84 additions & 0 deletions altinkaya_crm/i18n/tr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * altinkaya_crm
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-02 05:19+0000\n"
"PO-Revision-Date: 2024-02-02 05:19+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: altinkaya_crm
#. odoo-python
#: code:addons/altinkaya_crm/models/res_partner.py:0
#, python-format
msgid "Company Tax No"
msgstr "Vergi No"

#. module: altinkaya_crm
#: model:ir.model,name:altinkaya_crm.model_res_partner
msgid "Contact"
msgstr "Kontak"

#. module: altinkaya_crm
#. odoo-python
#: code:addons/altinkaya_crm/models/res_partner.py:0
#, python-format
msgid "Incorrect VAT"
msgstr "Yanlış VAT"

#. module: altinkaya_crm
#. odoo-python
#: code:addons/altinkaya_crm/models/res_partner.py:0
#, python-format
msgid "Individual Tax No"
msgstr "TC No"

#. module: altinkaya_crm
#: model:ir.model,name:altinkaya_crm.model_crm_lead
msgid "Lead/Opportunity"
msgstr "Aday/Fırsat"

#. module: altinkaya_crm
#: model:ir.model.fields,field_description:altinkaya_crm.field_crm_lead__linkedin
msgid "LinkedIn"
msgstr ""

#. module: altinkaya_crm
#: model:ir.model.fields,field_description:altinkaya_crm.field_sale_order__my_team
#: model_terms:ir.ui.view,arch_db:altinkaya_crm.sale_order_search_inherit_sale_altinkaya
msgid "My Team"
msgstr "Benim Takımım"

#. module: altinkaya_crm
#: model_terms:ir.ui.view,arch_db:altinkaya_crm.crm_lead_filter_inherit_altinkaya
msgid "My Team Activities"
msgstr "Takım Aktiviteleri"

#. module: altinkaya_crm
#: model:ir.model.fields,field_description:altinkaya_crm.field_crm_lead__my_team_activity
msgid "My Team Activity"
msgstr "Takım Aktiviteleri"

#. module: altinkaya_crm
#: model:ir.model,name:altinkaya_crm.model_sale_order
msgid "Sales Order"
msgstr "Satış Siparişi"

#. module: altinkaya_crm
#: model_terms:ir.ui.view,arch_db:altinkaya_crm.res_partner_view_form_inherit_altinkaya
msgid "VAT Status"
msgstr "Vergi No Tipi"

#. module: altinkaya_crm
#: model:ir.model.fields,field_description:altinkaya_crm.field_res_partner__vat_status
#: model:ir.model.fields,field_description:altinkaya_crm.field_res_users__vat_status
msgid "Vat Status"
msgstr "Vergi No Tipi"
3 changes: 3 additions & 0 deletions altinkaya_crm/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import crm_lead
from . import sale_order
from . import res_partner
37 changes: 37 additions & 0 deletions altinkaya_crm/models/crm_lead.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from odoo import models, fields, api


class CRMLead(models.Model):
_inherit = "crm.lead"

linkedin = fields.Char(string="LinkedIn")

@api.model
def _search_my_team_activity(self, operator, operand):
# if operator == "=":
# new_operator = "in"
# else:
# new_operator = "not in"
res = self.search(
[
("team_id.member_ids", operator, self.env.user.id),
],
)
return [("id", "in", res.ids)]

my_team_activity = fields.Boolean(
"My Team Activity",
compute="_compute_my_team_activity",
search="_search_my_team_activity",
store=False,
)

def _compute_my_team_activity(self):
for lead in self:
if self.env.user in lead.team_id.member_ids:
lead.my_team_activity = True
else:
lead.my_team_activity = False



26 changes: 26 additions & 0 deletions altinkaya_crm/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError


class ResPartner(models.Model):
_inherit = "res.partner"

vat_status = fields.Char(string="Vat Status", compute="_compute_vat_status")

def _compute_vat_status(self):
for partner in self:
if partner.country_id.code == "TR" and partner.vat:
vat_len = len(partner.vat)
if vat_len == 10:
partner.vat_status = _("Company Tax No")

elif vat_len == 11:
partner.vat_status = _("Individual Tax No")
else:
partner.vat_status = _("Incorrect VAT")
else:
partner.vat_status = ""
return True



34 changes: 34 additions & 0 deletions altinkaya_crm/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from odoo import models, fields, api


class SaleOrder(models.Model):
_inherit = "sale.order"

@api.model
def _search_my_team(self, operator, operand):
# if operator == "=":
# new_operator = "in"
# else:
# new_operator = "not in"
res = self.search(
[
("team_id.member_ids", operator, self.env.user.id),
],
)
return [("id", "in", res.ids)]

my_team = fields.Boolean(
"My Team",
compute="_compute_my_team",
search="_search_my_team",
store=False,
)

def _compute_my_team(self):
for rec in self:
if self.env.user in rec.team_id.member_ids:
rec.my_team = True
else:
rec.my_team = False


25 changes: 25 additions & 0 deletions altinkaya_crm/views/crm_lead_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record model="ir.ui.view" id="crm_lead_filter_inherit_altinkaya">
<field name="name">crm.lead.activities.filter.inherit</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.view_crm_case_opportunities_filter"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='open_opportunities']" position="after">
<separator/>
<filter string="My Team Activities" name="activities_my_team"
domain="[('my_team_activity', '=', True)]"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="crm_crm_lead_view_form_inherit_altinkaya">
<field name="name">crm.crm.lead.view.form.inherit</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_lead_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='tag_ids']" position="after">
<field name="linkedin" widget="url"/>
</xpath>
</field>
</record>
</odoo>
14 changes: 14 additions & 0 deletions altinkaya_crm/views/res_partner_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record model="ir.ui.view" id="res_partner_view_form_inherit_altinkaya">
<field name="name">res.partner.view.form.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">

<xpath expr="//field[@name='vat']" position="after">
<field name="vat_status" string="VAT Status" class="text-muted"/>
</xpath>
</field>
</record>
</odoo>
14 changes: 14 additions & 0 deletions altinkaya_crm/views/sale_order_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record model="ir.ui.view" id="sale_order_search_inherit_sale_altinkaya">
<field name="name">sale.order.activities.search.inherit</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.sale_order_view_search_inherit_sale"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='order_date']" position="after">
<filter string="My Team" name="my_team"
domain="[('my_team', '=', 'user_id.team_id')]"/>
</xpath>
</field>
</record>
</odoo>
3 changes: 0 additions & 3 deletions altinkaya_mrp/__init__.py

This file was deleted.

18 changes: 0 additions & 18 deletions altinkaya_mrp/__manifest__.py

This file was deleted.

Loading