-
Notifications
You must be signed in to change notification settings - Fork 1
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_partner_invoice_period
Adds a selector of period to invoice directions.
- Loading branch information
1 parent
d56870d
commit e53debf
Showing
10 changed files
with
113 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,19 @@ | ||
# © 2024 Solvos Consultoría Informática (<http://www.solvos.es>) | ||
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html | ||
{ | ||
"name": "Partner Invoice Period", | ||
"summary": """ Adds selection of period to invoice direction """, | ||
"author": "Solvos", | ||
"license": "LGPL-3", | ||
"version": "17.0.1.0.0", | ||
"category": "Sales/Sales", | ||
"website": "https://github.com/solvosci/slv-sale", | ||
"depends": [ | ||
"sale" | ||
], | ||
"data": [ | ||
"views/res_partner_view.xml", | ||
"views/sale_order_view.xml" | ||
], | ||
'installable': True, | ||
} |
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 res_partner | ||
from . import sale_order |
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,18 @@ | ||
# © 2024 Solvos Consultoría Informática (<http://www.solvos.es>) | ||
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html | ||
from odoo import models, fields | ||
|
||
class ResPartner(models.Model): | ||
_inherit = "res.partner" | ||
|
||
|
||
invoice_period = fields.Selection( | ||
[ | ||
('daily','Daily'), | ||
('weekly','Weekly'), | ||
('fortnightly','Fortnightly'), | ||
('monthly','Monthly'), | ||
('quarterly','Quarterly'), | ||
('yearly','Yearly') | ||
] | ||
) |
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 @@ | ||
# © 2024 Solvos Consultoría Informática (<http://www.solvos.es>) | ||
# License LGPL-3 - See http://www.gnu.org/licenses/lgpl-3.0.html | ||
from odoo import models, fields, api | ||
|
||
class SaleOrder(models.Model): | ||
_inherit = "sale.order" | ||
|
||
partner_invoice_period = fields.Selection( | ||
related='partner_invoice_id.invoice_period', | ||
string="Invoice Period", | ||
store=True | ||
) |
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 @@ | ||
* Dante Pereyra <[email protected]> |
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 @@ | ||
Adds a selector of period to invoice directions. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions
18
sale_order_partner_invoice_period/views/res_partner_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,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
|
||
<record id="view_partner_form_inherit" model="ir.ui.view"> | ||
<field name="name">res.partner.view.form.inherit</field> | ||
<field name="model">res.partner</field> | ||
<field name="inherit_id" ref="base.view_partner_form"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='vat']" position="after"> | ||
<field name="invoice_period" invisible="type != 'invoice'"/> | ||
</xpath> | ||
<xpath expr="//field[@name='child_ids']//form//field[@name='mobile']" position="after"> | ||
<field name="invoice_period" invisible="type != 'invoice'"/> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
41 changes: 41 additions & 0 deletions
41
sale_order_partner_invoice_period/views/sale_order_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,41 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
|
||
<record id="view_order_form_inherit" model="ir.ui.view"> | ||
<field name="name">sale.order.view.form.inherit</field> | ||
<field name="model">sale.order</field> | ||
<field name="inherit_id" ref="sale.view_order_form"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='payment_term_id']" position="after"> | ||
<field name="partner_invoice_period"/> | ||
</xpath> | ||
|
||
</field> | ||
</record> | ||
|
||
<record id="view_sales_order_filter_inherit" model="ir.ui.view"> | ||
<field name="name">sale.order.searh.inherit</field> | ||
<field name="model">sale.order</field> | ||
<field name="inherit_id" ref="sale.view_sales_order_filter"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//search" position="inside"> | ||
<field name="partner_invoice_period"/> | ||
<filter name="partner_invoice_period" domain="[]" context="{'group_by': 'partner_invoice_period'}"/> | ||
</xpath> | ||
|
||
</field> | ||
</record> | ||
|
||
<record id="sale_order_tree_inherit" model="ir.ui.view"> | ||
<field name="name">sale.order.view.tree.inherit</field> | ||
<field name="model">sale.order</field> | ||
<field name="inherit_id" ref="sale.sale_order_tree"/> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='expected_date']" position="after"> | ||
<field name="partner_invoice_period" optional="hide"/> | ||
</xpath> | ||
|
||
</field> | ||
</record> | ||
|
||
</odoo> |