forked from avanzosc/sale-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] sale_order_line_commitment_date_and_delivery_address
- Loading branch information
Showing
5 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
sale_order_line_commitment_date_and_delivery_address/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
1 change: 1 addition & 0 deletions
1
sale_order_line_commitment_date_and_delivery_address/__manifest__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
1 change: 1 addition & 0 deletions
1
sale_order_line_commitment_date_and_delivery_address/models/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import sale_order_line |
15 changes: 15 additions & 0 deletions
15
sale_order_line_commitment_date_and_delivery_address/models/sale_order_line.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) |
26 changes: 26 additions & 0 deletions
26
sale_order_line_commitment_date_and_delivery_address/views/sale_order_line_view.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |