Skip to content
Extraits de code Groupes Projets
Valider 7d08c894 rédigé par Thibaud - Le Filament's avatar Thibaud - Le Filament
Parcourir les fichiers

[IMP] Added contract generation

parent 166399e9
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!2[IMP] Added contract generation
......@@ -14,6 +14,7 @@
# datas
# views
"views/financial_contract.xml",
"views/financial_deal_tool.xml",
"views/financial_deal.xml",
# views menu
# wizard
......
from . import financial_contract
from . import financial_deal
from . import financial_deal_tool
# Copyright 2023- Le Filament (https://le-filament.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from odoo import models
class TemplateModel(models.Model):
_inherit = "financial.deal.tool"
# ------------------------------------------------------
# Fields declaration
# ------------------------------------------------------
# ------------------------------------------------------
# SQL Constraints
# ------------------------------------------------------
# ------------------------------------------------------
# Default methods
# ------------------------------------------------------
# ------------------------------------------------------
# Computed fields / Search Fields
# ------------------------------------------------------
# ------------------------------------------------------
# Onchange / Constraints
# ------------------------------------------------------
# ------------------------------------------------------
# CRUD methods (ORM overrides)
# ------------------------------------------------------
# ------------------------------------------------------
# Actions
# ------------------------------------------------------
def btn_init_contract(self):
self.deal_id.contract_ids = [
(
0,
0,
{
"description": self.deal_id.description,
"name": "An incoming sequence",
"partner_id": self.deal_id.partner_id.id,
"deal_tool_id": self.id,
},
)
]
# ------------------------------------------------------
# Business methods
# ------------------------------------------------------
......@@ -13,7 +13,8 @@
<field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page name="contracts" string="Contrats">
<field name="contract_ids" />
<field name="contract_ids"
context="{'default_partner_id':partner_id}"/>
</page>
</xpath>
</field>
......
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="financial_deal_tool_view_tree_inherit_manager_tool"
model="ir.ui.view">
<field name="name">financial deal tool inherit in manager tool</field>
<field name="model">financial.deal.tool</field>
<field name="inherit_id"
ref="financial_deal_flow.financial_deal_tool_view_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='amount']" position="after">
<field name="deal_id" invisible="1"/>
<button
name="btn_init_contract"
type="object"
icon="fa-share"
title="transform into tool"
/>
</xpath>
</field>
</record>
</data>
</odoo>
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