Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
fb685fd
PORT agreement_sale
bealdav Apr 5, 2019
bcee295
FIX agreement_sale: oca remarks
bealdav Apr 6, 2019
4a6f7d8
Update ir.model.access.csv
max3903 Apr 10, 2019
bec5c3d
Update __manifest__.py
max3903 Apr 10, 2019
73f5abb
[UPD] Update agreement_sale.pot
oca-travis Apr 11, 2019
e227ee8
[UPD] README.rst
OCA-git-bot Jul 29, 2019
5a4bd1a
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Sep 4, 2019
07795da
Translated using Weblate (Chinese (Simplified))
liweijie0812 Sep 4, 2019
0cc1807
[IMP] move some notions from agreement_legal to agreement
gurneyalex Sep 27, 2019
ee94878
[UPD] Update agreement_sale.pot
oca-travis Oct 15, 2019
e0ed001
Update translation files
oca-transbot Oct 15, 2019
ee3f13d
Translated using Weblate (Chinese (Simplified))
liweijie0812 Oct 16, 2019
ad201d1
Added translation using Weblate (German)
marcelsavegnago Feb 12, 2020
043a9f7
Added translation using Weblate (Spanish)
marcelsavegnago Feb 12, 2020
dde1590
Added translation using Weblate (French)
marcelsavegnago Feb 12, 2020
e7dd71c
Added translation using Weblate (Italian)
marcelsavegnago Feb 12, 2020
74dac88
Added translation using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 12, 2020
2ea0946
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 12, 2020
6ff7ad2
[IMP] New icon for agreement modules (svg file in agreement_legal)
marcelsavegnago Feb 15, 2020
edd9418
Added translation using Weblate (Portuguese)
pedrocs-exo Feb 17, 2020
eb77636
Translated using Weblate (Portuguese)
pedrocs-exo Feb 17, 2020
7c6578b
Translated using Weblate (Portuguese)
alvarorib Feb 18, 2020
733b219
agreement_sale 12.0.1.0.1
OCA-git-bot Feb 20, 2020
d45261a
[UPD] README.rst
OCA-git-bot Mar 25, 2020
c5f388c
[UPD] README.rst
OCA-git-bot Mar 25, 2020
e23f845
Re-introduce module agreement_account
alexis-via May 21, 2020
b7e2906
agreement: add tracking on important fields
alexis-via May 21, 2020
65df86e
FIX agreement type menu entry
alexis-via May 22, 2020
ebdb456
[MIG] agreement_sale and agreement_account to v13
alexis-via May 27, 2020
e19f4ed
Run pre-commit
alexis-via May 27, 2020
988d16e
Use super() instead of super(class, self)
alexis-via May 27, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions agreement_account/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
22 changes: 22 additions & 0 deletions agreement_account/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2017-2020 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Agreement Account",
"summary": "Agreement on invoices",
"version": "13.0.1.0.0",
"category": "Contract",
"author": "Akretion, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/contract",
"license": "AGPL-3",
"depends": ["base_contract", "account",],
"data": [
"security/ir.model.access.csv",
"views/agreement.xml",
"views/account_move.xml",
],
"development_status": "Beta",
"maintainers": ["alexis-via", "bealdav",],
"installable": True,
}
2 changes: 2 additions & 0 deletions agreement_account/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import agreement
from . import account_move
20 changes: 20 additions & 0 deletions agreement_account/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2017-2020 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


from odoo import fields, models


class AccountMove(models.Model):
_inherit = "account.move"

agreement_id = fields.Many2one(
comodel_name="agreement",
string="Agreement",
ondelete="restrict",
tracking=True,
readonly=True,
copy=False,
states={"draft": [("readonly", False)]},
)
43 changes: 43 additions & 0 deletions agreement_account/models/agreement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright 2017-2020 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


from odoo import fields, models


class Agreement(models.Model):
_inherit = "agreement"

invoice_ids = fields.One2many(
"account.move", "agreement_id", string="Invoices", readonly=True
)
out_invoice_count = fields.Integer(
compute="_compute_invoice_count", string="# of Customer Invoices"
)
in_invoice_count = fields.Integer(
compute="_compute_invoice_count", string="# of Vendor Bills"
)

def _compute_invoice_count(self):
base_domain = [("agreement_id", "in", self.ids), ("state", "=", "posted")]
amo = self.env["account.move"]
out_rg_res = amo.read_group(
base_domain + [("type", "in", ("out_invoice", "out_refund"))],
["agreement_id"],
["agreement_id"],
)
out_data = {
x["agreement_id"][0]: x["agreement_id_count"] for x in out_rg_res
}
in_rg_res = amo.read_group(
base_domain + [("type", "in", ("in_invoice", "in_refund"))],
["agreement_id"],
["agreement_id"],
)
in_data = {
x["agreement_id"][0]: x["agreement_id_count"] for x in in_rg_res
}
for agreement in self:
agreement.out_invoice_count = out_data.get(agreement.id, 0)
agreement.in_invoice_count = in_data.get(agreement.id, 0)
1 change: 1 addition & 0 deletions agreement_account/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Alexis de Lattre <alexis.delattre@akretion.com>
1 change: 1 addition & 0 deletions agreement_account/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module adds *Agreement* field on invoices.
3 changes: 3 additions & 0 deletions agreement_account/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_agreement_full,Full access on agreement to Financial mgr,base_contract.model_agreement,account.group_account_manager,1,1,1,1
access_agreement_type_full,Full access on agreement type to Financial mgr,base_contract.model_agreement_type,account.group_account_manager,1,1,1,1
Binary file added agreement_account/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading