added .xml

This commit is contained in:
Benoît Vézina 2023-11-07 12:36:00 -05:00
parent b3c43bfdc8
commit ac9fb2b141
3 changed files with 49 additions and 1 deletions

View file

@ -28,7 +28,7 @@
'data': [
'views/res_partner_views.xml',
'data/mail_template_data.xml',
'data/template_data'
'data/template_data.xml'
],
'license': 'AGPL-3',
'author': 'Bemade',

View file

@ -0,0 +1,21 @@
{
'name': 'Sale Order Line Sequence View Modification',
'version': '1.0',
'summary': 'Modifies the Sale Order Line View to show Sequence twice',
'sequence': 10,
'description': """
This module modifies the Sale Order Line view to display the sequence field as both a handle widget and a number.
""",
'category': 'Sales Management',
'author': 'Bemade',
'website': 'https://www.bemade.org',
'depends': ['sale_management'],
'data': [
'views/sale_order_view.xml',
],
'demo': [],
'installable': True,
'application': False,
'auto_install': False,
'license': 'LGPL-3',
}

View file

@ -0,0 +1,27 @@
To modify the sale.order.line view so that the sequence field is shown twice, once as a widget and once as a regular number field, you would need to modify the form view of the sale.order model where the sale.order.line is defined as a One2many field (usually with a tree view inside a form view).
Here is an example of how you can extend the view in an XML file within your custom module:
xml
Copy code
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<!-- Inherit the view where you want to make changes -->
<record id="view_order_form_inherit_sequence" model="ir.ui.view">
<field name="name">sale.order.form.inherit.sequence</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<!-- Locate the tree view of the sale order line you want to modify -->
<xpath expr="//field[@name='order_line']/tree" position="inside">
<!-- Add the sequence field as a widget handle -->
<field name="sequence" widget="handle"/>
<!-- Add the sequence field again as a number -->
<field name="sequence" string="Sequence Number"/>
</xpath>
</field>
</record>
</data>
</odoo>