Skip to content
Extraits de code Groupes Projets
Valider 2d21fa2d rédigé par Rémi - Le Filament's avatar Rémi - Le Filament
Parcourir les fichiers

Merge branch '14.0-remix' into '14.0'

14.0 remix

See merge request !1
parents ef95d2cf 64191c64
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!114.0 remix
Affichage de
avec 840 ajouts et 4 suppressions
# Copyright 2021 Le Filament (https://le-filament.com) # Copyright 2021 Le Filament (https://le-filament.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from . import models, wizard
...@@ -3,13 +3,25 @@ ...@@ -3,13 +3,25 @@
"summary": "Modifie le module Projet pour Ecozimut", "summary": "Modifie le module Projet pour Ecozimut",
"author": "Le Filament", "author": "Le Filament",
"website": "https://le-filament.com", "website": "https://le-filament.com",
"version": "14.0.1.0.1", "version": "14.0.1.0.2",
"license": "AGPL-3", "license": "AGPL-3",
"depends": [], "depends": [
"hr_timesheet",
"hr_holidays",
"project",
"project_timeline",
"sale_timesheet",
],
"data": [ "data": [
# "security/ir.model.access.csv", "security/ir.model.access.csv",
# datas # datas
"data/project_type_data.xml",
# views # views
"views/account_analytic.xml",
"views/account_move.xml",
"views/project.xml",
"views/project_categorie.xml",
"views/project_task.xml",
# views menu # views menu
# wizard # wizard
], ],
......
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
<!-- account.account.type -->
<record model="project.categorie" id="type_bureau_etude">
<field name="name">Bureau d'études</field>
<field name="rate">1</field>
<field name="color">0</field>
</record>
<record model="project.categorie" id="type_formation">
<field name="name">Formation</field>
<field name="rate">1</field>
<field name="color">1</field>
</record>
<record model="project.categorie" id="type_maitrise_oeuvre">
<field name="name">Maitrise d’œuvre</field>
<field name="rate">1</field>
<field name="color">2</field>
</record>
<record model="project.categorie" id="type_materiaux">
<field name="name">Matériaux</field>
<field name="rate">1</field>
<field name="color">3</field>
</record>
<record model="project.categorie" id="type_admin">
<field name="name">Admin</field>
<field name="rate">1</field>
<field name="color">4</field>
</record>
</data>
</odoo>
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-10-25 08:14+0000\n"
"PO-Revision-Date: 2018-10-25 08:14+0000\n"
"Last-Translator: <Remi - Le Filament>\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: project
#: model:ir.ui.view,arch_db:project.edit_project
#: model:ir.ui.view,arch_db:project.view_project
#: model:ir.ui.view,arch_db:project.view_project_project_filter
msgid "Project Name"
msgstr "Nom"
#. module: account
#: model:ir.model.fields,field_description:account.field_account_invoice_line_price_subtotal_signed
msgid "Amount Signed"
msgstr "Montant signé"
#. module: account
#: model:ir.model.fields,field_description:account.field_account_invoice_amount_total_signed
msgid "Total in Invoice Currency"
msgstr "Total signé"
#. module: account
#: model:ir.model.fields,field_description:account.field_account_invoice_amount_untaxed_signed
msgid "Untaxed Amount in Company Currency"
msgstr "Montant HT signé"
# Copyright 2022 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import SUPERUSER_ID, api
def _update_project_type(env):
for project in (
env["project.project"]
.with_context(active_test=False)
.search([("categorie", "!=", False)])
):
if project.categorie == env.ref("ecozimut.type_bureau_etude"):
project.categorie = env.ref("ecozimut_project.type_bureau_etude")
elif project.categorie == env.ref("ecozimut.type_formation"):
project.categorie = env.ref("ecozimut_project.type_formation")
elif project.categorie == env.ref("ecozimut.type_maitrise_oeuvre"):
project.categorie = env.ref("ecozimut_project.type_maitrise_oeuvre")
elif project.categorie == env.ref("ecozimut.type_materiaux"):
project.categorie = env.ref("ecozimut_project.type_materiaux")
elif project.categorie == env.ref("ecozimut.type_admin"):
project.categorie = env.ref("ecozimut_project.type_admin")
def migrate(cr, version):
env = api.Environment(cr, SUPERUSER_ID, {})
_update_project_type(env)
# © 2018 Le Filament (http://www.le-filament.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import account_analytic
from . import account_move
from . import ecozimut_project_perf
from . import project
from . import project_categorie
from . import project_task
# © 2019 Le Filament (<https://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class EcozimutAnalytic(models.Model):
_inherit = "account.analytic.account"
categorie = fields.Many2one("project.categorie", string="Categorie")
# © 2018 Le Filament (http://www.le-filament.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class AccountMove(models.Model):
_inherit = "account.move"
project_id = fields.Many2one("project.project", "Projet")
description = fields.Char("Intitulé")
# © 2018 Le Filament (http://www.le-filament.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class EcozimutProjectPerf(models.Model):
_name = "ecozimut.project.perf"
_description = "Performance projet"
name = fields.Char("Nom", required=True)
# © 2019 Le Filament (<https://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class Projet(models.Model):
_inherit = "project.project"
heures_passees = fields.Float(
"Heures Passées", compute="_compute_heures_passees", store=True
)
heures_restantes = fields.Float(
"Heures Restantes", compute="_compute_heures_restantes", store=True
)
invoice_count = fields.Integer(
string="# of Invoices", compute="_compute_invoice_count", readonly=True
)
account_invoice = fields.One2many("account.move", "project_id", string="Factures")
moa = fields.Many2one("res.partner", string="MOA")
moe = fields.Many2one("res.partner", string="MOE")
archi = fields.Many2one("res.partner", string="Architecte")
mission = fields.Char("Missions Ecozimut")
surface_sdp = fields.Integer("Surface SdP")
cost_works = fields.Integer("Coût travaux(hors VRD)")
perf_ids = fields.Many2many("ecozimut.project.perf", string="Performance / Label")
be = fields.Char("BE")
deliveryDate = fields.Date(string="Date de livraison")
project_type = fields.Selection(
[
("project", ("project")),
("phase", "phase"),
("template_project", ("template_project")),
("template_phase", "template_phase"),
],
string="Type de projet",
)
categorie = fields.Many2one("project.categorie", string="Categorie")
state = fields.Selection(
[
("draft", "New"),
("En prosection", "En prospection"),
("Appel d'offre", "Appel d'offre"),
("En signature", "En signature"),
("open", "In Progress"),
("cancelled", "Cancelled"),
("pending", "Pending"),
("close", "Closed"),
],
string="Status",
copy=False,
)
estimation = fields.Float(compute="_compute_estimation", store=True)
sale_order_ids = fields.Many2many(
comodel_name="sale.order",
relation="sale_project_id_rel",
column1="sale_id",
column2="project_id",
compute="_compute_sale_order_ids",
string="Devis/Commandes",
copy=False,
)
sale_count = fields.Integer(
string="Nombre de Devis", compute="_compute_sale_count", readonly=True
)
# ------------------------------------------------------
# Compute functions
# ------------------------------------------------------
@api.depends(
"analytic_account_id.line_ids", "analytic_account_id.line_ids.unit_amount"
)
def _compute_heures_passees(self):
for project in self:
hours = (
self.env["account.analytic.line"]
.search([("project_id", "=", project.id)])
.mapped("unit_amount")
)
project.heures_passees = sum(hours)
@api.depends("estimation", "heures_passees")
def _compute_heures_restantes(self):
for project in self:
project.heures_restantes = project.estimation - project.heures_passees
@api.depends(
"tasks",
"tasks.planned_hours",
)
def _compute_estimation(self):
for project in self:
hours = sum(
project.with_context(active_test=False).tasks.mapped("planned_hours")
)
phases_hours = 0
project.estimation = hours + phases_hours
if project.categorie:
project.estimation = project.estimation * project.categorie[0].rate
@api.depends("state", "account_invoice")
def _compute_invoice_count(self):
"""
The invoice_ids are obtained thanks to the invoice lines of the SO lines,
and we also search for possible refunds created directly from existing invoices.
This is necessary since such a refund is not directly linked to the SO.
"""
for order in self:
invoice_ids = order.mapped("account_invoice")
# Search for invoices which have been 'cancelled' (filter_refund = 'modify' in
# 'account.invoice.refund')
# use like as origin may contains multiple references (e.g. 'SO01, SO02')
refunds = invoice_ids.search([("invoice_origin", "like", order.name)])
invoice_ids |= refunds.filtered(
lambda r: order.name
in [origin.strip() for origin in r.origin.split(",")]
)
# Search for refunds as well
refund_ids = self.env["account.move"].browse()
if invoice_ids:
for inv in invoice_ids:
refund_ids += refund_ids.search(
[
("type", "=", "out_refund"),
("origin", "=", inv.number),
("origin", "!=", False),
("journal_id", "=", inv.journal_id.id),
]
)
order.update(
{
"invoice_count": len(set(invoice_ids.ids + refund_ids.ids)),
"account_invoice": invoice_ids.ids + refund_ids.ids,
}
)
@api.depends("task_ids")
def _compute_sale_order_ids(self):
for project in self:
sales = project.sale_order_id
sales |= project.mapped("sale_line_id.order_id")
sales |= self.env["sale.order"].search([("project_id", "=", project.id)])
task_so_ids = self.env["project.task"].search_read(
[("project_id", "=", self.id), ("sale_order_id", "!=", False)],
["sale_order_id"],
)
task_so_ids = [o["sale_order_id"][0] for o in task_so_ids]
sales |= self.env["sale.order"].browse(task_so_ids)
project.sale_order_ids = sales
@api.depends("sale_order_ids")
def _compute_sale_count(self):
for project in self:
project.sale_count = len(project.sale_order_ids)
# ------------------------------------------------------
# Compute functions
# ------------------------------------------------------
def open_project(self):
return {
"type": "ir.actions.act_window",
"name": "Projet" + self.name,
"view_mode": "kanban",
"res_model": "project.project",
"res_id": self.id,
"views": [(False, "kanban")],
}
def sale_tree_view(self):
action = self.env["ir.actions.act_window"]._for_xml_id("sale.action_orders")
action["domain"] = str(
[
("id", "in", self.sale_order_ids.ids),
]
)
return action
# © 2018 Le Filament (http://www.le-filament.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ProjectCategorie(models.Model):
_name = "project.categorie"
_description = "Catégorie de projet"
name = fields.Char(string="Nom")
rate = fields.Float(string="Taux")
color = fields.Integer(string="Couleur")
# © 2019 Le Filament (http://www.le-filament.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class ProjectTask(models.Model):
_inherit = "project.task"
estimated_remaining_hours = fields.Float(
string="Heures restantes estimées",
compute="_compute_estimated_remaining_hours",
tracking=True,
store=True,
)
manual_remaining_hours = fields.Float(string="Heures restantes estimées - Manuel")
remaining_hours_calculation = fields.Selection(
[("manual", "Manuel"), ("auto", "Automatique")],
string="Calcul Heures estimées",
default="auto",
required=True,
)
@api.depends(
"planned_hours", "remaining_hours_calculation", "timesheet_ids.unit_amount"
)
def _compute_estimated_remaining_hours(self):
for task in self:
if task.remaining_hours_calculation == "auto":
if task.remaining_hours >= 0:
task.estimated_remaining_hours = task.remaining_hours
else:
task.estimated_remaining_hours = 0
else:
task.estimated_remaining_hours = task.manual_remaining_hours
def show_task(self):
view_id = self.env.ref("project.view_task_form2").id
context = self._context.copy()
return {
"name": "Tâche",
"view_type": "form",
"view_mode": "tree",
"views": [(view_id, "form")],
"res_model": "project.task",
"view_id": view_id,
"type": "ir.actions.act_window",
"res_id": self.id,
"target": "new",
"context": context,
}
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_ecozimut_project_perf,access_ecozimut_project_perf,model_ecozimut_project_perf,base.group_user,1,1,1,1
access_project_categorie,access_project_categorie,model_project_categorie,base.group_user,1,0,0,0
project.access_project_task,project.task,project.model_project_task,project.group_project_user,1,1,1,1
access_project_task_user,project.task.user.lf,project.model_project_task,project.group_project_user,1,0,0,0
access_project_task_manager,project.task.manager.lf,project.model_project_task,project.group_project_manager,1,1,1,1
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2019 Le Filament (<https://www.le-filament.com>)
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<record id="view_account_analytic_line_tree_inherit_account_lf" model="ir.ui.view">
<field name="name">Le Filament Analytic List</field>
<field name="model">account.analytic.line</field>
<field
name="inherit_id"
ref="account.view_account_analytic_line_tree_inherit_account"
/>
<field eval="101" name="priority" />
<field name="arch" type="xml">
<xpath expr="//field[@name='ref']" position="attributes">
<attribute name="invisible">True</attribute>
</xpath>
<xpath expr="//field[@name='ref']" position="after">
<field name="move_id" />
</xpath>
</field>
</record>
<record id="view_account_analytic_account_ecozimut_form" model="ir.ui.view">
<field name="name">Ecozimut Analytic Form</field>
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="analytic.view_account_analytic_account_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="categorie" />
</xpath>
</field>
</record>
<record id="analytic.action_analytic_account_form" model="ir.actions.act_window">
<field name="view_mode">kanban,tree,form,pivot,graph</field>
</record>
</odoo>
<odoo>
<data>
<record id="ecozimut_account_move_view" model="ir.ui.view">
<field name="name">ecozimut.account.move.view</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form" />
<field name="arch" type="xml">
<xpath expr="//group" position="before">
<group>
<group>
<field
name="project_id"
string="Valeur"
attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'out_receipt'))], 'readonly': [('state', '!=', 'draft')]}"
context="{'default_use_tasks': True, 'default_project_type': 'project'}"
domain="[('project_type','=','project')]"
/>
<field
name="description"
string="Intitulé"
attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'out_receipt'))], 'readonly': [('state', '!=', 'draft')]}"
/>
</group>
</group>
</xpath>
</field>
</record>
</data>
</odoo>
<odoo>
<data>
<!-- Form view -->
<record id="view_project_project_form_view" model="ir.ui.view">
<field name="name">view.project.project.form.view</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.view_project" />
<field name="arch" type="xml">
<xpath expr="//field[@name='name']" position="after">
<field name="categorie" string="Type" />
</xpath>
</field>
</record>
<!-- Form view -->
<record id="ecozimut_project_view" model="ir.ui.view">
<field name="name">ecozimut.project.view</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project" />
<field name="arch" type="xml">
<!-- Header -->
<xpath expr="//sheet" position="before">
<header>
<field name="state" widget="statusbar" clickable="True" />
</header>
</xpath>
<!-- Button Box -->
<div class="oe_button_box" position="inside">
<button
class="oe_stat_button"
name="sale_tree_view"
type="object"
icon="fa-usd"
>
<field
string="Devis/Bons de commande"
name="sale_count"
widget="statinfo"
/>
</button>
<!-- <button class="oe_stat_button" type="action"-->
<!-- name="%(sale.action_orders)d" icon="fa-usd"-->
<!-- context="{'search_default_draft': 1}">-->
<!-- <div class="o_stat_info">-->
<!-- <field name="sale_count" class="o_stat_value"/>-->
<!-- <span class="o_stat_text"> Devis/Commandes </span>-->
<!-- </div>-->
<!-- </button>-->
</div>
<!-- Sheet fields -->
<xpath expr="//field[@name='partner_id']" position="after">
<field name="categorie" string="Type" />
<field name="estimation" string="Estimation" widget="float_time" />
<field name="heures_passees" readonly="1" widget="float_time" />
<field name="heures_restantes" readonly="1" widget="float_time" />
</xpath>
<!-- Notebook -->
<xpath expr="//notebook" position="inside">
<page string="Detail">
<group>
<group>
<field name="moa" string="MOA" />
<field name="moe" string="MOE mandataire" />
<field name="archi" />
<field name="mission" />
</group>
<group>
<field name="surface_sdp" />
<field name="cost_works" />
<field name="perf_ids" widget="many2many_tags" />
<field name="be" />
<field
name="deliveryDate"
string="Date de livraison prévisionnelle"
/>
</group>
</group>
</page>
<page string="Devis/Factures">
<field name="sale_order_ids" mode="tree">
<tree string="Liste des commandes">
<field name="name" />
<field name="date_order" />
<field name="amount_untaxed" sum="Total HT" />
<field name="state" />
</tree>
</field>
<field name="account_invoice" mode="tree">
<tree string="Liste des factures">
<field name="name" />
<field name="invoice_date" />
<field name="amount_residual" sum="Balance" />
<field
name="amount_untaxed"
string="Total HT"
sum="Total HT"
/>
<field name="state" invisible="1" />
<field name="payment_state" />
</tree>
</field>
</page>
</xpath>
</field>
</record>
<!-- Search view -->
<record id="view_project_project_filter_inherit" model="ir.ui.view">
<field name="name">view.project.project.filter.inherit</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.view_project_project_filter" />
<field name="arch" type="xml">
<xpath expr="//filter[@name='inactive']" position="after">
<filter
string="Templates"
name="ecozimut_filter_template_project"
domain="[('project_type','=','template_project')]"
/>
</xpath>
<xpath expr="//filter[@name='inactive']" position="after">
<filter
string="Projets"
name="ecozimut_filter_project"
domain="[('project_type','=','project')]"
/>
</xpath>
<xpath expr="//filter[@name='inactive']" position="after">
<filter
name="group_project_categorie"
string="Type"
context="{'group_by':'categorie'}"
/>
</xpath>
</field>
</record>
<!-- Actions -->
<record model="ir.actions.act_window" id="action_window_ecozimut_project_perf">
<field name="name">Performance</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ecozimut.project.perf</field>
<field name="view_mode">tree,form</field>
</record>
<record id="project.open_view_project_all" model="ir.actions.act_window">
<field name="view_mode">kanban,tree,form,pivot,graph</field>
</record>
<!-- Menus -->
<menuitem
name="Performances"
id="menu_ecozimut_project_perf"
parent="project.menu_project_config"
action="action_window_ecozimut_project_perf"
/>
</data>
</odoo>
<odoo>
<data>
<record model="ir.ui.view" id="project_type_form_create">
<field name="name">project_type_form_create</field>
<field name="model">project.categorie</field>
<field name="arch" type="xml">
<form string="Projet">
<sheet string="Create type">
<group>
<field name="name" string="Type" />
<field name="rate" string="Rate" />
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_window_project_type">
<field name="name">Project Type</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">project.categorie</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem
name="Project type"
id="menu_project_type"
parent="project.menu_project_config"
action="action_window_project_type"
/>
</data>
</odoo>
<odoo>
<data>
<record id="view_project_task_ecozimut_form_view" model="ir.ui.view">
<field name="name">view.project.task.ecozimut.form.view</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_form2" />
<field name="arch" type="xml">
<xpath expr="//field[@name='planned_hours']" position="after">
<field
name="estimated_remaining_hours"
class="oe_read_only"
widget="float_time"
/>
<field
name="manual_remaining_hours"
class="oe_edit_only"
attrs="{'invisible':[('remaining_hours_calculation', '=', 'auto')]}"
widget="float_time"
/>
<field name="remaining_hours_calculation" widget="radio" />
</xpath>
</field>
</record>
<record id="project.action_view_all_task" model="ir.actions.act_window">
<field
name="view_mode"
>tree,kanban,form,calendar,timeline,pivot,graph,activity</field>
</record>
<record id="view_task_tree2" model="ir.ui.view">
<field name="name">project.task.inherit.tree</field>
<field name="model">project.task</field>
<field name="inherit_id" ref="project.view_task_tree2" />
<field eval="101" name="priority" />
<field name="arch" type="xml">
<tree position="replace">
<tree string="Tâches" editable="top" multi_edit="1" sample="1">
<button
name="show_task"
type="object"
class="btn btn-link btn-sm"
icon="fa-tasks"
/>
<field name="message_needaction" invisible="1" readonly="1" />
<field name="is_closed" invisible="1" />
<field name="sequence" invisible="1" readonly="1" />
<field name="name" />
<field name="allow_subtasks" invisible="1" />
<field name="project_id" optional="show" readonly="1" />
<field name="partner_id" optional="hide" />
<field
name="parent_id"
groups="project.group_subtask_project"
optional="hide"
/>
<field
name="user_id"
optional="show"
widget="many2one_avatar_user"
/>
<field
name="planned_hours"
optional="show"
widget="timesheet_uom_no_toggle"
/>
<field
name="remaining_hours"
optional="show"
widget="timesheet_uom"
/>
<field
name="estimated_remaining_hours"
optional="show"
widget="timesheet_uom"
/>
<field
name="manual_remaining_hours"
optional="show"
widget="float_time"
/>
<field
name="company_id"
groups="base.group_multi_company"
optional="show"
/>
<field
name="activity_ids"
widget="list_activity"
optional="hide"
/>
<field
name="date_deadline"
optional="show"
attrs="{'invisible': [('is_closed', '=', True)]}"
/>
<field
name="tag_ids"
widget="many2many_tags"
options="{'color_field': 'color'}"
optional="show"
/>
<field
name="kanban_state"
widget="state_selection"
optional="hide"
readonly="1"
/>
<field
name="stage_id"
invisible="context.get('set_visible',False)"
optional="hide"
readonly="1"
/>
<field
name="subtask_effective_hours"
widget="timesheet_uom"
attrs="{'invisible' : [('allow_subtasks', '=', False)]}"
optional="hide"
/>
<field
name="total_hours_spent"
widget="timesheet_uom"
attrs="{'invisible' : [('allow_subtasks', '=', False)]}"
optional="hide"
/>
<field
name="progress"
widget="progressbar"
optional="show"
groups="hr_timesheet.group_hr_timesheet_user"
/>
</tree>
</tree>
</field>
</record>
<record id="view_task_calendar" model="ir.ui.view">
<field name="name">project.task.calendar.inherit</field>
<field name="inherit_id" ref="project.view_task_calendar" />
<field name="model">project.task</field>
<field name="arch" type="xml">
<xpath expr="//calendar" position="attributes">
<attribute name="mode" />
<attribute name="js_class" />
</xpath>
</field>
</record>
</data>
</odoo>
# © 2018 Le Filament (http://www.le-filament.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import sale_make_invoice_advance
# © 2018 Le Filament (http://www.le-filament.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models
class SaleAdvancePaymentInv(models.TransientModel):
_inherit = "sale.advance.payment.inv"
# advance_payment_method = fields.Selection([
# ('delivered', 'Invoiceable lines')
# ], string='What do you want to invoice?', default='delivered', required=True)
def _create_invoice(self, order, so_line, amount):
invoice = super(SaleAdvancePaymentInv, self)._create_invoice(
order, so_line, amount
)
invoice["project_id"] = order.project_id.id or False
return invoice
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter