added .xml
This commit is contained in:
parent
b3c43bfdc8
commit
ac9fb2b141
3 changed files with 49 additions and 1 deletions
|
|
@ -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',
|
||||
|
|
|
|||
21
bemade_sale_order_line_number/__manifest__.py
Normal file
21
bemade_sale_order_line_number/__manifest__.py
Normal 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',
|
||||
}
|
||||
27
bemade_sale_order_line_number/views/sale_order_views.xml
Normal file
27
bemade_sale_order_line_number/views/sale_order_views.xml
Normal 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>
|
||||
Loading…
Reference in a new issue