diff --git a/__manifest__.py b/__manifest__.py index 908e4f7b5194628f02b03dbd716082ad36d2919c..008001abf09bb5dda71a54ed8520602fbbf30425 100644 --- a/__manifest__.py +++ b/__manifest__.py @@ -5,7 +5,9 @@ "website": "https://le-filament.com", "version": "16.0.1.0.0", "license": "AGPL-3", - "depends": ["financial_contract",], + "depends": [ + "financial_contract", + ], "data": [ # security "security/ir.model.access.csv", diff --git a/models/financial_contract.py b/models/financial_contract.py index 0a2c4569da812cfbd27878c88da52dc8a12a09b1..f717a7e21b33a91a2375fd16d9bec2f41b1c92d8 100644 --- a/models/financial_contract.py +++ b/models/financial_contract.py @@ -1,7 +1,7 @@ # © 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 +from odoo import fields, models class FinancialContract(models.Model): @@ -9,9 +9,9 @@ class FinancialContract(models.Model): tool = fields.Selection( selection_add=[ - ('financial.contract.guarantee', 'Prêt'), + ("financial.contract.guarantee", "Prêt"), ], - ondelete={'financial.contract.guarantee': 'cascade'} + ondelete={"financial.contract.guarantee": "cascade"}, ) # ------------------------------------------------------ diff --git a/models/financial_contract_guarantee.py b/models/financial_contract_guarantee.py index 2bce7f22fe47c6f1317d1d314bff0348c36bb837..2e0dd0e297298b34dc73cb3619ed48dcab5ece43 100644 --- a/models/financial_contract_guarantee.py +++ b/models/financial_contract_guarantee.py @@ -7,19 +7,25 @@ from odoo import fields, models class FinancialContractGuarantee(models.Model): _name = "financial.contract.guarantee" _inherit = [ - "mail.thread", "mail.activity.mixin", + "mail.thread", + "mail.activity.mixin", ] _inherits = {"financial.contract": "contract_id"} _description = "Financial contract guarantee" _check_company_auto = True - _rec_names_search = ["name", "number", "partner_id.name", "partner_id.member_number"] + _rec_names_search = [ + "name", + "number", + "partner_id.name", + "partner_id.member_number", + ] _order = "create_date desc" external_loan_id = fields.Many2one( comodel_name="financial.contract", string="Prêt lié", domain="[('partner_id', '=', partner_id), ('type', '=', 'loan'), " - "('deal_type', '=', 'external')]", + "('deal_type', '=', 'external')]", financial_tool_type="guarantee", ) guarantee_rate = fields.Float("Quotité garantie", tracking=1) diff --git a/models/financial_product_template_guarantee.py b/models/financial_product_template_guarantee.py index 8857afab5ed0b7078b4d07e7e4b0063e25ae1d3e..06494dbf5e55448ed96f71957c24f06347f72c1b 100644 --- a/models/financial_product_template_guarantee.py +++ b/models/financial_product_template_guarantee.py @@ -1,28 +1,30 @@ # © 2024 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 -from odoo.exceptions import UserError +from odoo import fields, models class FinancialProductTemplateGuarantee(models.Model): _name = "financial.product.template.guarantee" - _inherit = ["mail.thread", "mail.activity.mixin",] + _inherit = [ + "mail.thread", + "mail.activity.mixin", + ] _inherits = {"financial.product.template": "product_id"} _description = "Financial product template guarantee" tool = fields.Selection( selection_add=[ - ('financial.contract.guarantee', 'Garantie'), + ("financial.contract.guarantee", "Garantie"), ], - ondelete={'financial.contract.guarantee': 'cascade'} + ondelete={"financial.contract.guarantee": "cascade"}, ) product_id = fields.Many2one( comodel_name="financial.product.template", string="Produit", required=True, index=True, - ondelete="cascade" + ondelete="cascade", ) # ------------------------------------------------------ # Constrains functions diff --git a/security/ir.model.access.csv b/security/ir.model.access.csv index 6af22bfddbd5706771155d210686939bd14df0e5..ac9637ca65764862b4a599211bc5b953aa05601b 100644 --- a/security/ir.model.access.csv +++ b/security/ir.model.access.csv @@ -1,2 +1,2 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_financial_contract_guarantee,access_financial_contract_guarantee,model_financial_contract_guarantee,financial_contract.group_financial_user,1,1,1,1 \ No newline at end of file +access_financial_contract_guarantee,access_financial_contract_guarantee,model_financial_contract_guarantee,financial_contract.group_financial_user,1,1,1,1 diff --git a/static/description/icon.png b/static/description/icon.png old mode 100644 new mode 100755 index 14bfd225a492a9b2f7aaec2f6cf8d4ce9385fd50..82ef47760a441cf229b5009f0a18ccf3842fbfa5 Binary files a/static/description/icon.png and b/static/description/icon.png differ diff --git a/views/financial_contract_guarantee.xml b/views/financial_contract_guarantee.xml index 5e84ae18433533d279348fcf22c68ba436745d9e..78d8e22607fddba3eac0e19f87c77c798a9ff67b 100644 --- a/views/financial_contract_guarantee.xml +++ b/views/financial_contract_guarantee.xml @@ -33,7 +33,10 @@ <record model="ir.ui.view" id="financial_contract_guarantee_form_view"> <field name="name">financial.contract.guarantee.form</field> <field name="model">financial.contract.guarantee</field> - <field name="inherit_id" ref="financial_contract.financial_contract_form_view" /> + <field + name="inherit_id" + ref="financial_contract.financial_contract_form_view" + /> <field name="mode">primary</field> <field name="arch" type="xml"> <xpath expr="//group" position="inside"> @@ -54,7 +57,10 @@ </record> <!-- Action --> - <record model="ir.actions.act_window" id="financial_contract_guarantee_action"> + <record + model="ir.actions.act_window" + id="financial_contract_guarantee_action" + > <field name="name">Garanties</field> <field name="res_model">financial.contract.guarantee</field> <field name="view_mode">tree,form</field>