-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] New module account_move_line_vehicle_search
- Loading branch information
Showing
9 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
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 |
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,22 @@ | ||
{ | ||
"name": "Account Move Line Vehicle Search", | ||
"version": "14.0.1.0.0", | ||
"category": "Accounting", | ||
"summary": "Search account move lines by vehicle name and serial number ID", | ||
"author": "Avanzosc", | ||
"website": "https://github.com/avanzosc/odoo-addons", | ||
"license": "AGPL-3", | ||
"depends": [ | ||
"base", | ||
"account", | ||
"fleet", | ||
"account_fleet", | ||
"stock_production_lot_fleet_vehicle", | ||
], | ||
"data": [ | ||
"views/account_move_line_views.xml", | ||
"views/account_move_views.xml", | ||
], | ||
"installable": True, | ||
"application": False, | ||
} |
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,2 @@ | ||
from . import account_move | ||
from . import account_move_line |
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,19 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class AccountMove(models.Model): | ||
_inherit = "account.move" | ||
|
||
vehicle_id = fields.Many2one( | ||
"fleet.vehicle", | ||
string="Vehicle", | ||
related="line_ids.vehicle_id", | ||
readonly=True, | ||
) | ||
|
||
serial_number_id = fields.Many2one( | ||
"fleet.vehicle", | ||
string="Serial Number", | ||
related="line_ids.serial_number_id", | ||
readonly=True, | ||
) |
12 changes: 12 additions & 0 deletions
12
account_move_line_vehicle_search/models/account_move_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,12 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class AccountMoveLine(models.Model): | ||
_inherit = "account.move.line" | ||
|
||
serial_number_id = fields.Many2one( | ||
"fleet.vehicle", | ||
"Serial Number", | ||
related="vehicle_id.serial_number_id", | ||
readonly=True, | ||
) |
20 changes: 20 additions & 0 deletions
20
account_move_line_vehicle_search/views/account_move_line_views.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,20 @@ | ||
<odoo> | ||
<record id="" model="ir.ui.view"> | ||
<field name="name">account.move.line.search.inherit</field> | ||
<field name="model">account.move.line</field> | ||
<field name="inherit_id" ref="account.view_account_move_line_filter" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//group" position="inside"> | ||
<field name="vehicle_id" /> | ||
<field name="serial_number_id" /> | ||
</xpath> | ||
<xpath expr="//filter[@name='purchases']" position="after"> | ||
<filter | ||
string="Serial Number" | ||
name="filter_serial_number_id" | ||
context="{'group_by':'serial_number_id'}" | ||
/> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
39 changes: 39 additions & 0 deletions
39
account_move_line_vehicle_search/views/account_move_views.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,39 @@ | ||
<odoo> | ||
<record id="view_account_move_search_inherit" model="ir.ui.view"> | ||
<field name="name">account.move.search.inherit</field> | ||
<field name="model">account.move</field> | ||
<field name="inherit_id" ref="account.view_account_move_filter" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//group" position="inside"> | ||
<field name="vehicle_id" /> | ||
<field name="serial_number_id" /> | ||
</xpath> | ||
<xpath expr="//filter[@name='purchases']" position="after"> | ||
<filter | ||
string="Serial Number" | ||
name="filter_serial_number_id" | ||
context="{'group_by':'serial_number_id'}" | ||
/> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
<record id="view_account_invoice_search_inherit" model="ir.ui.view"> | ||
<field name="name">account.move.search.inherit</field> | ||
<field name="model">account.move</field> | ||
<field name="inherit_id" ref="account.view_account_invoice_filter" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//group" position="inside"> | ||
<field name="vehicle_id" /> | ||
<field name="serial_number_id" /> | ||
</xpath> | ||
<xpath expr="//filter[@name='to_check']" position="after"> | ||
<filter | ||
string="Serial Number" | ||
name="filter_serial_number_id" | ||
context="{'group_by':'serial_number_id'}" | ||
/> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
1 change: 1 addition & 0 deletions
1
setup/account_move_line_vehicle_search/odoo/addons/account_move_line_vehicle_search
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 @@ | ||
../../../../account_move_line_vehicle_search |
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,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |