forked from OCA/hr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request OCA#23 from damdam-s/R_10.0.4
R 10.0.4
- Loading branch information
Showing
18 changed files
with
200 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
id,active,model_id/id,sequence,name,kind,filter_pre_id/id,filter_id/id,server_action_ids/id,filter_pre_domain,filter_domain | ||
__setup__.bar_crm_lead_3_arrival,True,crm.model_crm_lead,1,"cannot go to collect information state",on_write,__setup__.filter_crm_lead_1_2,__setup__.filter_crm_lead_3,"__setup__.server_action_crm_lead_check_3_arrival","['|',('stage_id.name', 'ilike', '1'), ('stage_id.name', 'ilike', '2')]","[('stage_id.name', 'ilike', '3')]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
id,name,state,type,model_id/id,condition,sequence,code | ||
__setup__.server_action_crm_lead_check_3_arrival,check fields,code,ir.actions.server,crm.model_crm_lead,True,1,"# Available variables: | ||
# - time, datetime, dateutil, timezone: Python libraries | ||
# - env: Odoo Environement | ||
# - model: Model of the record on which the action is triggered | ||
# - record: Record on which the action is triggered if there is one, otherwise None | ||
# - records: Records on which the action is triggered if there is one, otherwise None | ||
# - log : log(message), function to log debug information in logging table | ||
# - Warning: Warning Exception to use with raise | ||
# To return an action, assign: action = {...} | ||
|
||
fields = ['project_id', 'start_date', 'end_date', 'signature_ids'] | ||
record.check_fields(fields=fields) | ||
" | ||
__setup__.server_action_crm_lead_check_4_arrival,check fields,code,ir.actions.server,crm.model_crm_lead,True,1," | ||
fields = ['survey_id', 'survey_inputs'] | ||
record.check_fields(fields=fields) | ||
|
||
record.check_survey_state() | ||
" | ||
__setup__.server_action_crm_lead_check_4_arrival2,create task,code,ir.actions.server,crm.model_crm_lead,True,5," | ||
record.create_linked_task() | ||
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
id,active,domain,name,model_id | ||
__setup__.filter_crm_lead_1_2,True,"['|',('stage_id.name', 'ilike', '1'), ('stage_id.name', 'ilike', '2')]",Demand |NDA,crm.lead | ||
__setup__.filter_crm_lead_3,True,"[('stage_id.name', 'ilike', '3')]",Lead TRF,crm.lead | ||
__setup__.filter_crm_lead_4,True,"[('stage_id.name', 'ilike', '4')]",Lead Feasability,crm.lead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
from . import crm_lead | ||
from . import survey | ||
from . import crm_team | ||
from . import project_task |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# -*- coding: utf-8 -*- | ||
# Author: Damien Crier | ||
# Copyright 2017 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import models, fields | ||
|
||
|
||
class ProjectTask(models.Model): | ||
_inherit = 'project.task' | ||
|
||
lead_id = fields.Many2one(comodel_name='crm.lead', | ||
string="Linked Opportunity") | ||
survey_input_lines = fields.One2many(related='lead_id.survey_input_lines') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
|
||
<record id="view_task_form2_lead" model="ir.ui.view"> | ||
<field name="name">project.task.form lead</field> | ||
<field name="model">project.task</field> | ||
<field name="inherit_id" ref="project.view_task_form2"/> | ||
<field eval="2" name="priority"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='project_id']" position="after"> | ||
<field name="lead_id"/> | ||
</xpath> | ||
<xpath expr="//notebook" position="inside"> | ||
<page string="Survey Result" name="lead_survey" attrs="{'invisible': [('lead_id', '=', False)]}"> | ||
<field name="survey_input_lines"/> | ||
</page> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2017 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) | ||
|
||
from pkg_resources import resource_stream | ||
|
||
import anthem | ||
from anthem.lyrics.records import create_or_update | ||
from anthem.lyrics.loaders import load_csv_stream | ||
from ...common import req | ||
|
||
|
||
@anthem.log | ||
def import_filters(ctx): | ||
content = resource_stream(req, 'data/upgrade/10_0_4/ir.filters.csv') | ||
load_csv_stream(ctx, 'ir.filters', content, delimiter=',') | ||
|
||
|
||
@anthem.log | ||
def import_server_actions(ctx): | ||
content = resource_stream(req, 'data/upgrade/10_0_4/ir.actions.server.csv') | ||
load_csv_stream(ctx, 'ir.actions.server', content, delimiter=',') | ||
|
||
|
||
@anthem.log | ||
def import_action_rule(ctx): | ||
content = resource_stream(req, 'data/upgrade/10_0_4/base.action.rule.csv') | ||
load_csv_stream(ctx, 'base.action.rule', content, delimiter=',') | ||
|
||
|
||
@anthem.log | ||
def create_base_action_rules(ctx): | ||
lead_model = ctx.env['ir.model'].search([('model', '=', 'crm.lead')], | ||
limit=1) | ||
bar = { | ||
'__setup__.bar_crm_lead_3_arrival': { | ||
'active': True, | ||
'model_id': lead_model.id, | ||
'sequence': 1, | ||
'name': 'cannot go to collect information state', | ||
'kind': 'on_write', | ||
'filter_pre_id': ctx.env.ref('__setup__.filter_crm_lead_1_2').id, | ||
'filter_pre_domain': "['|',('stage_id.name', 'ilike', '1')," | ||
"('stage_id.name', 'ilike', '2')]", | ||
'filter_id': ctx.env.ref('__setup__.filter_crm_lead_3').id, | ||
'filter_domain': "[('stage_id.name', 'ilike', '3')]", | ||
'server_action_ids': [ | ||
(4, ctx.env.ref( | ||
'__setup__.server_action_crm_lead_check_3_arrival').id)], | ||
}, | ||
'__setup__.bar_crm_lead_4_arrival': { | ||
'active': True, | ||
'model_id': lead_model.id, | ||
'sequence': 1, | ||
'name': 'cannot go to feasability state', | ||
'kind': 'on_write', | ||
'filter_pre_id': ctx.env.ref('__setup__.filter_crm_lead_3').id, | ||
'filter_pre_domain': "[('stage_id.name', 'ilike', '3')]", | ||
'filter_id': ctx.env.ref('__setup__.filter_crm_lead_4').id, | ||
'filter_domain': "[('stage_id.name', 'ilike', '4')]", | ||
'server_action_ids': [ | ||
(4, ctx.env.ref( | ||
'__setup__.server_action_crm_lead_check_4_arrival').id), | ||
(4, ctx.env.ref( | ||
'__setup__.server_action_crm_lead_check_4_arrival2').id)], | ||
} | ||
} | ||
|
||
for k, v in bar.iteritems(): | ||
create_or_update(ctx, 'base.action.rule', k, v) | ||
|
||
|
||
@anthem.log | ||
def main(ctx): | ||
""" Main: creating demo data """ | ||
import_filters(ctx) | ||
import_server_actions(ctx) | ||
# import_action_rule(ctx) | ||
create_base_action_rules(ctx) |
Empty file.
Submodule src
updated
1231 files