تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
116 أدوات العرض

Bonjour,

Je cherche à rajouter une colonne dans un formulaire de facture.

Pour l'instant j'ai Produit - quantité - prix - taxes - montant, je voudrais rajouter une colonne "date(s)". Je loue des espaces. Il me faut donc Produit - date(s)- quantité - prix - taxes - montant.


Je ne sais pas si c'est paramétrable dans l'app factures


Merci



الصورة الرمزية
إهمال
أفضل إجابة

Hi,


By using the custom model you can add the field in invoice.


1- In your custom module, extend the account.move.line model:


from odoo import fields, models


class AccountMoveLine(models.Model):

    _inherit = 'account.move.line'


    rental_dates = fields.Char(string="Date(s)")


2- And extend the invoice line tree view:


<odoo>

    <record id="view_move_form_inherit_dates" model="ir.ui.view">

        <field name="name">account.move.form.inherit.dates</field>

        <field name="model">account.move</field>

        <field name="inherit_id" ref="account.view_move_form"/>

        <field name="arch" type="xml">

            <xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='product_id']" position="after">

                <field name="rental_dates"/>

            </xpath>

        </field>

    </record>

</odoo>


* After installing this, your invoice lines will have a Date(s) column.

* You can make it fields. Date if you want only one date, or fields.Text if you want a range.



You can also do this using the studio module.


Hope it helps

الصورة الرمزية
إهمال