-
-
Notifications
You must be signed in to change notification settings - Fork 693
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[14.0][ADD] account_move_ordering_contacts
- Loading branch information
Showing
11 changed files
with
101 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,3 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
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,16 @@ | ||
# Copyright 2021 Camptocamp | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Acccount Move Ordering Contacts", | ||
"version": "14.0.1.0.0", | ||
"summary": "Display original customers when creating invoices from" | ||
" multiple sale orders.", | ||
"author": "Camptocamp, Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/account-invoicing", | ||
"license": "AGPL-3", | ||
"category": "Accounting & Finance", | ||
"depends": ["account", "sale"], | ||
"data": ["views/account_move.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 @@ | ||
from . import account_move |
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 @@ | ||
# Copyright 2021 Camptocamp SA | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class AccountMove(models.Model): | ||
_inherit = "account.move" | ||
|
||
ordering_contact_ids = fields.Many2many( | ||
comodel_name="res.partner", | ||
relation="account_move_ordering_contact_rel", | ||
column1="account_move_id", | ||
column2="res_partner_id", | ||
compute="_compute_ordering_contact_ids", | ||
store=True, | ||
string="Ordering Contacts", | ||
) | ||
|
||
@api.depends("move_type", "invoice_line_ids.sale_line_ids.order_id.partner_id") | ||
def _compute_ordering_contact_ids(self): | ||
for move in self: | ||
move.ordering_contact_ids = ( | ||
move.move_type == "out_invoice" | ||
and move.invoice_line_ids.mapped("sale_line_ids.order_id.partner_id") | ||
) |
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,3 @@ | ||
* `Camptocamp <https://www.camptocamp.com>`_ | ||
|
||
* Silvio Gregorini <[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,3 @@ | ||
The development of this module has been financially supported by: | ||
|
||
* Camptocamp |
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 @@ | ||
When invoicing multiple sale orders at the same time, they may be grouped into | ||
a single invoice. When it happens, it is hard to retrieve who the original SO | ||
partners were. | ||
|
||
This module helps by retrieving such partners and showing them into the invoice | ||
form view, alongside the invoice partner itself. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,36 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
|
||
<record id="view_account_invoice_filter_inherit" model="ir.ui.view"> | ||
<field name="name">view.account.invoice.filter.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="//field[@name='partner_id']" position="after"> | ||
<field | ||
name="ordering_contact_ids" | ||
filter_domain="[('ordering_contact_ids.name', 'ilike', self)]" | ||
/> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
<record id="view_move_form_inherit" model="ir.ui.view"> | ||
<field name="name">view.move.form.inherit</field> | ||
<field name="model">account.move</field> | ||
<field name="inherit_id" ref="account.view_move_form" /> | ||
<field name="arch" type="xml"> | ||
<xpath | ||
expr="//group[@id='header_left_group']/field[@name='partner_id']" | ||
position="after" | ||
> | ||
<field | ||
name="ordering_contact_ids" | ||
attrs="{'invisible': [('move_type', '!=', 'out_invoice')]}" | ||
widget="many2many_tags" | ||
/> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
1 change: 1 addition & 0 deletions
1
setup/account_move_ordering_contacts/odoo/addons/account_move_ordering_contacts
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_ordering_contacts |
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, | ||
) |