Commit ea8ea042 authored by Jordan - Le Filament's avatar Jordan - Le Filament

[modif] refonte module pour compatibilité odoo 12

parent cde84b22
.*
*.pyc
!.gitignore
This diff is collapsed.
......@@ -3,58 +3,12 @@
:alt: License: AGPL-3
================================
Le Filament Link Sale to Project
================================
This module provides a new functionality to transform your sale order in projects and tasks (and to update those in case sale order is updated)
Product template has been enhanced, invoicing policy section in order to set how each product should behave when transformed from sale order to project/task.
This module depends upon *sale_service* and *lefilament_projets* modules.
Configuration
=============
1. In *Sales > Products* when creating a product of Service type, in *Invoicing > Invoicing policy* you can now use an extra *track service* named 'Create a project and link tasks'.
> Note : the existing *track services* are preserved and can still be used together with the following options, the new service was created in order not to track hours as delivered in sale order. As a remainder for the existing types:
> - Manual : delivered quantities are manually set on sale order line
> - Timesheet : hours spent on project with the same customer are reported in the sale order as delivered quantities
> - Task : Create a task in a specific project (if filled) and reports hours from this task in delivered quantities
Now you can add project and task type for this product.
- If you select none, when creating a project from sale order, a wizard will propose you to select an existing project or to create a new one and a task will be created inside that project with the content of your sale order line description.
- If you select a project and a task type, when creating a project from sale order, a new task with the content of the sale order line description will be created inside the defined project with defined task type.
2. In *Sales > Configuration > Settings* you can now configure the default task type / stage you want to use when creating task associated to a sale order line.
3. In *Project > Configuration > Stages* a new boolean field case_default / Default step has been added to each stage to define which stages should be added by default to any new project.
4. In *Project > Configuration > Configuration* an *alias prefix* has been added so that new projects will have an e-mail alias prefixed with this field
Usage
=====
1. Configure your Odoo instance as described in previous section
2. On each confirmed sale order you find a new button to *Create Project* that will open a wizard to select existing project or creating a new one. Tasks would be assigned to selected project, with associated scheduled time (depending on sale price / daily cost configured in Project configuration)
3. You can also follow the various tasks and timesheets associated to that sale order
4. On sale order line update, click on button *Update tasks* to update projects and tasks associated with this sale order.
====================================
LE FILAMENT - LIEN COMMANDES PROJET
====================================
Modifie le module Sale:
- Fais le lien entre les commandes et les projets
Credits
=======
......@@ -63,13 +17,13 @@ Contributors
------------
* Juliana Poudou <juliana@le-filament.com>
* Remi Cazenave <remi@le-filament.com>
* Jordan Coest <jordan@le-filament.com>
Maintainer
------------
----------
.. image:: https://le-filament.com/img/logo-lefilament.png
.. image:: https://le-filament.com/images/logo-lefilament.png
:alt: Le Filament
:target: https://le-filament.com
......
# -*- coding: utf-8 -*-
# Copyright 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
from . import wizard
from . import controllers
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Le Filament - Link Sales Order to Project',
'version': '12.0.1.0.0',
'license': 'AGPL-3',
'author': 'LE FILAMENT',
'category': 'LE FILAMENT',
'depends': ['sale_timesheet', 'lefilament_projets'],
'contributors': [
'Juliana Poudou <juliana@le-filament.com>',
],
'website': 'http://www.le-filament.com',
'name': "Lien Commandes Projets",
'summary': """Filament - Lien entre commandes et projets""",
'author': "Le Filament",
'website': "https://www.le-filament.com",
'version': '12.0.1.0.1',
'license': "AGPL-3",
'category': 'Sale Management',
'depends': ['sale_timesheet', 'project'],
'data': [
'wizard/sale_views_wizard.xml',
'views/sale_views.xml',
'views/res_config_views.xml',
'views/project_views.xml',
'views/project_task_views.xml',
],
'qweb': [
'views/res_config_settings_view.xml',
'views/sale_view.xml',
'views/product_view.xml',
],
}
# -*- coding: utf-8 -*-
# Copyright 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import sale_views_wizard
from . import main
# Copyright 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from ast import literal_eval
import babel
from dateutil.relativedelta import relativedelta
import itertools
import json
from odoo import http, fields, _
from odoo.http import request
from odoo.tools import float_round
from odoo.addons.sale_timesheet.controllers.main import SaleTimesheetController
from odoo.addons.web.controllers.main import clean_action
DEFAULT_MONTH_RANGE = 3
class CustomSaleTimesheetController(SaleTimesheetController):
def _table_get_line_values(self, projects):
""" return the header and the rows informations of the table """
if not projects:
return False
taux_horaire = request.env.user.company_id.taux_horaire
uom_hour = request.env.ref('uom.product_uom_hour')
# build SQL query and fetch raw data
query, query_params = self._table_rows_sql_query(projects)
request.env.cr.execute(query, query_params)
raw_data = request.env.cr.dictfetchall()
rows_employee = self._table_rows_get_employee_lines(projects, raw_data)
default_row_vals = self._table_row_default(projects)
empty_line_ids, empty_order_ids = self._table_get_empty_so_lines(projects)
print("empty_line_ids, empty_order_ids", str(empty_line_ids))
# extract row labels
sale_line_ids = set()
sale_order_ids = set()
for key_tuple, row in rows_employee.items():
if row[0]['sale_line_id']:
sale_line_ids.add(row[0]['sale_line_id'])
if row[0]['sale_order_id']:
sale_order_ids.add(row[0]['sale_order_id'])
sale_order_lines = request.env['sale.order.line'].sudo().browse(sale_line_ids | empty_line_ids)
map_so_names = {so.id: so.name for so in request.env['sale.order'].sudo().browse(sale_order_ids | empty_order_ids)}
map_sol = {sol.id: sol for sol in sale_order_lines}
map_sol_names = {sol.id: sol.name.split('\n')[0] if sol.name else _('No Sales Order Line') for sol in sale_order_lines}
map_sol_so = {sol.id: sol.order_id.id for sol in sale_order_lines}
rows_sale_line = {} # (so, sol) -> [INFO, before, M1, M2, M3, Done, M3, M4, M5, After, Forecasted]
for sale_line_id in empty_line_ids: # add service SO line having no timesheet
sale_line_row_key = (map_sol_so.get(sale_line_id), sale_line_id)
sale_line = map_sol.get(sale_line_id)
is_milestone = sale_line.product_id.invoice_policy == 'delivery' and sale_line.product_id.service_type == 'manual' if sale_line else False
rows_sale_line[sale_line_row_key] = [{'label': map_sol_names.get(sale_line_id, _('No Sales Order Line')), 'res_id': sale_line_id, 'res_model': 'sale.order.line', 'type': 'sale_order_line', 'is_milestone': is_milestone}] + default_row_vals[:]
if not is_milestone:
# **** MODIF ****
rows_sale_line[sale_line_row_key][-2] = sale_line.product_uom_qty*sale_line.price_unit/taux_horaire if sale_line else 0.0
# rows_sale_line[sale_line_row_key][-2] = sale_line.product_uom._compute_quantity(sale_line.product_uom_qty, uom_hour, raise_if_failure=False) if sale_line else 0.0
for row_key, row_employee in rows_employee.items():
sale_line_id = row_key[1]
sale_order_id = row_key[0]
# sale line row
sale_line_row_key = (sale_order_id, sale_line_id)
if sale_line_row_key not in rows_sale_line:
sale_line = map_sol.get(sale_line_id, request.env['sale.order.line'])
is_milestone = sale_line.product_id.invoice_policy == 'delivery' and sale_line.product_id.service_type == 'manual' if sale_line else False
rows_sale_line[sale_line_row_key] = [{'label': map_sol_names.get(sale_line.id) if sale_line else _('No Sales Order Line'), 'res_id': sale_line_id, 'res_model': 'sale.order.line', 'type': 'sale_order_line', 'is_milestone': is_milestone}] + default_row_vals[:] # INFO, before, M1, M2, M3, Done, M3, M4, M5, After, Forecasted
if not is_milestone:
# **** MODIF ****
rows_sale_line[sale_line_row_key][-2] = sale_line.product_uom_qty*sale_line.price_unit/taux_horaire if sale_line else 0.0
# rows_sale_line[sale_line_row_key][-2] = sale_line.product_uom._compute_quantity(sale_line.product_uom_qty, uom_hour, raise_if_failure=False) if sale_line else 0.0
for index in range(len(rows_employee[row_key])):
if index != 0:
rows_sale_line[sale_line_row_key][index] += rows_employee[row_key][index]
if not rows_sale_line[sale_line_row_key][0].get('is_milestone'):
rows_sale_line[sale_line_row_key][-1] = rows_sale_line[sale_line_row_key][-2] - rows_sale_line[sale_line_row_key][5]
else:
rows_sale_line[sale_line_row_key][-1] = 0
rows_sale_order = {} # so -> [INFO, before, M1, M2, M3, Done, M3, M4, M5, After, Forecasted]
rows_sale_order_done_sold = {key : dict(sold=0.0, done=0.0) for key in set(map_sol_so.values()) | set([None])} # SO id -> {'sold':0.0, 'done': 0.0}
for row_key, row_sale_line in rows_sale_line.items():
sale_order_id = row_key[0]
# sale order row
if sale_order_id not in rows_sale_order:
rows_sale_order[sale_order_id] = [{'label': map_so_names.get(sale_order_id, _('No Sales Order')), 'res_id': sale_order_id, 'res_model': 'sale.order', 'type': 'sale_order'}] + default_row_vals[:] # INFO, before, M1, M2, M3, Done, M3, M4, M5, After, Forecasted
for index in range(len(rows_sale_line[row_key])):
if index != 0:
rows_sale_order[sale_order_id][index] += rows_sale_line[row_key][index]
# do not sum the milestone SO line for sold and done (for remaining computation)
if not rows_sale_line[row_key][0].get('is_milestone'):
rows_sale_order_done_sold[sale_order_id]['sold'] += rows_sale_line[row_key][-2]
rows_sale_order_done_sold[sale_order_id]['done'] += rows_sale_line[row_key][5]
# remaining computation of SO row, as Sold - Done (timesheet total)
for sale_order_id, done_sold_vals in rows_sale_order_done_sold.items():
if sale_order_id in rows_sale_order:
rows_sale_order[sale_order_id][-1] = done_sold_vals['sold'] - done_sold_vals['done']
# group rows SO, SOL and their related employee rows.
timesheet_forecast_table_rows = []
for sale_order_id, sale_order_row in rows_sale_order.items():
timesheet_forecast_table_rows.append(sale_order_row)
for sale_line_row_key, sale_line_row in rows_sale_line.items():
if sale_order_id == sale_line_row_key[0]:
timesheet_forecast_table_rows.append(sale_line_row)
for employee_row_key, employee_row in rows_employee.items():
if sale_order_id == employee_row_key[0] and sale_line_row_key[1] == employee_row_key[1]:
timesheet_forecast_table_rows.append(employee_row)
# complete table data
return {
'header': self._table_header(projects),
'rows': timesheet_forecast_table_rows
}
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * lefilament_link_sale_project
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-16 18:19+0000\n"
"PO-Revision-Date: 2018-01-16 18: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: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_project_config_settings_lf_alias_prefix
msgid "Alias prefix"
msgstr "Préfixe Alias"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_related_project_id
msgid "Analytical account related"
msgstr "Compte analytique lié"
#. module: lefilament_link_sale_project
#: model:ir.ui.view,arch_db:lefilament_link_sale_project.lefilament_project_view_form_create
msgid "Create"
msgstr "Créer"
#. module: lefilament_link_sale_project
#: model:ir.actions.act_window,name:lefilament_link_sale_project.lefilament_open_create_project
#: model:ir.ui.view,arch_db:lefilament_link_sale_project.lefilament_view_order_form
msgid "Create project"
msgstr "Créer projet"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_create_uid
msgid "Created by"
msgstr "Créé par"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_create_date
msgid "Created on"
msgstr "Créé le"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_project_task_currency_id
msgid "Currency"
msgstr "Devise"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_project_config_settings_lf_tarif_jour
msgid "Day Price"
msgstr "Tarif jour"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_project_task_type_case_default
msgid "Default step"
msgstr "Étape par défaut"
#. module: lefilament_link_sale_project
#: model:ir.ui.view,arch_db:lefilament_link_sale_project.lefilament_project_view_form_create
msgid "Discard"
msgstr "Annuler"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_display_name
msgid "Display Name"
msgstr "Nom affiché"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_project_id
msgid "Existing project"
msgstr "Projet existant"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_id
msgid "ID"
msgstr "ID"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_sale_config_settings_project_task_type_id
msgid "Initial step"
msgstr "Étape initiale"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard___last_update
msgid "Last Modified on"
msgstr "Dernière Modification le"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_write_uid
msgid "Last Updated by"
msgstr "Dernière mise à jour par"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_write_date
msgid "Last Updated on"
msgstr "Dernière mise à jour le"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_related_project_name
msgid "New Analytical Account"
msgstr "Nouveau compte analytique"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_project_name
msgid "New project"
msgstr "Nouveau projet"
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_procurement_order
msgid "Procurement"
msgstr "Approvisionnement"
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_product_template
msgid "Product Template"
msgstr "Modèle d'article"
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_project_project
msgid "Project"
msgstr "Projet"
#. module: lefilament_link_sale_project
#: model:ir.ui.view,arch_db:lefilament_link_sale_project.lefialement_edit_project
msgid "Project Stages"
msgstr "Etapes de projet"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_product_product_project_task_type_id
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_product_template_project_task_type_id
msgid "Project task stage"
msgstr "Etape projet"
#. module: lefilament_link_sale_project
#: model:ir.ui.view,arch_db:lefilament_link_sale_project.lefilament_project_view_form_create
msgid "Project to link"
msgstr "Projet à lier"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_sale_id
msgid "Sale"
msgstr "Vente"
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_lefilament_sale_views_wizard
msgid "Sale Project Assignment"
msgstr "Affectation de projet de vente"
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_sale_order
msgid "Sales Order"
msgstr "Bon de commande"
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_sale_order_line
msgid "Sales Order Line"
msgstr "Ligne de bons de commande"
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_project_task_price_subtotal
msgid "Subtotal initial"
msgstr "Sous-Total initial"
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_project_task
#: model:ir.ui.view,arch_db:lefilament_link_sale_project.lefilament_view_sales_config
msgid "Task"
msgstr "Tâche"
#. module: lefilament_link_sale_project
#: code:addons/lefilament_link_sale_project/models/procurement.py:58
#, python-format
msgid "Task Created (%s): <a href=# data-oe-model=project.task data-oe-id=%d>%s</a>"
msgstr "Tâche Créée (%s): <a href=# data-oe-model=project.task data-oe-id=%d>%s</a>"
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_project_task_type
msgid "Task Stage"
msgstr "Étape de tâche"
#. module: lefilament_link_sale_project
#: code:addons/lefilament_link_sale_project/models/procurement.py:62
#, python-format
msgid "This task has been created from: <a href=# data-oe-model=sale.order data-oe-id=%d>%s</a> (%s)"
msgstr "Cette tâche a été créée à partir de: <a href=# data-oe-model=sale.order data-oe-id=%d>%s</a> (%s)"
#. module: lefilament_link_sale_project
#: model:ir.ui.view,arch_db:lefilament_link_sale_project.lefilament_view_order_form
msgid "Update tasks"
msgstr "Mise à jour des tâches"
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_project_config_settings
msgid "project.config.settings"
msgstr "project.config.settings"
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_sale_config_settings
msgid "sale.config.settings"
msgstr "sale.config.settings"
#. module: lefilament_link_sale_project
#: selection:product.template,service_tracking:0
msgid "Create a project and link tasks"
msgstr "Créer un projet et lier des tâches"
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * lefilament_link_sale_project
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-16 18:19+0000\n"
"PO-Revision-Date: 2018-01-16 18: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: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_project_config_settings_lf_alias_prefix
msgid "Alias prefix"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_related_project_id
msgid "Analytical account related"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.ui.view,arch_db:lefilament_link_sale_project.lefilament_project_view_form_create
msgid "Create"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.actions.act_window,name:lefilament_link_sale_project.lefilament_open_create_project
#: model:ir.ui.view,arch_db:lefilament_link_sale_project.lefilament_view_order_form
msgid "Create project"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_create_uid
msgid "Created by"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_create_date
msgid "Created on"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_project_task_currency_id
msgid "Currency"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_project_config_settings_lf_tarif_jour
msgid "Day Price"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_project_task_type_case_default
msgid "Default step"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.ui.view,arch_db:lefilament_link_sale_project.lefilament_project_view_form_create
msgid "Discard"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_display_name
msgid "Display Name"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_project_id
msgid "Existing project"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_id
msgid "ID"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_sale_config_settings_project_task_type_id
msgid "Initial step"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard___last_update
msgid "Last Modified on"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_write_uid
msgid "Last Updated by"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_write_date
msgid "Last Updated on"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_related_project_name
msgid "New Analytical Account"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_project_name
msgid "New project"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_procurement_order
msgid "Procurement"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_product_template
msgid "Product Template"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_project_project
msgid "Project"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.ui.view,arch_db:lefilament_link_sale_project.lefialement_edit_project
msgid "Project Stages"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_product_product_project_task_type_id
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_product_template_project_task_type_id
msgid "Project task stage"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.ui.view,arch_db:lefilament_link_sale_project.lefilament_project_view_form_create
msgid "Project to link"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_lefilament_sale_views_wizard_sale_id
msgid "Sale"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_lefilament_sale_views_wizard
msgid "Sale Project Assignment"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_sale_order
msgid "Sales Order"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_sale_order_line
msgid "Sales Order Line"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model.fields,field_description:lefilament_link_sale_project.field_project_task_price_subtotal
msgid "Subtotal initial"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_project_task
#: model:ir.ui.view,arch_db:lefilament_link_sale_project.lefilament_view_sales_config
msgid "Task"
msgstr ""
#. module: lefilament_link_sale_project
#: code:addons/lefilament_link_sale_project/models/procurement.py:58
#, python-format
msgid "Task Created (%s): <a href=# data-oe-model=project.task data-oe-id=%d>%s</a>"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_project_task_type
msgid "Task Stage"
msgstr ""
#. module: lefilament_link_sale_project
#: code:addons/lefilament_link_sale_project/models/procurement.py:62
#, python-format
msgid "This task has been created from: <a href=# data-oe-model=sale.order data-oe-id=%d>%s</a> (%s)"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.ui.view,arch_db:lefilament_link_sale_project.lefilament_view_order_form
msgid "Update tasks"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_project_config_settings
msgid "project.config.settings"
msgstr ""
#. module: lefilament_link_sale_project
#: model:ir.model,name:lefilament_link_sale_project.model_sale_config_settings
msgid "sale.config.settings"
msgstr ""
# -*- coding: utf-8 -*-
# Copyright 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import project
from . import project_task
from . import project_task_type
from . import res_company
from . import res_config
from . import sale_order
from . import res_company
from . import res_config_settings
from . import product_template
# Copyright 2019 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, fields, api
class ProductTemplate(models.Model):
_inherit = "product.template"
project_linked_stage_id = fields.Many2one('project.task.type', string='Etape', ondelete='restrict',
track_visibility='onchange', index=True,
group_expand='_read_group_stage_ids',
domain="[('project_ids', '=', project_id)]", copy=False)
# -*- coding: utf-8 -*-
# © 2017 Le Filament (<https://le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, fields
class ProjectProject(models.Model):
_inherit = 'project.project'
def _get_type_common(self):
ids = self.env['project.task.type'].search([
('case_default', '=', True)])
return ids
type_ids = fields.Many2many(
comodel_name='project.task.type', relation='project_task_type_rel',
column1='project_id', column2='type_id', string='Tasks Stages',
default=_get_type_common
)
# -*- coding: utf-8 -*-
# © 2017 Le Filament (<https://le-filament.com>)