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

[add] tab on payment.order for SDD file download

parent bce0406b
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
"security/ir.model.access.csv", "security/ir.model.access.csv",
"views/account_invoice.xml", "views/account_invoice.xml",
"views/account_payment_term.xml", "views/account_payment_term.xml",
"views/account_payment_order.xml",
"views/res_config_settings.xml", "views/res_config_settings.xml",
"views/scop_cotisation_task.xml", "views/scop_cotisation_task.xml",
], ],
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# 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 account_invoice from . import account_invoice
from . import account_payment_order
from . import account_payment_term from . import account_payment_term
from . import chart_template from . import chart_template
from . import res_company from . import res_company
......
# Copyright 2020 Le Filament
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models, api
class ModelName(models.Model):
_inherit = 'account.payment.order'
attachment_ids = fields.One2many(
comodel_name='ir.attachment',
compute='_compute_attachment_ids'
)
@api.multi
def _compute_attachment_ids(self):
Attachment = self.env['ir.attachment']
for po in self:
po.attachment_ids = Attachment.search([
('res_model', '=', 'account.payment.order'),
('res_id', '=', po.id)
])
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Copyright 2020 Le Filament
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<data>
<record id="account_payment_order_form" model="ir.ui.view">
<field name="name">account.payment.order.form</field>
<field name="model">account.payment.order</field>
<field name="inherit_id" ref="account_payment_order.account_payment_order_form"/>
<field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page name="attachments" string="Fichiers de prélèvements">
<field name="attachment_ids">
<tree>
<field name="create_date"/>
<field name="name"/>
<field name="type"/>
<field name="datas" filename="datas_fname"/>
<field name="create_uid"/>
</tree>
<form>
<h1><field name="name"/></h1>
<group>
<group>
<field name="datas" filename="datas_fname" attrs="{'invisible':[('type','=','url')]}" string="Télécharger le fichier"/>
<field name="datas_fname" invisible="1" attrs="{'invisible':[('type','=','url')]}" class="oe_inline oe_right"/>
<field name="url" widget="url" attrs="{'invisible':[('type','=','binary')]}"/>
<field name="mimetype" groups="base.group_no_one"/>
<field name="type"/>
</group>
<group>
<field name="create_uid"/>
<field name="create_date"/>
</group>
</group>
</form>
</field>
</page>
</xpath>
</field>
</record>
</data>
</odoo>
\ No newline at end of file
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