Skip to content

Commit

Permalink
[ADD] sale_order_line_commitment_date_and_delivery_address
Browse files Browse the repository at this point in the history
  • Loading branch information
unaiberis committed Sep 17, 2024
1 parent 9febcd7 commit e6a0b01
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{'name': 'Sale Order Line Commitment Date and Delivery Address', 'version': '16.0.1.0.0', 'author': 'Avanzosc', 'summary': 'Add commitment date and delivery address fields to sale order lines.', 'website': 'https://github.com/avanzosc/sale-order-addons', 'license': 'LGPL-3', 'depends': ['sale_management'], 'data': ['views/sale_order_line_view.xml'], 'installable': True, 'application': False}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale_order_line
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from odoo import models, fields

class SaleOrderLine(models.Model):
_inherit = "sale.order.line"

commitment_date = fields.Date(
related="order_id.commitment_date",
string="Commitment Date",
store=True,
)
delivery_address = fields.Char(
related="order_id.partner_id.contact_address",
string="Delivery Address",
store=True,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_order_line_tree_inherit" model="ir.ui.view">
<field name="name">sale.order.line.tree.inherit</field>
<field name="model">sale.order.line</field>
<field name="inherit_id" ref="sale.view_order_line_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="inside">
<field name="commitment_date" />
<field name="delivery_address" />
</xpath>
</field>
</record>

<record id="view_order_line_search_inherit" model="ir.ui.view">
<field name="name">sale.order.line.search.inherit</field>
<field name="model">sale.order.line</field>
<field name="inherit_id" ref="sale.view_sales_order_line_filter"/>
<field name="arch" type="xml">
<xpath expr="//group" position="inside">
<filter string="Commitment Date" name="group_by_commitment_date" domain="[]" context="{'group_by': 'commitment_date'}"/>
<filter string="Delivery Address" name="group_by_delivery_address" domain="[]" context="{'group_by': 'delivery_address'}"/>
</xpath>
</field>
</record>
</odoo>

0 comments on commit e6a0b01

Please sign in to comment.