Compare commits
476 Commits
14.0-imp-u
...
9.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da53473b60 | ||
|
|
667775d466 | ||
|
|
25de048402 | ||
|
|
817fadd167 | ||
|
|
25ea1991cf | ||
|
|
c8c1f78e66 | ||
|
|
0bc6cb32d9 | ||
|
|
db736d95a3 | ||
|
|
f83c948889 | ||
|
|
d736663f3f | ||
|
|
f051537a92 | ||
|
|
193e5e6ecc | ||
|
|
00592100f7 | ||
|
|
0d524f27d8 | ||
|
|
4509b2631a | ||
|
|
2ff7943c62 | ||
|
|
d85e7270b3 | ||
|
|
7b6916ce16 | ||
|
|
a9c6f9ed69 | ||
|
|
7a11966992 | ||
|
|
d4fcaa7d14 | ||
|
|
77fb97f273 | ||
|
|
9670eb7c10 | ||
|
|
f8e955d5b7 | ||
|
|
a803d1dcb9 | ||
|
|
a141f0506b | ||
|
|
7c554aee33 | ||
|
|
07c81e441d | ||
|
|
4c3c8e50db | ||
|
|
60beb99580 | ||
|
|
709bde8fb7 | ||
|
|
281c0b7052 | ||
|
|
8d55f9aaa5 | ||
|
|
964b1fca67 | ||
|
|
e20f88baf0 | ||
|
|
15d9c31f6f | ||
|
|
e74864e54f | ||
|
|
146c0e6b7d | ||
|
|
869c7176f7 | ||
|
|
4b26ab78be | ||
|
|
662494db35 | ||
|
|
aafc36dfdb | ||
|
|
e94168ad27 | ||
|
|
9b62198115 | ||
|
|
309027198a | ||
|
|
c8f1517881 | ||
|
|
6cb195a3eb | ||
|
|
b85f5184c2 | ||
|
|
2d392ce465 | ||
|
|
e71ad5f952 | ||
|
|
3905a826fa | ||
|
|
18ea374d8c | ||
|
|
f8d3340e48 | ||
|
|
9761c7527b | ||
|
|
baf7359cc7 | ||
|
|
33561ed930 | ||
|
|
aad2121f20 | ||
|
|
880cf7c7a9 | ||
|
|
d3eef1e5a5 | ||
|
|
b41f188eb4 | ||
|
|
891c64bb1f | ||
|
|
b9e07ea986 | ||
|
|
12fbd5dc2c | ||
|
|
7948193fe0 | ||
|
|
64cb3d44ad | ||
|
|
08f434b6a0 | ||
|
|
6176b37fa6 | ||
|
|
4015f5b1c9 | ||
|
|
ef920f58f4 | ||
|
|
c108f617c2 | ||
|
|
4acce9509f | ||
|
|
e9ab3187e7 | ||
|
|
13e6facec5 | ||
|
|
6c53b3c1ae | ||
|
|
a379b59597 | ||
|
|
2f179995bf | ||
|
|
7c5f04a39e | ||
|
|
b814ec11bf | ||
|
|
7d39e50ba3 | ||
|
|
77995aa125 | ||
|
|
314350efee | ||
|
|
40ef119999 | ||
|
|
6583ea0cd9 | ||
|
|
7def6a85e4 | ||
|
|
618ad6d6d6 | ||
|
|
05c0f74420 | ||
|
|
78ff16436d | ||
|
|
b4dc9da272 | ||
|
|
3aa16cdacf | ||
|
|
d823e3ae75 | ||
|
|
a1f57e1ab5 | ||
|
|
c2d2e93f07 | ||
|
|
56bdeb3ee9 | ||
|
|
b811ae890a | ||
|
|
07a444367b | ||
|
|
8a7a3c670f | ||
|
|
7f2589c9bf | ||
|
|
93e63b74b6 | ||
|
|
c2accec411 | ||
|
|
62b01c781f | ||
|
|
33b99de09e | ||
|
|
e134153a40 | ||
|
|
6812d2e68b | ||
|
|
25d8a50d3a | ||
|
|
54b74f01c0 | ||
|
|
5ac6b777b2 | ||
|
|
fd05834ffe | ||
|
|
34a763d894 | ||
|
|
30089555c5 | ||
|
|
7f62369a06 | ||
|
|
005063e8c6 | ||
|
|
08ad828da7 | ||
|
|
31c6246e2c | ||
|
|
b7dd2a6a07 | ||
|
|
ef97656b42 | ||
|
|
16627ba6f0 | ||
|
|
7cf98a1001 | ||
|
|
6e8e9fa1aa | ||
|
|
02940c08cd | ||
|
|
2dd4a7d577 | ||
|
|
e1c660d90c | ||
|
|
aa3568e986 | ||
|
|
9c67a6df5d | ||
|
|
5be71f05b3 | ||
|
|
0498f6e24e | ||
|
|
80763de94b | ||
|
|
18753eadf9 | ||
|
|
932de847b6 | ||
|
|
b7ab16477a | ||
|
|
72bd441617 | ||
|
|
c7908c38ed | ||
|
|
ad786e892f | ||
|
|
744c721950 | ||
|
|
7c2f10423f | ||
|
|
9c666ba4d9 | ||
|
|
c62a163f93 | ||
|
|
9ad2d0f7e1 | ||
|
|
907022b31d | ||
|
|
2cbb4dcfb6 | ||
|
|
8cdf8c68e8 | ||
|
|
10ebf47612 | ||
|
|
3a69e7bf69 | ||
|
|
69c975bfc5 | ||
|
|
9d8d2cf8cc | ||
|
|
9356ccc497 | ||
|
|
3e702f0186 | ||
|
|
b0110ca542 | ||
|
|
ecf5f6f843 | ||
|
|
d90bd9dd8e | ||
|
|
d794e3fcd2 | ||
|
|
e519cf89cd | ||
|
|
15ebf4a756 | ||
|
|
7a6a38aa1d | ||
|
|
0971fb48e4 | ||
|
|
41f012e0b4 | ||
|
|
dba79c83c4 | ||
|
|
f2e48cb977 | ||
|
|
8b3dd37c33 | ||
|
|
549ab31e82 | ||
|
|
3bedaa076c | ||
|
|
518628ec8c | ||
|
|
14518c7f9f | ||
|
|
354137d101 | ||
|
|
cb2ec53062 | ||
|
|
d806d1cf81 | ||
|
|
b640290962 | ||
|
|
447e5a7d82 | ||
|
|
3bc6bb2900 | ||
|
|
9a55c50563 | ||
|
|
a88c3e7f6d | ||
|
|
9c63ea19d3 | ||
|
|
38f0f5eb78 | ||
|
|
53f85a6b8e | ||
|
|
5b7cdcff37 | ||
|
|
30bc6ff801 | ||
|
|
f4574647dd | ||
|
|
1b2fada686 | ||
|
|
db55e148c3 | ||
|
|
2ceb626723 | ||
|
|
90a2f719ef | ||
|
|
4883570131 | ||
|
|
110d8b6982 | ||
|
|
6d29f236fd | ||
|
|
dd784fa245 | ||
|
|
7d0ea7967c | ||
|
|
111a42c2da | ||
|
|
f66d74499f | ||
|
|
ea195e6c75 | ||
|
|
f74828e3ea | ||
|
|
3ef6312f65 | ||
|
|
9701eb1986 | ||
|
|
dbb427e70e | ||
|
|
91ad3f0f05 | ||
|
|
2c760935af | ||
|
|
607968983b | ||
|
|
e1f8611ef3 | ||
|
|
0a154e4314 | ||
|
|
25d593710e | ||
|
|
9f2ce9dd14 | ||
|
|
7fdf51be31 | ||
|
|
ccc0684312 | ||
|
|
140349e4d8 | ||
|
|
540d7cf82c | ||
|
|
f745388f37 | ||
|
|
ad0e2f43c4 | ||
|
|
12d9934889 | ||
|
|
32553d0042 | ||
|
|
823e9ad208 | ||
|
|
f5c54ce9d0 | ||
|
|
b24182c5b6 | ||
|
|
91f400be09 | ||
|
|
4c7dc09979 | ||
|
|
15c0400805 | ||
|
|
b3bc3c923d | ||
|
|
623dca3cbf | ||
|
|
490b203943 | ||
|
|
a41d5bc3ce | ||
|
|
55d1f66d0e | ||
|
|
2617170314 | ||
|
|
f436a651cf | ||
|
|
0eedae22c6 | ||
|
|
26930e6a84 | ||
|
|
b26164e05c | ||
|
|
fcaf342d2a | ||
|
|
b5d814860e | ||
|
|
ad6a8f28eb | ||
|
|
5252ed95cd | ||
|
|
a068c534bb | ||
|
|
c67d51b303 | ||
|
|
91886211ae | ||
|
|
473b97fd7e | ||
|
|
92c89b0756 | ||
|
|
abe79d1c48 | ||
|
|
81e923def2 | ||
|
|
fb9e05b5b9 | ||
|
|
96796ebe05 | ||
|
|
72eef666eb | ||
|
|
03f4a1438c | ||
|
|
8d64f799d1 | ||
|
|
725314e497 | ||
|
|
45f3294249 | ||
|
|
7ed3a38cb2 | ||
|
|
ab464db930 | ||
|
|
704667e71e | ||
|
|
badaa404a4 | ||
|
|
0fb70e97aa | ||
|
|
1a38600aeb | ||
|
|
c3a55088ed | ||
|
|
5c3716dfe1 | ||
|
|
fec06bbb59 | ||
|
|
9b4c770382 | ||
|
|
2d7f151543 | ||
|
|
8c9c30b604 | ||
|
|
cfc24eeeee | ||
|
|
fdbc003ac7 | ||
|
|
44fcf386ee | ||
|
|
a1e4829455 | ||
|
|
0bac95c085 | ||
|
|
9f331306af | ||
|
|
613d6d688d | ||
|
|
152e94b116 | ||
|
|
60e9caf2e7 | ||
|
|
214aafd243 | ||
|
|
b140aa2abf | ||
|
|
da2c22329c | ||
|
|
83bca9318d | ||
|
|
32e2ecea37 | ||
|
|
27fc5070ec | ||
|
|
d3080b90a7 | ||
|
|
dddc24dc02 | ||
|
|
6c073b7d4d | ||
|
|
2114ce5da5 | ||
|
|
27abfa0880 | ||
|
|
340bd0857d | ||
|
|
13f9a51bff | ||
|
|
d4b979979a | ||
|
|
6aadd49592 | ||
|
|
b2ce56755f | ||
|
|
7070f7f1ec | ||
|
|
6d50815196 | ||
|
|
99f3bc3778 | ||
|
|
e081876473 | ||
|
|
1fbd4281ba | ||
|
|
45593e94fc | ||
|
|
f967e0007b | ||
|
|
3e5af98552 | ||
|
|
d365286bdf | ||
|
|
63d06b285a | ||
|
|
d67e82926a | ||
|
|
e11a62dd90 | ||
|
|
9a787e88b3 | ||
|
|
f086cb9d29 | ||
|
|
0b3c1ff510 | ||
|
|
8cd265cae3 | ||
|
|
a5507fadfc | ||
|
|
7713a1178f | ||
|
|
ea41ed7663 | ||
|
|
1f04ef8b92 | ||
|
|
165d042a6b | ||
|
|
44b3e74398 | ||
|
|
215cb70cea | ||
|
|
d9f8da2b9e | ||
|
|
58203941df | ||
|
|
f717761aa2 | ||
|
|
2ea24123da | ||
|
|
e67d9a6a3a | ||
|
|
9fdfaf9d49 | ||
|
|
154104e5a8 | ||
|
|
9f1c82aeca | ||
|
|
8eb87d249b | ||
|
|
9a3fa8dbe0 | ||
|
|
cdfbc427d1 | ||
|
|
beed014aca | ||
|
|
6347327b58 | ||
|
|
c52a8e901f | ||
|
|
db8f78e5cf | ||
|
|
54efe13723 | ||
|
|
2a5f3c460e | ||
|
|
9a678154c9 | ||
|
|
4e8f9bbf97 | ||
|
|
4e40393b14 | ||
|
|
5c95d9bd88 | ||
|
|
a6480df8c5 | ||
|
|
db690e77ea | ||
|
|
b2a7741fd3 | ||
|
|
053911edca | ||
|
|
1ff2416435 | ||
|
|
219ec0e671 | ||
|
|
fe46134a43 | ||
|
|
43ce9daf2e | ||
|
|
4842386aac | ||
|
|
f20145d06a | ||
|
|
f986bf05fd | ||
|
|
21f657616b | ||
|
|
ac91927ea1 | ||
|
|
74d8f0c23d | ||
|
|
ddb802b31a | ||
|
|
979c33a457 | ||
|
|
681be2ec9e | ||
|
|
b217a504e6 | ||
|
|
2f8e57ae28 | ||
|
|
4373d5ff4b | ||
|
|
3526e98a00 | ||
|
|
6bd38857d1 | ||
|
|
2abab0caaa | ||
|
|
de76a64f7e | ||
|
|
604dab1bb9 | ||
|
|
1bfa265278 | ||
|
|
7e868f3faa | ||
|
|
7e19809cff | ||
|
|
f5d86f7bc8 | ||
|
|
db89d01739 | ||
|
|
0bae792e79 | ||
|
|
2a311b8cb8 | ||
|
|
ae0bd93403 | ||
|
|
36929e5f48 | ||
|
|
413f8ca0fd | ||
|
|
0d1f1961af | ||
|
|
749dd367fa | ||
|
|
5849a2fecd | ||
|
|
343e92439c | ||
|
|
82c8243978 | ||
|
|
35d13bfc53 | ||
|
|
af975d3055 | ||
|
|
aeb64790d0 | ||
|
|
8d23f49c05 | ||
|
|
496a2ad710 | ||
|
|
7af3778761 | ||
|
|
0035b197c2 | ||
|
|
522e5299f1 | ||
|
|
13d28af70d | ||
|
|
7e8cad4fcc | ||
|
|
4c04109ba4 | ||
|
|
5341c120cc | ||
|
|
215e5a7b90 | ||
|
|
9e6c8b28ba | ||
|
|
e6761de367 | ||
|
|
18d24ebfdd | ||
|
|
c7d66ac1ab | ||
|
|
9039f26eab | ||
|
|
a91d3f79c3 | ||
|
|
587403d009 | ||
|
|
30585ec690 | ||
|
|
1b591a83ca | ||
|
|
189c3062f0 | ||
|
|
37b8bb1ce4 | ||
|
|
de89795eed | ||
|
|
a8b122e1c4 | ||
|
|
eba9a4bce5 | ||
|
|
14e6acad4d | ||
|
|
b2b073a2d7 | ||
|
|
59a5181e80 | ||
|
|
b800a639a2 | ||
|
|
4852a84ab8 | ||
|
|
2a9882e7af | ||
|
|
6c3b3749b1 | ||
|
|
eae6766995 | ||
|
|
67b49d9917 | ||
|
|
b8f0db3e69 | ||
|
|
55fe513c50 | ||
|
|
1653ac5453 | ||
|
|
6889fdf8a1 | ||
|
|
5f1fc280bb | ||
|
|
76b510fabc | ||
|
|
706c29231c | ||
|
|
4048a8cdc4 | ||
|
|
703757dc1f | ||
|
|
924e4011ee | ||
|
|
cbfebd6fdb | ||
|
|
6c8f51b311 | ||
|
|
484baa832d | ||
|
|
c89ca60777 | ||
|
|
aeb0c2f5e7 | ||
|
|
6a0d9043a2 | ||
|
|
b54b69d48f | ||
|
|
5052b233dd | ||
|
|
7f1c5a9b7e | ||
|
|
f17ca54c77 | ||
|
|
a33c3a1a21 | ||
|
|
7c515b6273 | ||
|
|
e7dbeaea52 | ||
|
|
46b08d22ac | ||
|
|
eef739806e | ||
|
|
4eb3bdbb5c | ||
|
|
ee6915dd47 | ||
|
|
45c23df381 | ||
|
|
79a700f9b3 | ||
|
|
0074a23631 | ||
|
|
7cd8d59fba | ||
|
|
188730318e | ||
|
|
044f2addbe | ||
|
|
f0715c53c4 | ||
|
|
46e3a86c81 | ||
|
|
06808dde92 | ||
|
|
cffd57797b | ||
|
|
1b918f3655 | ||
|
|
9f4e25be09 | ||
|
|
d552909adf | ||
|
|
81ae120a11 | ||
|
|
28d820e5ad | ||
|
|
d32796ce8f | ||
|
|
527424db79 | ||
|
|
762419f037 | ||
|
|
7c09ab2ea2 | ||
|
|
14bacaeba5 | ||
|
|
fe08942e39 | ||
|
|
bc4dd21316 | ||
|
|
0c5a496ba2 | ||
|
|
0a626f39ae | ||
|
|
e9806b73c6 | ||
|
|
2b522f5702 | ||
|
|
082c133128 | ||
|
|
c33ef19086 | ||
|
|
6f07d50d90 | ||
|
|
037e4d4214 | ||
|
|
53b1ff6ed4 | ||
|
|
2847f14dc7 | ||
|
|
4fb4ed9ca4 | ||
|
|
98bc291b54 | ||
|
|
532b9cb53c | ||
|
|
5075221428 | ||
|
|
3ee3edb8ce | ||
|
|
f3085a163f | ||
|
|
7b04e578af | ||
|
|
9daeeca997 | ||
|
|
0c5366420f | ||
|
|
f388d0d10f | ||
|
|
e588686d5f | ||
|
|
2e6e1c07bf | ||
|
|
a98dbc0b1c | ||
|
|
529b585d07 | ||
|
|
46d177fb9f | ||
|
|
24abaec406 | ||
|
|
673afbac0f | ||
|
|
5dc05f3c81 | ||
|
|
dce0604e7d |
3
account_analytic_analysis_usability/__init__.py
Normal file
3
account_analytic_analysis_usability/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_analytic_analysis
|
||||
29
account_analytic_analysis_usability/__openerp__.py
Normal file
29
account_analytic_analysis_usability/__openerp__.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Account Analytic Analysis Usability',
|
||||
'version': '8.0.1.0.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Usability improvements on Account Analytic Analysis',
|
||||
'description': """
|
||||
Account Analytic Analysis Usability
|
||||
===================================
|
||||
|
||||
Usability improvements include:
|
||||
|
||||
* add next invoice date in tree view of contrats (and add a group by)
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion
|
||||
<alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account_analytic_analysis'],
|
||||
'data': [
|
||||
'analytic_view.xml',
|
||||
],
|
||||
'installable': False,
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, fields
|
||||
|
||||
|
||||
class AccountAnalyticAccount(models.Model):
|
||||
_inherit = "account.analytic.account"
|
||||
|
||||
recurring_next_date = fields.Date(track_visibility='onchange')
|
||||
recurring_rule_type = fields.Selection(track_visibility='onchange')
|
||||
recurring_interval = fields.Integer(track_visibility='onchange')
|
||||
recurring_invoices = fields.Boolean(track_visibility='onchange')
|
||||
40
account_analytic_analysis_usability/analytic_view.xml
Normal file
40
account_analytic_analysis_usability/analytic_view.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
© 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_account_analytic_account_tree_c2c_3" model="ir.ui.view">
|
||||
<field name="name">usability.analytic_analysis.account.analytic.account.tree.contract</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field name="inherit_id" ref="account_analytic_analysis.view_account_analytic_account_tree_c2c_3"/>
|
||||
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="date" position="after">
|
||||
<field name="recurring_rule_type"/>
|
||||
<field name="recurring_next_date"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_analytic_account_overdue_search" model="ir.ui.view">
|
||||
<field name="name">usability.analytic_analysis.account.analytic.account.search</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field name="inherit_id" ref="account_analytic_analysis.view_account_analytic_account_overdue_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter context="{'group_by' : 'pricelist_id'}" position="after">
|
||||
<filter name="recurring_rule_type_groupby" string="Invoicing Frequency" context="{'group_by': 'recurring_rule_type'}"/>
|
||||
<filter name="recurring_next_date_groupby" string="Next Invoice Date" context="{'group_by': 'recurring_next_date'}"/>
|
||||
</filter>
|
||||
<filter name="cancelled" position="after">
|
||||
<separator/>
|
||||
<filter name="recurring_invoices" string="Recurring Invoicing" domain="[('recurring_invoices', '=', True)]"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
3
account_bank_statement_import_usability/__init__.py
Normal file
3
account_bank_statement_import_usability/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_bank_statement_import
|
||||
49
account_bank_statement_import_usability/__openerp__.py
Normal file
49
account_bank_statement_import_usability/__openerp__.py
Normal file
@@ -0,0 +1,49 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Bank Statement Import Usability module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Bank Statement Import Usability',
|
||||
'version': '0.1',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Small usability enhancements in account_bank_statement_import module',
|
||||
'description': """
|
||||
Account Bank Statement Import Usability
|
||||
=======================================
|
||||
|
||||
This module adds the following changes:
|
||||
|
||||
* Blocks the *Automagically create bank account*, because it's too dangerous : it creates new bank accounts and new account journal... and the user doesn't even realize that !
|
||||
|
||||
* Works if the bank statement file only contain the account number and not the full IBAN
|
||||
|
||||
* If you have 2 accounts with the same number (I know a company that has an account in EUR and an account in USD with the same number), you should force the journal and it will work (instead of blocking with an error message)
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account_bank_statement_import'],
|
||||
'data': ['account_view.xml'],
|
||||
'installable': False,
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Bank Statement Import Usability module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp import models, api
|
||||
|
||||
|
||||
class AccountBankStatementImport(models.TransientModel):
|
||||
"""Extend model account.bank.statement."""
|
||||
_inherit = 'account.bank.statement.import'
|
||||
|
||||
@api.model
|
||||
def _find_bank_account_id(self, account_number):
|
||||
"""Compared to the code in the module account_bank_statement_import,
|
||||
this code:
|
||||
- works when the account_number is not a complete IBAN,
|
||||
but just an account number (most statement files only have the
|
||||
account number)
|
||||
- works if you have 2 bank accounts with the same number
|
||||
(I have seen that at Crédit du Nord: the company had 1 account in USD
|
||||
and 1 account in EUR with the same number !)
|
||||
-> for that, I filter on the journal if the journal_id field is set
|
||||
"""
|
||||
bank_account_id = None
|
||||
if account_number and len(account_number) > 4:
|
||||
if self.journal_id:
|
||||
self._cr.execute("""
|
||||
SELECT id FROM res_partner_bank
|
||||
WHERE replace(replace(acc_number,' ',''),'-','') like %s
|
||||
AND journal_id=%s
|
||||
ORDER BY id
|
||||
""", ('%' + account_number + '%', self.journal_id.id))
|
||||
else:
|
||||
self._cr.execute("""
|
||||
SELECT id FROM res_partner_bank
|
||||
WHERE replace(replace(acc_number,' ',''),'-','') like %s
|
||||
AND journal_id is not null
|
||||
ORDER BY id
|
||||
""", ('%' + account_number + '%', ))
|
||||
bank_account_ids = [id[0] for id in self._cr.fetchall()]
|
||||
if bank_account_ids:
|
||||
bank_account_id = bank_account_ids[0]
|
||||
return bank_account_id
|
||||
|
||||
|
||||
class AccountBankStatement(models.Model):
|
||||
_inherit = 'account.bank.statement'
|
||||
|
||||
# When we use the import of bank statement via files,
|
||||
# the start/end_balance is usually computed from the lines itself
|
||||
# because we don't have the 'real' information in the file
|
||||
# But, in the module account_bank_statement_import, in the method
|
||||
# _create_bank_statement(), the bank statement lines already present in
|
||||
# Odoo are filtered out, but the start/end balance is not adjusted,
|
||||
# so the user has to manually modifiy it the close the bank statement
|
||||
# I think the solution is just to remove the start/end balance system
|
||||
# on the bank statement when we use the file import
|
||||
# This code is present in the 'account' module, but I override it here
|
||||
# and not in account_usability because the users who don't have
|
||||
# account_bank_statement_import may want to keep start/end balance
|
||||
def balance_check(self, cr, uid, st_id, journal_type='bank', context=None):
|
||||
return True
|
||||
44
account_bank_statement_import_usability/account_view.xml
Normal file
44
account_bank_statement_import_usability/account_view.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2016 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_bank_statement_form" model="ir.ui.view">
|
||||
<field name="name">bank_statement_import_usability.account.bank.statement.form</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="account.view_bank_statement_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="balance_start" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<field name="balance_end_real" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_bank_statement_tree" model="ir.ui.view">
|
||||
<field name="name">bank_statement_import_usability.account.bank.statement.tree</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="account.view_bank_statement_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="balance_start" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<field name="balance_end_real" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<tree position="attributes">
|
||||
<attribute name="colors">blue:state=='draft';black:state=='confirm'</attribute>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
3
account_credit_control_usability/__init__.py
Normal file
3
account_credit_control_usability/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_credit_control
|
||||
46
account_credit_control_usability/__openerp__.py
Normal file
46
account_credit_control_usability/__openerp__.py
Normal file
@@ -0,0 +1,46 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Credit Control Usability module for Odoo
|
||||
# Copyright (C) 2016 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Credit Control Usability',
|
||||
'version': '0.1',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Small usability enhancements in account_credit_control module',
|
||||
'description': """
|
||||
Account Credit Control Usability
|
||||
================================
|
||||
|
||||
The usability enhancements include:
|
||||
|
||||
* add phone call in the list of channels
|
||||
* hide some fields
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account_credit_control', 'partner_aged_open_invoices'],
|
||||
'data': ['account_credit_control_view.xml'],
|
||||
'installable': False,
|
||||
}
|
||||
82
account_credit_control_usability/account_credit_control.py
Normal file
82
account_credit_control_usability/account_credit_control.py
Normal file
@@ -0,0 +1,82 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Credit Control Usability module for Odoo
|
||||
# Copyright (C) 2016 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp import models, fields, api
|
||||
|
||||
|
||||
class CreditControlPolicyLevel(models.Model):
|
||||
_inherit = "credit.control.policy.level"
|
||||
_rec_name = 'internal_name'
|
||||
|
||||
channel = fields.Selection(selection_add=[('phone', 'Phone Call')])
|
||||
name = fields.Char(
|
||||
string='Subject',
|
||||
help="Will be displayed in the subject of the emails and in "
|
||||
"the letters")
|
||||
internal_name = fields.Char(string='Internal Name', required=True)
|
||||
|
||||
|
||||
class CreditControlLine(models.Model):
|
||||
_inherit = "credit.control.line"
|
||||
|
||||
channel = fields.Selection(selection_add=[('phone', 'Phone Call')])
|
||||
note = fields.Text(string='Notes')
|
||||
|
||||
@api.multi
|
||||
def open_aged_open_invoices_report(self):
|
||||
self.ensure_one()
|
||||
return self.partner_id.open_aged_open_invoices_report()
|
||||
|
||||
@api.multi
|
||||
def go_to_partner_form(self):
|
||||
self.ensure_one()
|
||||
action = self.env['ir.actions.act_window'].for_xml_id(
|
||||
'base', 'action_partner_customer_form')
|
||||
action.update({
|
||||
'view_mode': 'form,kanban,tree',
|
||||
'views': False,
|
||||
'res_id': self.partner_id.id,
|
||||
'context': {},
|
||||
})
|
||||
return action
|
||||
|
||||
|
||||
class CreditControlRun(models.Model):
|
||||
_inherit = "credit.control.run"
|
||||
|
||||
date = fields.Date(default=fields.Date.context_today)
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
@api.one
|
||||
@api.depends('credit_control_line_ids')
|
||||
def _credit_control_line_count(self):
|
||||
try:
|
||||
self.credit_control_line_count = len(self.credit_control_line_ids)
|
||||
except:
|
||||
self.credit_control_line_count = 0
|
||||
|
||||
credit_control_line_count = fields.Integer(
|
||||
compute='_credit_control_line_count',
|
||||
string="# of Credit Control Lines", readonly=True)
|
||||
127
account_credit_control_usability/account_credit_control_view.xml
Normal file
127
account_credit_control_usability/account_credit_control_view.xml
Normal file
@@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="credit_control_line_tree" model="ir.ui.view">
|
||||
<field name="name">credit_control_usability.credit_control_line_tree</field>
|
||||
<field name="model">credit.control.line</field>
|
||||
<field name="inherit_id" ref="account_credit_control.credit_control_line_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="account_id" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<field name="move_line_id" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<field name="mail_message_id" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<field name="partner_id" position="after">
|
||||
<button name="go_to_partner_form" type="object"
|
||||
string="Go to Partner" icon="terp-gtk-jump-to-ltr"/>
|
||||
<button name="open_aged_open_invoices_report" type="object"
|
||||
string="Open Aged Open Invoices Report" icon="STOCK_ZOOM_IN"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="credit_control_line_form" model="ir.ui.view">
|
||||
<field name="name">credit_control_usability.credit_control_line_form</field>
|
||||
<field name="model">credit.control.line</field>
|
||||
<field name="inherit_id" ref="account_credit_control.credit_control_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='currency_id']/.." position="after">
|
||||
<group name="note">
|
||||
<field name="note"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="credit_control_policy_form" model="ir.ui.view">
|
||||
<field name="name">credit_control_usability.credit.control.policy.form</field>
|
||||
<field name="model">credit.control.policy</field>
|
||||
<field name="inherit_id" ref="account_credit_control.credit_control_policy_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='level_ids']/tree/field[@name='name']" position="before">
|
||||
<field name="internal_name"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='level_ids']/form//field[@name='name']" position="replace">
|
||||
<group name="level-main">
|
||||
|
||||
<field name="internal_name"/>
|
||||
<field name="name"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="credit_mangement_policy_level_form" model="ir.ui.view">
|
||||
<field name="name">credit_control_usability.credit.control.policy.level.form</field>
|
||||
<field name="model">credit.control.policy.level</field>
|
||||
<field name="inherit_id" ref="account_credit_control.credit_mangement_policy_level_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="before">
|
||||
<field name="internal_name"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="credit_control_policy_level_tree" model="ir.ui.view">
|
||||
<field name="name">credit_control_usability.credit.control.policy.level.tree</field>
|
||||
<field name="model">credit.control.policy.level</field>
|
||||
<field name="inherit_id" ref="account_credit_control.credit_control_policy_level_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="before">
|
||||
<field name="internal_name"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="credit_control_line_search" model="ir.ui.view">
|
||||
<field name="name">credit_control_usability.credit_control_line_search</field>
|
||||
<field name="model">credit.control.line</field>
|
||||
<field name="inherit_id" ref="account_credit_control.credit_control_line_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter name="filter_manual" position="after">
|
||||
<filter name="phone" string="Phone Call" domain="[('channel', '=', 'phone')]"/>
|
||||
<filter name="letter" string="Letter" domain="[('channel', '=', 'letter')]"/>
|
||||
<filter name="email" string="Email" domain="[('channel', '=', 'email')]"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="partner_credit_control_line_action" model="ir.actions.act_window">
|
||||
<field name="name">Credit Control Lines</field>
|
||||
<field name="res_model">credit.control.line</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{'search_default_partner_id': active_id}</field>
|
||||
</record>
|
||||
|
||||
<record id="view_partner_form" model="ir.ui.view">
|
||||
<field name="name">account_credit_control_usability.button.res.partner.form</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@name='buttons']" position="inside">
|
||||
<button class="oe_inline oe_stat_button" type="action"
|
||||
name="%(partner_credit_control_line_action)d"
|
||||
attrs="{'invisible': [('customer', '=', False)]}"
|
||||
icon="fa-gavel">
|
||||
<field string="Credit Control"
|
||||
name="credit_control_line_count" widget="statinfo"/>
|
||||
</button>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- rapport -->
|
||||
<template id="report_credit_control_summary_document" inherit_id="account_credit_control.report_credit_control_summary_document">
|
||||
<xpath expr="//span[@t-field='l.amount_due']" position="attributes">
|
||||
<attribute name="t-field-options">{"widget": "monetary", "display_currency": "l.currency_id or l.company_id.currency_id"}</attribute>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
1
account_cutoff_accrual_picking_ods/__init__.py
Normal file
1
account_cutoff_accrual_picking_ods/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
24
account_cutoff_accrual_picking_ods/__openerp__.py
Normal file
24
account_cutoff_accrual_picking_ods/__openerp__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Account Cutoff Accrual Picking ODS',
|
||||
'version': '8.0.0.1.0',
|
||||
'category': 'Tools',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Adds an Aeroo ODS report on cutoff accrual',
|
||||
'description': """
|
||||
Account Cutoff Accrual Picking ODS
|
||||
==================================
|
||||
|
||||
This module will add an Aeroo ODS report on Accrued Revenue and Accrued Expense.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': "Akretion",
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account_cutoff_accrual_picking', 'report_aeroo'],
|
||||
'data': ['report.xml'],
|
||||
'installable': False,
|
||||
}
|
||||
BIN
account_cutoff_accrual_picking_ods/cutoff_accrual.ods
Normal file
BIN
account_cutoff_accrual_picking_ods/cutoff_accrual.ods
Normal file
Binary file not shown.
27
account_cutoff_accrual_picking_ods/report.xml
Normal file
27
account_cutoff_accrual_picking_ods/report.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<record id="account_cutoff_accrual_picking_ods" model="ir.actions.report.xml">
|
||||
<field name="name">Cutoff Accrual ODS</field>
|
||||
<field name="model">account.cutoff</field>
|
||||
<field name="report_name">account.cutoff.accrual.picking.ods</field>
|
||||
<field name="report_type">aeroo</field>
|
||||
<field name="in_format">oo-ods</field>
|
||||
<field name="report_rml">account_cutoff_accrual_picking_ods/cutoff_accrual.ods</field>
|
||||
<field name="parser_state">default</field>
|
||||
<field name="tml_source">file</field>
|
||||
<field name="out_format" ref="report_aeroo.report_mimetypes_ods_ods"/>
|
||||
</record>
|
||||
|
||||
<record id="account_cutoff_accrual_picking_ods_button" model="ir.values">
|
||||
<field name="name">Cutoff Accrual ODS</field>
|
||||
<field name="model">account.cutoff</field>
|
||||
<field name="key2">client_print_multi</field>
|
||||
<field name="value" eval="'ir.actions.report.xml,%d'%account_cutoff_accrual_picking_ods"/>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
1
account_cutoff_prepaid_ods/__init__.py
Normal file
1
account_cutoff_prepaid_ods/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
43
account_cutoff_prepaid_ods/__openerp__.py
Normal file
43
account_cutoff_prepaid_ods/__openerp__.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Cutoff Prepaid ODS module for Odoo
|
||||
# Copyright (C) 2016 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Cutoff Prepaid ODS',
|
||||
'version': '8.0.0.1.0',
|
||||
'category': 'Tools',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Adds an Aeroo ODS report on cutoff prepaid',
|
||||
'description': """
|
||||
Account Cutoff Prepaid ODS
|
||||
===========================
|
||||
|
||||
This module will add an Aeroo ODS report on Prepaid Revenue and Prepaid Expense.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': "Akretion",
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account_cutoff_prepaid', 'report_aeroo'],
|
||||
'data': ['report.xml'],
|
||||
'installable': False,
|
||||
}
|
||||
BIN
account_cutoff_prepaid_ods/cutoff_prepaid.ods
Normal file
BIN
account_cutoff_prepaid_ods/cutoff_prepaid.ods
Normal file
Binary file not shown.
27
account_cutoff_prepaid_ods/report.xml
Normal file
27
account_cutoff_prepaid_ods/report.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<record id="account_cutoff_prepaid_ods" model="ir.actions.report.xml">
|
||||
<field name="name">Cutoff Prepaid ODS</field>
|
||||
<field name="model">account.cutoff</field>
|
||||
<field name="report_name">account.cutoff.prepaid.ods</field>
|
||||
<field name="report_type">aeroo</field>
|
||||
<field name="in_format">oo-ods</field>
|
||||
<field name="report_rml">account_cutoff_prepaid_ods/cutoff_prepaid.ods</field>
|
||||
<field name="parser_state">default</field>
|
||||
<field name="tml_source">file</field>
|
||||
<field name="out_format" ref="report_aeroo.report_mimetypes_ods_ods"/>
|
||||
</record>
|
||||
|
||||
<record id="account_cutoff_prepaid_ods_button" model="ir.values">
|
||||
<field name="name">Cutoff Prepaid ODS</field>
|
||||
<field name="model">account.cutoff</field>
|
||||
<field name="key2">client_print_multi</field>
|
||||
<field name="value" eval="'ir.actions.report.xml,%d'%account_cutoff_prepaid_ods"/>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
24
account_direct_debit_autogenerate/__init__.py
Normal file
24
account_direct_debit_autogenerate/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Direct Debit Autogenerate module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
from . import account_invoice
|
||||
47
account_direct_debit_autogenerate/__openerp__.py
Normal file
47
account_direct_debit_autogenerate/__openerp__.py
Normal file
@@ -0,0 +1,47 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Direct Debit Autogenerate module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Direct Debit Autogenerate',
|
||||
'version': '0.1',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Auto-generate direct debit order on invoice validation',
|
||||
'description': """
|
||||
Account Direct Debit Autogenerate
|
||||
=================================
|
||||
|
||||
With this module, when you validate a customer invoice whose payment mode is SEPA Direct Debit :
|
||||
|
||||
* if a draft Direct Debit order for SEPA Direct Debit already exists, a new payment line is added to it for the invoice,
|
||||
|
||||
* otherwise, a new SEPA Direct Debit order is created for this invoice.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account_banking_sepa_direct_debit', 'account_payment_partner'],
|
||||
'data': [],
|
||||
'installable': False,
|
||||
}
|
||||
107
account_direct_debit_autogenerate/account_invoice.py
Normal file
107
account_direct_debit_autogenerate/account_invoice.py
Normal file
@@ -0,0 +1,107 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Direct Debit Autogenerate module for Odoo
|
||||
# Copyright (C) 2015 Akretion (www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp import models, api, _
|
||||
from openerp.exceptions import Warning
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class AccountInvoice(models.Model):
|
||||
_inherit = 'account.invoice'
|
||||
|
||||
@api.model
|
||||
def _prepare_payment_order(self, invoice):
|
||||
vals = {
|
||||
'mode': invoice.payment_mode_id.id,
|
||||
'payment_order_type': 'debit',
|
||||
}
|
||||
return vals
|
||||
|
||||
@api.model
|
||||
def _prepare_payment_line(self, move_line, payment_order):
|
||||
assert move_line.invoice, 'The move line must be linked to an invoice'
|
||||
if not move_line.invoice.mandate_id:
|
||||
raise Warning(
|
||||
_('Missing Mandate on Invoice %s') % move_line.invoice.number)
|
||||
vals = {
|
||||
'order_id': payment_order.id,
|
||||
'move_line_id': move_line.id,
|
||||
'partner_id': move_line.partner_id.id,
|
||||
'amount_currency': move_line.debit,
|
||||
'communication': move_line.invoice.number.replace('/', ''),
|
||||
'state': 'structured',
|
||||
'date': move_line.date_maturity,
|
||||
'currency': move_line.invoice.currency_id.id,
|
||||
'mandate_id': move_line.invoice.mandate_id.id,
|
||||
'bank_id': move_line.invoice.mandate_id.partner_bank_id.id,
|
||||
}
|
||||
return vals
|
||||
|
||||
@api.multi
|
||||
def invoice_validate(self):
|
||||
'''Create Direct debit payment order on invoice validation or update
|
||||
an existing draft Direct Debit pay order'''
|
||||
res = super(AccountInvoice, self).invoice_validate()
|
||||
poo = self.env['payment.order']
|
||||
plo = self.env['payment.line']
|
||||
for invoice in self:
|
||||
if (
|
||||
invoice.type == 'out_invoice'
|
||||
and invoice.payment_mode_id
|
||||
and invoice.payment_mode_id.type
|
||||
and invoice.payment_mode_id.type.code
|
||||
and invoice.payment_mode_id.type.code.
|
||||
startswith('pain.008.001.')):
|
||||
payorders = poo.search([
|
||||
('state', '=', 'draft'),
|
||||
('payment_order_type', '=', 'debit'),
|
||||
('mode', '=', invoice.payment_mode_id.id),
|
||||
# mode is attached to company
|
||||
])
|
||||
if payorders:
|
||||
payorder = payorders[0]
|
||||
payorder_type = _('existing')
|
||||
else:
|
||||
payorder_vals = self._prepare_payment_order(invoice)
|
||||
payorder = poo.create(payorder_vals)
|
||||
payorder_type = _('new')
|
||||
logger.info(
|
||||
'New Direct Debit Order created %s'
|
||||
% payorder.reference)
|
||||
move_lines = [
|
||||
line for line in invoice.move_id.line_id
|
||||
if line.account_id == invoice.account_id]
|
||||
for move_line in move_lines:
|
||||
if not invoice.mandate_id:
|
||||
raise Warning(
|
||||
_("Missing Mandate on invoice %s")
|
||||
% invoice.number)
|
||||
# add payment line
|
||||
pl_vals = self._prepare_payment_line(move_line, payorder)
|
||||
pl = plo.create(pl_vals)
|
||||
invoice.message_post(
|
||||
_("A new payment line %s has been automatically "
|
||||
"created on the %s direct debit order %s")
|
||||
% (pl.name, payorder_type, payorder.reference))
|
||||
return res
|
||||
@@ -1 +1,3 @@
|
||||
from . import models
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_fiscal_position
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
# © 2016-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "Account Fiscal Position Payable Receivable",
|
||||
"version": "12.0.1.0.0",
|
||||
"category": "Accounting & Finance",
|
||||
"license": "AGPL-3",
|
||||
"summary": "Configure payable/receivable accounts on fiscal positions",
|
||||
"description": """
|
||||
Account Fiscal Position Payable Receivable
|
||||
==========================================
|
||||
|
||||
This module allows to configure a special *Partner Receivable Account* and a special *Partner Payable Account* on fiscal positions. This is used in the onchange of the fiscal position of partners.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
"author": "Akretion",
|
||||
"website": "http://www.akretion.com",
|
||||
"depends": ["account"],
|
||||
"data": ["views/account_fiscal_position_view.xml"],
|
||||
"installable": False,
|
||||
}
|
||||
26
account_fiscal_position_payable_receivable/__openerp__.py
Normal file
26
account_fiscal_position_payable_receivable/__openerp__.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Account Fiscal Position Payable Receivable',
|
||||
'version': '8.0.1.0.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Configure payable/receivable accounts on fiscal positions',
|
||||
'description': """
|
||||
Account Fiscal Position Payable Receivable
|
||||
==========================================
|
||||
|
||||
This module allows to configure a special *Partner Receivable Account* and a special *Partner Payable Account* on fiscal positions. This is used in the onchange of the fiscal position of partners.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': "Akretion",
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account'],
|
||||
'data': [
|
||||
'account_fiscal_position_view.xml',
|
||||
],
|
||||
'installable': False,
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp import models, fields, api
|
||||
|
||||
|
||||
class AccountFiscalPosition(models.Model):
|
||||
_inherit = 'account.fiscal.position'
|
||||
|
||||
receivable_account_id = fields.Many2one(
|
||||
'account.account', string='Partner Receivable Account',
|
||||
company_dependent=True, domain=[('type', '=', 'receivable')])
|
||||
payable_account_id = fields.Many2one(
|
||||
'account.account', string='Partner Payable Account',
|
||||
company_dependent=True, domain=[('type', '=', 'payable')])
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
@api.onchange('property_account_position')
|
||||
def fiscal_position_receivable_payable_change(self):
|
||||
fp = self.property_account_position
|
||||
ipo = self.env['ir.property']
|
||||
if fp.receivable_account_id:
|
||||
self.property_account_receivable = fp.receivable_account_id
|
||||
else:
|
||||
self.property_account_receivable = ipo.get(
|
||||
'property_account_receivable', 'res.partner')
|
||||
if fp.payable_account_id:
|
||||
self.property_account_payable = fp.payable_account_id
|
||||
else:
|
||||
self.property_account_payable = ipo.get(
|
||||
'property_account_payable', 'res.partner')
|
||||
@@ -4,7 +4,8 @@
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<record id="view_account_position_form" model="ir.ui.view">
|
||||
@@ -12,12 +13,16 @@
|
||||
<field name="model">account.fiscal.position</field>
|
||||
<field name="inherit_id" ref="account.view_account_position_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="company_id" position="after">
|
||||
<field name="receivable_account_id"/>
|
||||
<field name="payable_account_id"/>
|
||||
</field>
|
||||
<xpath expr="//field[@name='country_group_id']/.." position="after">
|
||||
<group string="Payable and Receivable Accounts"
|
||||
name="payable_receivable_account" col="4">
|
||||
<field name="receivable_account_id"/>
|
||||
<field name="payable_account_id"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,2 +0,0 @@
|
||||
from . import account_fiscal_position
|
||||
from . import res_partner
|
||||
@@ -1,21 +0,0 @@
|
||||
# © 2016-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class AccountFiscalPosition(models.Model):
|
||||
_inherit = "account.fiscal.position"
|
||||
|
||||
receivable_account_id = fields.Many2one(
|
||||
"account.account",
|
||||
string="Partner Receivable Account",
|
||||
company_dependent=True,
|
||||
domain=[("internal_type", "=", "receivable")],
|
||||
)
|
||||
payable_account_id = fields.Many2one(
|
||||
"account.account",
|
||||
string="Partner Payable Account",
|
||||
company_dependent=True,
|
||||
domain=[("internal_type", "=", "payable")],
|
||||
)
|
||||
@@ -1,25 +0,0 @@
|
||||
# © 2016-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, api
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = "res.partner"
|
||||
|
||||
@api.onchange("property_account_position_id")
|
||||
def fiscal_position_receivable_payable_change(self):
|
||||
fp = self.property_account_position_id
|
||||
ipo = self.env["ir.property"]
|
||||
if fp.receivable_account_id:
|
||||
self.property_account_receivable_id = fp.receivable_account_id
|
||||
else:
|
||||
self.property_account_receivable_id = ipo.get(
|
||||
"property_account_receivable_id", "res.partner"
|
||||
)
|
||||
if fp.payable_account_id:
|
||||
self.property_account_payable_id = fp.payable_account_id
|
||||
else:
|
||||
self.property_account_payable_id = ipo.get(
|
||||
"property_account_payable_id", "res.partner"
|
||||
)
|
||||
23
account_fiscal_position_translate/__init__.py
Normal file
23
account_fiscal_position_translate/__init__.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Fiscal Position Translate module for OpenERP
|
||||
# Copyright (C) 2014 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from . import account
|
||||
43
account_fiscal_position_translate/__openerp__.py
Normal file
43
account_fiscal_position_translate/__openerp__.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Fiscal Position Translate module for OpenERP
|
||||
# Copyright (C) 2014 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Fiscal Position Translate',
|
||||
'version': '0.1',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Make the Notes field on fiscal position translatable',
|
||||
'description': """
|
||||
Account Fiscal Position Translate
|
||||
=================================
|
||||
|
||||
Makes the Notes field on the fiscal position translatable (it was native on 7.0, but it is not on 8.0).
|
||||
|
||||
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account'],
|
||||
'data': [],
|
||||
'installable': False,
|
||||
}
|
||||
32
account_fiscal_position_translate/account.py
Normal file
32
account_fiscal_position_translate/account.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Fiscal Position Translate module for OpenERP
|
||||
# Copyright (C) 2014 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import orm, fields
|
||||
|
||||
|
||||
class account_fiscal_position(orm.Model):
|
||||
_inherit = 'account.fiscal.position'
|
||||
|
||||
_columns = {
|
||||
# add translate=True
|
||||
'note': fields.text('Notes', translate=True),
|
||||
}
|
||||
1
account_hide_analytic_line/__init__.py
Normal file
1
account_hide_analytic_line/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
30
account_hide_analytic_line/__openerp__.py
Normal file
30
account_hide_analytic_line/__openerp__.py
Normal file
@@ -0,0 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Account Hide Analytic Lines',
|
||||
'version': '8.0.1.0.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Hide analytic lines',
|
||||
'description': """
|
||||
Account Hide Analytic Lines
|
||||
===========================
|
||||
|
||||
This module hides analytic lines. If you don't use timesheets, you should
|
||||
not use analytic lines at all. Instead, you should only use
|
||||
account move lines with the analytic account field (technical name: *analytic_account_id*).
|
||||
|
||||
Why ? Because, when you change the analytic account on an account move line,
|
||||
the analytic line is not updated by Odoo. So, if you use the report available in *Reporting > Accounting > Analytic Entries Analysis*, as this report is based on analytic lines, the results will not take into account the changes of analytic account that you made on some account move lines.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion
|
||||
<alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account', 'base_usability'],
|
||||
'data': ['account_view.xml'],
|
||||
'installable': False,
|
||||
}
|
||||
63
account_hide_analytic_line/account_view.xml
Normal file
63
account_hide_analytic_line/account_view.xml
Normal file
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<record id="account.account_analytic_journal_entries" model="ir.ui.menu">
|
||||
<field name="groups_id" eval="[(6, 0, [ref('base_usability.group_nobody')])]"/>
|
||||
</record>
|
||||
|
||||
<!-- Chart of analytic accounts -->
|
||||
<record id="account.menu_action_analytic_account_tree2" model="ir.ui.menu">
|
||||
<field name="groups_id" eval="[(6, 0, [ref('base_usability.group_nobody')])]"/>
|
||||
</record>
|
||||
|
||||
<record id="account.next_id_40" model="ir.ui.menu">
|
||||
<field name="groups_id" eval="[(6, 0, [ref('base_usability.group_nobody')])]"/>
|
||||
</record>
|
||||
|
||||
<record id="account.account_analytic_journal_values" model="ir.values">
|
||||
<field name="value" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record id="view_move_line_form" model="ir.ui.view">
|
||||
<field name="name">account_hide_analytic_line.account_move_line_form</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<page groups="analytic.group_analytic_accounting" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_entries_report_search" model="ir.ui.view">
|
||||
<field name="name">account.entries.report.search: add groupby</field>
|
||||
<field name="model">account.entries.report</field>
|
||||
<field name="inherit_id" ref="account.view_account_entries_report_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<group expand="1" position="inside">
|
||||
<filter name="account_groupby" string="Account" context="{'group_by': 'account_id'}"/>
|
||||
<filter name="analytic_account_groupby" string="Analytic Account" context="{'group_by': 'analytic_account_id'}"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Natively, this action is based on analytic.entries.report
|
||||
We switch that to account.entries.report with good context value to
|
||||
have a similar result -->
|
||||
<record id="account.action_analytic_entries_report" model="ir.actions.act_window">
|
||||
<field name="res_model">account.entries.report</field>
|
||||
<field name="context">{'search_default_thisyear': 1, 'search_default_analytic_account_groupby': 1}</field>
|
||||
<field name="search_view_id" ref="view_account_entries_report_search"/>
|
||||
<field name="domain">[('analytic_account_id', '!=', False)]</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
23
account_invoice_del_attachment_cancel/__init__.py
Normal file
23
account_invoice_del_attachment_cancel/__init__.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Del Attachment Cancel module for OpenERP
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from . import account_invoice
|
||||
44
account_invoice_del_attachment_cancel/__openerp__.py
Normal file
44
account_invoice_del_attachment_cancel/__openerp__.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Del Attachment Cancel module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Invoice Delete Attachment on Cancel',
|
||||
'version': '0.1',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Delete the attachment on the invoice when it is set back to draft',
|
||||
'description': """
|
||||
Account Invoice Delete Attachment on Cancel
|
||||
===========================================
|
||||
|
||||
When a customer invoice is validated, on the first generation of the invoice report, a copy of the report is stored as attachment on the invoice. After that, every time a user asks for the Invoice report, it will be taken from the attachment. But, when a customer invoice/refund is cancelled, set back to draft, modified and re-validated, the Invoice report is still the old PDF file, which is often raised as a bug by the users.
|
||||
|
||||
With this module, when a customer invoice/refund is set back to draft, the attachment is deleted.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account'],
|
||||
'installable': False,
|
||||
}
|
||||
57
account_invoice_del_attachment_cancel/account_invoice.py
Normal file
57
account_invoice_del_attachment_cancel/account_invoice.py
Normal file
@@ -0,0 +1,57 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Del Attachment Cancel module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp import models, api, _
|
||||
|
||||
|
||||
class AccountInvoice(models.Model):
|
||||
_inherit = 'account.invoice'
|
||||
|
||||
@api.multi
|
||||
def invoice_filename_to_match(self):
|
||||
return 'INV%.pdf'
|
||||
|
||||
@api.multi
|
||||
def action_cancel_draft(self):
|
||||
res = super(AccountInvoice, self).action_cancel_draft()
|
||||
iao = self.env['ir.attachment']
|
||||
for invoice in self:
|
||||
# search for attachments
|
||||
if 'out' in invoice.type:
|
||||
filename_to_match = invoice.invoice_filename_to_match()
|
||||
attachs = iao.search([
|
||||
('res_id', '=', invoice.id),
|
||||
('res_model', '=', self._name),
|
||||
('type', '=', 'binary'),
|
||||
('datas_fname', '=like', filename_to_match),
|
||||
])
|
||||
if len(attachs) == 1:
|
||||
# delete attachment
|
||||
attach = attachs[0]
|
||||
attach_name = attach.name
|
||||
# I need sudo() because the user that has the right to
|
||||
# do a "back2draft" on an invoice may not have the right
|
||||
# to delete an account.invoice
|
||||
attachs.sudo().unlink()
|
||||
invoice.message_post(
|
||||
_('Attachement %s has been deleted') % attach_name)
|
||||
return res
|
||||
1
account_invoice_groupby_commercial_partner/__init__.py
Normal file
1
account_invoice_groupby_commercial_partner/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
43
account_invoice_groupby_commercial_partner/__openerp__.py
Normal file
43
account_invoice_groupby_commercial_partner/__openerp__.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Groupby Commercial Partner module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Invoice Groupby Commercial Partner',
|
||||
'version': '0.1',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Group by commercial partner instead of partner in invoices',
|
||||
'description': """
|
||||
Account Invoice Group-by Commercial Partner
|
||||
===========================================
|
||||
|
||||
By default Odoo v8 makes a groupby on partner_id on invoice ; this module changes this to groupby commercial_partner_id.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account'],
|
||||
'data': ['account_invoice_view.xml'],
|
||||
'installable': False,
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_account_invoice_filter" model="ir.ui.view">
|
||||
<field name="name">account.invoice.groupby.commercial.partner</field>
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="inherit_id" ref="account.view_account_invoice_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter name="group_by_partner_id" position="attributes">
|
||||
<attribute name="context">{'group_by':'commercial_partner_id'}</attribute>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_invoice_report_search" model="ir.ui.view">
|
||||
<field name="name">account.invoice.groupby.commercial.partner.invoice.report</field>
|
||||
<field name="model">account.invoice.report</field>
|
||||
<field name="inherit_id" ref="account.view_account_invoice_report_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter name="partner_id" position="attributes">
|
||||
<attribute name="context">{'group_by':'commercial_partner_id','residual_visible':True}</attribute>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,2 +1,3 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
from . import account_invoice
|
||||
from . import account_invoice_report
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
# Copyright 2015-2019 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': 'Account Invoice Margin',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Invoicing Management',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Copy standard price on invoice line and compute margins',
|
||||
'description': """
|
||||
This module copies the field *standard_price* of the product on the invoice line when the invoice line is created. The allows the computation of the margin of the invoice.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion
|
||||
<alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account'],
|
||||
'data': [
|
||||
'account_invoice_view.xml',
|
||||
],
|
||||
'installable': False,
|
||||
}
|
||||
43
account_invoice_margin/__openerp__.py
Normal file
43
account_invoice_margin/__openerp__.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Margin module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Invoice Margin',
|
||||
'version': '0.1',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Copy standard price on invoice line and compute margins',
|
||||
'description': """
|
||||
This module copies the field *standard_price* of the product on the invoice line when the invoice line is created. The allows the computation of the margin of the invoice.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion
|
||||
<alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account'],
|
||||
'data': [
|
||||
'account_invoice_view.xml',
|
||||
],
|
||||
'installable': False,
|
||||
}
|
||||
@@ -1,9 +1,27 @@
|
||||
# Copyright 2015-2019 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).
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Margin module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from odoo import api, fields, models
|
||||
import odoo.addons.decimal_precision as dp
|
||||
from openerp import models, fields, api
|
||||
import openerp.addons.decimal_precision as dp
|
||||
|
||||
|
||||
class AccountInvoiceLine(models.Model):
|
||||
@@ -21,55 +39,56 @@ class AccountInvoiceLine(models.Model):
|
||||
digits=dp.get_precision('Product Price'),
|
||||
help="Cost price in invoice currency in the unit of measure "
|
||||
"of the invoice line")
|
||||
margin_invoice_currency = fields.Monetary(
|
||||
margin_invoice_currency = fields.Float(
|
||||
string='Margin in Invoice Currency', readonly=True, store=True,
|
||||
compute='_compute_margin', currency_field='currency_id')
|
||||
margin_company_currency = fields.Monetary(
|
||||
compute='_compute_margin',
|
||||
digits=dp.get_precision('Account'))
|
||||
margin_company_currency = fields.Float(
|
||||
string='Margin in Company Currency', readonly=True, store=True,
|
||||
compute='_compute_margin', currency_field='company_currency_id')
|
||||
compute='_compute_margin',
|
||||
digits=dp.get_precision('Account'))
|
||||
margin_rate = fields.Float(
|
||||
string="Margin Rate", readonly=True, store=True,
|
||||
compute='_compute_margin',
|
||||
digits=(16, 2), help="Margin rate in percentage of the sale price")
|
||||
|
||||
@api.one
|
||||
@api.depends(
|
||||
'standard_price_company_currency', 'invoice_id.currency_id',
|
||||
'invoice_id.type', 'invoice_id.company_id',
|
||||
'invoice_id.date_invoice', 'quantity', 'price_subtotal')
|
||||
def _compute_margin(self):
|
||||
for il in self:
|
||||
standard_price_inv_cur = 0.0
|
||||
margin_inv_cur = 0.0
|
||||
margin_comp_cur = 0.0
|
||||
margin_rate = 0.0
|
||||
inv = il.invoice_id
|
||||
if inv and inv.type in ('out_invoice', 'out_refund'):
|
||||
# it works in _get_current_rate
|
||||
# even if we set date = False in context
|
||||
# standard_price_inv_cur is in the UoM of the invoice line
|
||||
date = inv._get_currency_rate_date() or\
|
||||
fields.Date.context_today(self)
|
||||
company = inv.company_id
|
||||
company_currency = company.currency_id
|
||||
standard_price_inv_cur =\
|
||||
company_currency._convert(
|
||||
il.standard_price_company_currency,
|
||||
inv.currency_id, company, date)
|
||||
margin_inv_cur =\
|
||||
il.price_subtotal - il.quantity * standard_price_inv_cur
|
||||
margin_comp_cur = inv.currency_id._convert(
|
||||
margin_inv_cur, company_currency, company, date)
|
||||
if il.price_subtotal:
|
||||
margin_rate = 100 * margin_inv_cur / il.price_subtotal
|
||||
# for a refund, margin should be negative
|
||||
# but margin rate should stay positive
|
||||
if inv.type == 'out_refund':
|
||||
margin_inv_cur *= -1
|
||||
margin_comp_cur *= -1
|
||||
il.standard_price_invoice_currency = standard_price_inv_cur
|
||||
il.margin_invoice_currency = margin_inv_cur
|
||||
il.margin_company_currency = margin_comp_cur
|
||||
il.margin_rate = margin_rate
|
||||
standard_price_inv_cur = 0.0
|
||||
margin_inv_cur = 0.0
|
||||
margin_comp_cur = 0.0
|
||||
margin_rate = 0.0
|
||||
if (
|
||||
self.invoice_id and
|
||||
self.invoice_id.type in ('out_invoice', 'out_refund')):
|
||||
# it works in _get_current_rate
|
||||
# even if we set date = False in context
|
||||
# standard_price_inv_cur is in the UoM of the invoice line
|
||||
standard_price_inv_cur =\
|
||||
self.invoice_id.company_id.currency_id.with_context(
|
||||
date=self.invoice_id.date_invoice).compute(
|
||||
self.standard_price_company_currency,
|
||||
self.invoice_id.currency_id)
|
||||
margin_inv_cur =\
|
||||
self.price_subtotal - self.quantity * standard_price_inv_cur
|
||||
margin_comp_cur = self.invoice_id.currency_id.with_context(
|
||||
date=self.invoice_id.date_invoice).compute(
|
||||
margin_inv_cur, self.invoice_id.company_id.currency_id)
|
||||
if self.price_subtotal:
|
||||
margin_rate = 100 * margin_inv_cur / self.price_subtotal
|
||||
# for a refund, margin should be negative
|
||||
# but margin rate should stay positive
|
||||
if self.invoice_id.type == 'out_refund':
|
||||
margin_inv_cur *= -1
|
||||
margin_comp_cur *= -1
|
||||
self.standard_price_invoice_currency = standard_price_inv_cur
|
||||
self.margin_invoice_currency = margin_inv_cur
|
||||
self.margin_company_currency = margin_comp_cur
|
||||
self.margin_rate = margin_rate
|
||||
|
||||
# We want to copy standard_price on invoice line for customer
|
||||
# invoice/refunds. We can't do that via on_change of product_id,
|
||||
@@ -82,18 +101,18 @@ class AccountInvoiceLine(models.Model):
|
||||
if vals.get('product_id'):
|
||||
pp = self.env['product.product'].browse(vals['product_id'])
|
||||
std_price = pp.standard_price
|
||||
inv_uom_id = vals.get('uom_id')
|
||||
inv_uom_id = vals.get('uos_id')
|
||||
if inv_uom_id and inv_uom_id != pp.uom_id.id:
|
||||
inv_uom = self.env['uom.uom'].browse(inv_uom_id)
|
||||
std_price = pp.uom_id._compute_price(
|
||||
std_price, inv_uom)
|
||||
std_price = self.env['product.uom']._compute_price(
|
||||
pp.uom_id.id, std_price, inv_uom_id)
|
||||
vals['standard_price_company_currency'] = std_price
|
||||
return super(AccountInvoiceLine, self).create(vals)
|
||||
|
||||
@api.multi
|
||||
def write(self, vals):
|
||||
if not vals:
|
||||
vals = {}
|
||||
if 'product_id' in vals or 'uom_id' in vals:
|
||||
if 'product_id' in vals or 'uos_id' in vals:
|
||||
for il in self:
|
||||
if 'product_id' in vals:
|
||||
if vals.get('product_id'):
|
||||
@@ -103,21 +122,21 @@ class AccountInvoiceLine(models.Model):
|
||||
pp = False
|
||||
else:
|
||||
pp = il.product_id or False
|
||||
# uom_id is NOT a required field
|
||||
if 'uom_id' in vals:
|
||||
if vals.get('uom_id'):
|
||||
inv_uom = self.env['uom.uom'].browse(
|
||||
vals['uom_id'])
|
||||
# uos_id is NOT a required field
|
||||
if 'uos_id' in vals:
|
||||
if vals.get('uos_id'):
|
||||
inv_uom = self.env['product.uom'].browse(
|
||||
vals['uos_id'])
|
||||
else:
|
||||
inv_uom = False
|
||||
else:
|
||||
inv_uom = il.uom_id or False
|
||||
inv_uom = il.uos_id or False
|
||||
std_price = 0.0
|
||||
if pp:
|
||||
std_price = pp.standard_price
|
||||
if inv_uom and inv_uom != pp.uom_id:
|
||||
std_price = pp.uom_id._compute_price(
|
||||
std_price, inv_uom)
|
||||
std_price = self.env['product.uom']._compute_price(
|
||||
pp.uom_id.id, std_price, inv_uom.id)
|
||||
il.write({'standard_price_company_currency': std_price})
|
||||
return super(AccountInvoiceLine, self).write(vals)
|
||||
|
||||
@@ -125,28 +144,26 @@ class AccountInvoiceLine(models.Model):
|
||||
class AccountInvoice(models.Model):
|
||||
_inherit = 'account.invoice'
|
||||
|
||||
margin_invoice_currency = fields.Monetary(
|
||||
margin_invoice_currency = fields.Float(
|
||||
string='Margin in Invoice Currency',
|
||||
compute='_compute_margin', store=True, readonly=True,
|
||||
currency_field='currency_id')
|
||||
margin_company_currency = fields.Monetary(
|
||||
readonly=True, compute='_compute_margin', store=True,
|
||||
digits=dp.get_precision('Account'))
|
||||
margin_company_currency = fields.Float(
|
||||
string='Margin in Company Currency',
|
||||
compute='_compute_margin', store=True, readonly=True,
|
||||
currency_field='company_currency_id')
|
||||
readonly=True, compute='_compute_margin', store=True,
|
||||
digits=dp.get_precision('Account'))
|
||||
|
||||
@api.one
|
||||
@api.depends(
|
||||
'type',
|
||||
'invoice_line_ids.margin_invoice_currency',
|
||||
'invoice_line_ids.margin_company_currency')
|
||||
'invoice_line.margin_invoice_currency',
|
||||
'invoice_line.margin_company_currency')
|
||||
def _compute_margin(self):
|
||||
res = self.env['account.invoice.line'].read_group(
|
||||
[('invoice_id', 'in', self.ids)],
|
||||
['invoice_id', 'margin_invoice_currency',
|
||||
'margin_company_currency'],
|
||||
['invoice_id'])
|
||||
for re in res:
|
||||
if re['invoice_id']:
|
||||
inv = self.browse(re['invoice_id'][0])
|
||||
if inv.type in ('out_invoice', 'out_refund'):
|
||||
inv.margin_invoice_currency = re['margin_invoice_currency']
|
||||
inv.margin_company_currency = re['margin_company_currency']
|
||||
margin_inv_cur = 0.0
|
||||
margin_comp_cur = 0.0
|
||||
if self.type in ('out_invoice', 'out_refund'):
|
||||
for il in self.invoice_line:
|
||||
margin_inv_cur += il.margin_invoice_currency
|
||||
margin_comp_cur += il.margin_company_currency
|
||||
self.margin_invoice_currency = margin_inv_cur
|
||||
self.margin_company_currency = margin_comp_cur
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
# Copyright 2018-2019 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 api, fields, models
|
||||
|
||||
|
||||
class AccountInvoiceReport(models.Model):
|
||||
_inherit = 'account.invoice.report'
|
||||
|
||||
margin = fields.Float(string='Margin', readonly=True)
|
||||
# why digits=0 ??? Why is it like that in the native "account" module
|
||||
user_currency_margin = fields.Float(
|
||||
string="Margin", compute='_compute_user_currency_margin', digits=0)
|
||||
|
||||
_depends = {
|
||||
'account.invoice': [
|
||||
'account_id', 'amount_total_company_signed',
|
||||
'commercial_partner_id', 'company_id',
|
||||
'currency_id', 'date_due', 'date_invoice', 'fiscal_position_id',
|
||||
'journal_id', 'number', 'partner_bank_id', 'partner_id',
|
||||
'payment_term_id', 'residual', 'state', 'type', 'user_id',
|
||||
],
|
||||
'account.invoice.line': [
|
||||
'account_id', 'invoice_id', 'price_subtotal', 'product_id',
|
||||
'quantity', 'uom_id', 'account_analytic_id',
|
||||
'margin_company_currency',
|
||||
],
|
||||
'product.product': ['product_tmpl_id'],
|
||||
'product.template': ['categ_id'],
|
||||
'uom.uom': ['category_id', 'factor', 'name', 'uom_type'],
|
||||
'res.currency.rate': ['currency_id', 'name'],
|
||||
'res.partner': ['country_id'],
|
||||
}
|
||||
|
||||
@api.depends('currency_id', 'date', 'margin')
|
||||
def _compute_user_currency_margin(self):
|
||||
user_currency = self.env.user.company_id.currency_id
|
||||
currency_rate = self.env['res.currency.rate'].search([
|
||||
('rate', '=', 1),
|
||||
'|',
|
||||
('company_id', '=', self.env.user.company_id.id),
|
||||
('company_id', '=', False)], limit=1)
|
||||
base_currency = currency_rate.currency_id
|
||||
for record in self:
|
||||
date = record.date or fields.Date.today()
|
||||
company = record.company_id
|
||||
record.user_currency_margin = base_currency._convert(
|
||||
record.margin, user_currency, company, date)
|
||||
|
||||
# TODO check for refunds
|
||||
def _sub_select(self):
|
||||
select_str = super(AccountInvoiceReport, self)._sub_select()
|
||||
select_str += ", SUM(ail.margin_company_currency) AS margin"
|
||||
return select_str
|
||||
|
||||
def _select(self):
|
||||
select_str = super(AccountInvoiceReport, self)._select()
|
||||
select_str += ", sub.margin AS margin"
|
||||
return select_str
|
||||
@@ -1,35 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
© 2015-2017 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
Copyright (C) 2015 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_invoice_line_form" model="ir.ui.view">
|
||||
<field name="name">margin.account.invoice.line.form</field>
|
||||
<field name="model">account.invoice.line</field>
|
||||
<field name="inherit_id" ref="account.view_invoice_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='analytic_tag_ids']/.." position="inside">
|
||||
<field name="discount" position="after">
|
||||
<field name="standard_price_company_currency"
|
||||
string="Cost Price in Comp. Cur."
|
||||
groups="base.group_no_one"/>
|
||||
groups="account.group_account_user"/>
|
||||
<field name="standard_price_invoice_currency"
|
||||
string="Cost Price in Inv. Cur."
|
||||
groups="base.group_no_one"/>
|
||||
widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"
|
||||
groups="account.group_account_user"/>
|
||||
<field name="margin_invoice_currency"
|
||||
string="Margin in Inv. Cur."
|
||||
groups="base.group_no_one"/>
|
||||
widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"
|
||||
groups="account.group_account_user"/>
|
||||
<field name="margin_company_currency"
|
||||
string="Margin in Comp. Cur."
|
||||
groups="base.group_no_one"/>
|
||||
<label for="margin_rate" groups="base.group_no_one"/>
|
||||
<div name="margin_rate" groups="base.group_no_one">
|
||||
<field name="margin_rate" class="oe_inline"/> %
|
||||
</div>
|
||||
</xpath>
|
||||
groups="account.group_account_user"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -40,12 +37,23 @@
|
||||
<field name="arch" type="xml">
|
||||
<field name="move_id" position="after">
|
||||
<field name="margin_invoice_currency"
|
||||
string="Margin in Inv. Cur." groups="base.group_no_one"/>
|
||||
string="Margin"
|
||||
widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"
|
||||
groups="account.group_account_user"/>
|
||||
<field name="margin_company_currency"
|
||||
string="Margin in Comp. Cur." groups="base.group_no_one"/>
|
||||
groups="account.group_account_user"/>
|
||||
</field>
|
||||
<xpath expr="//field[@name='invoice_line']/tree/field[@name='price_subtotal']" position="after">
|
||||
<field name="standard_price_invoice_currency" groups="base.group_no_one"/>
|
||||
<field name="standard_price_company_currency" groups="base.group_no_one"/>
|
||||
<field name="margin_invoice_currency" groups="base.group_no_one"/>
|
||||
<field name="margin_company_currency" groups="base.group_no_one"/>
|
||||
<field name="margin_rate" groups="base.group_no_one"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
3
account_invoice_margin_report/__init__.py
Normal file
3
account_invoice_margin_report/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import report
|
||||
41
account_invoice_margin_report/__openerp__.py
Normal file
41
account_invoice_margin_report/__openerp__.py
Normal file
@@ -0,0 +1,41 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Margin Report module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Invoice Margin Report',
|
||||
'version': '0.1',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Add margin measure in Invoices Analysis',
|
||||
'description': """
|
||||
This module adds the measure *Margin* in the Invoices Analysis pivot table. It is in a separate module because it depends on the module *bi_invoice_company_currency* (in which I re-wrote the Invoice Analysis pivot table).
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion
|
||||
<alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account_invoice_margin', 'bi_invoice_company_currency'],
|
||||
'data': [],
|
||||
'installable': False,
|
||||
}
|
||||
3
account_invoice_margin_report/report/__init__.py
Normal file
3
account_invoice_margin_report/report/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import invoice_report
|
||||
39
account_invoice_margin_report/report/invoice_report.py
Normal file
39
account_invoice_margin_report/report/invoice_report.py
Normal file
@@ -0,0 +1,39 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Margin Report module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com/)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp import models, fields
|
||||
import openerp.addons.decimal_precision as dp
|
||||
|
||||
|
||||
class AccountInvoiceReportBi(models.Model):
|
||||
_inherit = "account.invoice.report.bi"
|
||||
|
||||
margin_company_currency = fields.Float(
|
||||
string='Margin', readonly=True,
|
||||
digits=dp.get_precision('Account'))
|
||||
|
||||
def _select(self):
|
||||
select = super(AccountInvoiceReportBi, self)._select()
|
||||
select += """
|
||||
, sum(ail.margin_company_currency) AS margin_company_currency
|
||||
"""
|
||||
return select
|
||||
@@ -1 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_invoice
|
||||
43
account_invoice_partner_bank_usability/__openerp__.py
Normal file
43
account_invoice_partner_bank_usability/__openerp__.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Partner Bank Usability module for Odoo
|
||||
# Copyright (C) 2013-2016 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Invoice Partner Bank Usability',
|
||||
'version': '0.1',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Configure a bank account by default for customer invoices',
|
||||
'description': """
|
||||
Account Invoice Partner Bank Usability
|
||||
======================================
|
||||
|
||||
This module adds a configuration parameter on the company that allows you to choose which bank account of your company will be selected by default on customer invoices.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account'],
|
||||
'data': ['company_view.xml'],
|
||||
'installable': False,
|
||||
}
|
||||
48
account_invoice_partner_bank_usability/account_invoice.py
Normal file
48
account_invoice_partner_bank_usability/account_invoice.py
Normal file
@@ -0,0 +1,48 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Partner Bank Usability module for Odoo
|
||||
# Copyright (C) 2013-2016 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp import models, fields
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
default_out_invoice_partner_bank_id = fields.Many2one(
|
||||
'res.partner.bank',
|
||||
string='Default Bank Account for Customer Invoices',
|
||||
copy=False, ondelete='restrict',
|
||||
help="This is the bank account of your company that will be selected "
|
||||
"by default when you create a customer invoice.")
|
||||
|
||||
|
||||
class AccountInvoice(models.Model):
|
||||
_inherit = "account.invoice"
|
||||
|
||||
def invoice_out_default_bank_account(self):
|
||||
partner_bank_id = False
|
||||
if self._context.get('type') == 'out_invoice' or \
|
||||
self._context.get('inv_type') == 'out_invoice':
|
||||
partner_bank_id = self.env.user.company_id.\
|
||||
default_out_invoice_partner_bank_id.id or False
|
||||
return partner_bank_id
|
||||
|
||||
partner_bank_id = fields.Many2one(default=invoice_out_default_bank_account)
|
||||
26
account_invoice_partner_bank_usability/company_view.xml
Normal file
26
account_invoice_partner_bank_usability/company_view.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 2016 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_company_form" model="ir.ui.view">
|
||||
<field name="name">account_invoice_partner_bank_usability.company.form</field>
|
||||
<field name="model">res.company</field>
|
||||
<field name="inherit_id" ref="base.view_company_form" />
|
||||
<field name="arch" type="xml">
|
||||
<group name="account_grp" position="inside">
|
||||
<field name="default_out_invoice_partner_bank_id"
|
||||
domain="[('company_id', '=', id)]"/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
23
account_invoice_picking_label/__init__.py
Normal file
23
account_invoice_picking_label/__init__.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Picking Label module for OpenERP
|
||||
# Copyright (C) 2013-2014 Akretion
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from . import account_invoice
|
||||
42
account_invoice_picking_label/__openerp__.py
Normal file
42
account_invoice_picking_label/__openerp__.py
Normal file
@@ -0,0 +1,42 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Picking Label module for OpenERP
|
||||
# Copyright (C) 2014 Akretion
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Invoice Picking Label',
|
||||
'version': '0.1',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Adds field picking_ids_label on account.invoice',
|
||||
'description': """
|
||||
Account Invoice Picking Label
|
||||
=============================
|
||||
|
||||
Adds a function field named *picking_ids_label* on invoices. This field contains the list of pickings related to the invoice as a string. This field is designed to be displayed in the invoice report.""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com/',
|
||||
'depends': ['stock_account'],
|
||||
'data': [],
|
||||
'installable': False,
|
||||
'active': False,
|
||||
}
|
||||
|
||||
52
account_invoice_picking_label/account_invoice.py
Normal file
52
account_invoice_picking_label/account_invoice.py
Normal file
@@ -0,0 +1,52 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Picking Label module for OpenERP
|
||||
# Copyright (C) 2013-2014 Akretion
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import orm, fields
|
||||
|
||||
|
||||
class account_invoice(orm.Model):
|
||||
_inherit = "account.invoice"
|
||||
|
||||
def _compute_picking_ids_label(
|
||||
self, cr, uid, ids, name, arg, context=None):
|
||||
res = {}
|
||||
for invoice in self.read(
|
||||
cr, uid, ids, ['picking_ids'], context=context):
|
||||
label = ''
|
||||
if invoice['picking_ids']:
|
||||
pickings = self.pool['stock.picking'].read(
|
||||
cr, uid, invoice['picking_ids'], ['name'],
|
||||
context=context)
|
||||
first = True
|
||||
for picking in pickings:
|
||||
if first:
|
||||
label += picking['name']
|
||||
first = False
|
||||
else:
|
||||
label += ', %s' % picking['name']
|
||||
res[invoice['id']] = label
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
'picking_ids_label': fields.function(
|
||||
_compute_picking_ids_label, type='char', string='Pickings'),
|
||||
}
|
||||
23
account_invoice_sale_link/__init__.py
Normal file
23
account_invoice_sale_link/__init__.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Sale Link module for OpenERP
|
||||
# Copyright (C) 2013 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from . import account_invoice
|
||||
46
account_invoice_sale_link/__openerp__.py
Normal file
46
account_invoice_sale_link/__openerp__.py
Normal file
@@ -0,0 +1,46 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Sale Link module for OpenERP
|
||||
# Copyright (C) 2013 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Invoice Sale Link',
|
||||
'version': '0.1',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Add the reverse link from invoices to sale orders',
|
||||
'description': """
|
||||
Account Invoice Sale Link
|
||||
=========================
|
||||
|
||||
On the customer invoice report, you usually need to display the customer order number. For that, you need to have the link from invoices to sale orders, and this link is not available in the official addons.
|
||||
|
||||
This module adds a field *sale_ids* on the object account.invoice, which is the reverse many2many field of the field *invoice_ids* of the object sale.order. It is displayed in a dedicated tab on the invoice form view.
|
||||
|
||||
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['sale'],
|
||||
'data': ['account_invoice_view.xml'],
|
||||
'installable': False,
|
||||
'active': False,
|
||||
}
|
||||
36
account_invoice_sale_link/account_invoice.py
Normal file
36
account_invoice_sale_link/account_invoice.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Sale Link module for OpenERP
|
||||
# Copyright (C) 2013 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import orm, fields
|
||||
|
||||
|
||||
class account_invoice(orm.Model):
|
||||
_inherit = 'account.invoice'
|
||||
|
||||
_columns = {
|
||||
# This is the reverse link of the field 'invoice_ids' of sale.order
|
||||
# defined in addons/sale/sale.py
|
||||
'sale_ids': fields.many2many(
|
||||
'sale.order', 'sale_order_invoice_rel', 'invoice_id',
|
||||
'order_id', 'Sale Orders', readonly=True,
|
||||
help="This is the list of sale orders related to this invoice."),
|
||||
}
|
||||
25
account_invoice_sale_link/account_invoice_view.xml
Normal file
25
account_invoice_sale_link/account_invoice_view.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2014 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="invoice_form" model="ir.ui.view">
|
||||
<field name="name">account_invoice_sale_link.invoice.form</field>
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="inherit_id" ref="account.invoice_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<notebook position="inside">
|
||||
<page name="sale_ids" string="Sale Orders">
|
||||
<field name="sale_ids"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,39 +0,0 @@
|
||||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
|
||||
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
|
||||
Account Invoice Update Wizard
|
||||
=============================
|
||||
|
||||
This module adds a button *Update Invoice* on Customer and Supplier invoices in
|
||||
Open or Paid state. This button starts a wizard which allows the user to update
|
||||
non-legal fields of the invoice:
|
||||
|
||||
* Source Document
|
||||
* Reference/Description
|
||||
* Payment terms (update allowed only to a payment term with same number of terms
|
||||
of the same amount and on invoices without any payment)
|
||||
* Bank Account
|
||||
* Salesman
|
||||
* Notes
|
||||
* Description of invoice lines
|
||||
* Analytic account
|
||||
* Analytic tags
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues
|
||||
<https://github.com/akretion/odoo-usability/issues>`_. In case of trouble, please
|
||||
check there if your issue has already been reported. If you spotted it first,
|
||||
help us smash it by providing detailed and welcomed feedback.
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* Florian da Costa <florian.dacosta@akretion.com>
|
||||
* Matthieu Dietrich <matthieu.dietrich@camptocamp.com>
|
||||
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
|
||||
* Mykhailo Panarin <m.panarin@mobilunity.com>
|
||||
* Artem Kostyuk <a.kostyuk@mobilunity.com>
|
||||
@@ -1,2 +1,3 @@
|
||||
from . import models
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import wizard
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
# Copyright 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# Copyright 2018-2019 Camptocamp
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Account Invoice Update Wizard',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Wizard to update non-legal fields of an open/paid invoice',
|
||||
'author': 'Akretion',
|
||||
'website': 'https://github.com/akretion/odoo-usability',
|
||||
'depends': [
|
||||
'account',
|
||||
],
|
||||
'data': [
|
||||
'wizard/account_invoice_update_view.xml',
|
||||
'views/account_invoice.xml',
|
||||
],
|
||||
'installable': False,
|
||||
}
|
||||
34
account_invoice_update_wizard/__openerp__.py
Normal file
34
account_invoice_update_wizard/__openerp__.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Account Invoice Update Wizard',
|
||||
'version': '8.0.1.0.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Wizard to update non-legal fields of an open/paid invoice',
|
||||
'description': """
|
||||
Account Invoice Update Wizard
|
||||
=============================
|
||||
|
||||
This module adds a button *Update Invoice* on Customer and Supplier invoices in Open or Paid state. This button starts a wizard which allows the user to update non-legal fields of the invoice:
|
||||
|
||||
* Source Document
|
||||
* Reference/Description
|
||||
* Payment terms (update allowed only to a payment term with same number of terms of the same amount and on invoices without any payment)
|
||||
* Bank Account
|
||||
* Salesman
|
||||
* Notes
|
||||
* Description of invoice lines
|
||||
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account'],
|
||||
'data': [
|
||||
'wizard/account_invoice_update_view.xml',
|
||||
'views/account_invoice.xml',
|
||||
],
|
||||
'installable': False,
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
# Copyright 2019 Camptocamp
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import UserError
|
||||
import odoo.addons.decimal_precision as dp
|
||||
|
||||
|
||||
class AccountInvoice(models.Model):
|
||||
_inherit = 'account.invoice'
|
||||
|
||||
def prepare_update_wizard(self):
|
||||
self.ensure_one()
|
||||
wizard = self.env['account.invoice.update']
|
||||
res = wizard._prepare_default_get(self)
|
||||
action = self.env.ref(
|
||||
'account_invoice_update_wizard.account_invoice_update_action'
|
||||
).read()[0]
|
||||
action['name'] = "Update Wizard"
|
||||
action['res_id'] = wizard.create(res).id
|
||||
return action
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
from . import test_account_invoice_update_wizard
|
||||
@@ -1,196 +0,0 @@
|
||||
# Copyright 2018-2019 Camptocamp
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo.tests.common import SavepointCase
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class TestAccountInvoiceUpdateWizard(SavepointCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.customer12 = cls.env.ref('base.res_partner_12')
|
||||
cls.product16 = cls.env.ref('product.product_product_16')
|
||||
cls.product24 = cls.env.ref('product.product_product_24')
|
||||
uom_unit = cls.env.ref('uom.product_uom_categ_unit')
|
||||
|
||||
cls.invoice1 = cls.env['account.invoice'].create({
|
||||
'name': 'Test invoice',
|
||||
'partner_id': cls.customer12.id,
|
||||
})
|
||||
cls.inv_line1 = cls.env['account.invoice.line'].create({
|
||||
'invoice_id': cls.invoice1.id,
|
||||
'name': "Line1",
|
||||
'product_id': cls.product16.id,
|
||||
'product_uom_id': uom_unit.id,
|
||||
'account_id': cls.invoice1.account_id.id,
|
||||
'price_unit': 42.0,
|
||||
})
|
||||
cls.inv_line2 = cls.env['account.invoice.line'].create({
|
||||
'invoice_id': cls.invoice1.id,
|
||||
'name': "Line2",
|
||||
'product_id': cls.product24.id,
|
||||
'product_uom_id': uom_unit.id,
|
||||
'account_id': cls.invoice1.account_id.id,
|
||||
'price_unit': 1111.1,
|
||||
})
|
||||
|
||||
cls.aa1 = cls.env.ref('analytic.analytic_partners_camp_to_camp')
|
||||
cls.aa2 = cls.env.ref('analytic.analytic_nebula')
|
||||
cls.atag1 = cls.env.ref('analytic.tag_contract')
|
||||
cls.atag2 = cls.env['account.analytic.tag'].create({
|
||||
'name': 'の',
|
||||
})
|
||||
|
||||
def create_wizard(self, invoice):
|
||||
res = self.invoice1.prepare_update_wizard()
|
||||
self.wiz = self.env['account.invoice.update'].browse(res['res_id'])
|
||||
|
||||
def test_add_analytic_account_line1(self):
|
||||
""" Add analytic account on an invoice line
|
||||
after the invoice has been approved.
|
||||
|
||||
This will:
|
||||
- update the move line
|
||||
- create a new analytic line.
|
||||
"""
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard(self.invoice1)
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.account_analytic_id = self.aa1
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_account_id, self.aa1)
|
||||
self.assertEqual(related_ml.analytic_line_ids.account_id, self.aa1)
|
||||
|
||||
def test_change_analytic_account_line1(self):
|
||||
""" Change analytic account on an invoice line
|
||||
after the invoice has been approved.
|
||||
|
||||
This will:
|
||||
- update the move line
|
||||
- update the existing analytic line."""
|
||||
self.inv_line1.account_analytic_id = self.aa2
|
||||
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard(self.invoice1)
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.account_analytic_id = self.aa1
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_account_id, self.aa1)
|
||||
self.assertEqual(related_ml.analytic_line_ids.account_id, self.aa1)
|
||||
|
||||
def test_error_grouped_move_lines(self):
|
||||
""" Change analytic account on an invoice line
|
||||
after the invoice has been approved where both
|
||||
lines were grouped in the same move line.
|
||||
|
||||
This will raise an error.
|
||||
"""
|
||||
self.invoice1.journal_id.group_invoice_lines = True
|
||||
|
||||
self.inv_line2.product_id = self.product16
|
||||
self.inv_line2.unit_price = 42.0
|
||||
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard(self.invoice1)
|
||||
|
||||
line1 = self.wiz.line_ids[0]
|
||||
line1.account_analytic_id = self.aa1
|
||||
with self.assertRaises(UserError):
|
||||
self.wiz.run()
|
||||
|
||||
def test_add_analytic_tags_line1(self):
|
||||
""" Add analytic tags on an invoice line
|
||||
after the invoice has been approved.
|
||||
|
||||
This will update move line.
|
||||
"""
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard(self.invoice1)
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.analytic_tag_ids = self.atag2
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_tag_ids, self.atag2)
|
||||
self.assertFalse(related_ml.analytic_line_ids)
|
||||
|
||||
def test_change_analytic_tags_line1(self):
|
||||
""" Change analytic tags on an invoice line
|
||||
after the invoice has been approved.
|
||||
|
||||
It will update move line and analytic line
|
||||
"""
|
||||
self.inv_line1.account_analytic_id = self.aa2
|
||||
self.inv_line1.analytic_tag_ids = self.atag1
|
||||
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard(self.invoice1)
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.analytic_tag_ids = self.atag2
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_tag_ids, self.atag2)
|
||||
self.assertEqual(related_ml.analytic_line_ids.tag_ids, self.atag2)
|
||||
|
||||
def test_add_analytic_info_line1(self):
|
||||
""" Add analytic account and tags on an invoice line
|
||||
after the invoice has been approved.
|
||||
|
||||
This will:
|
||||
- update move line
|
||||
- create an analytic line
|
||||
"""
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard(self.invoice1)
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.account_analytic_id = self.aa1
|
||||
wiz_line.analytic_tag_ids = self.atag2
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_account_id, self.aa1)
|
||||
self.assertEqual(related_ml.analytic_tag_ids, self.atag2)
|
||||
self.assertEqual(related_ml.analytic_line_ids.account_id, self.aa1)
|
||||
self.assertEqual(related_ml.analytic_line_ids.tag_ids, self.atag2)
|
||||
|
||||
def test_empty_analytic_account_line1(self):
|
||||
""" Remove analytic account
|
||||
after the invoice has been approved.
|
||||
|
||||
This will raise an error as it is not implemented.
|
||||
"""
|
||||
self.inv_line1.account_analytic_id = self.aa2
|
||||
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard(self.invoice1)
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.account_analytic_id = False
|
||||
self.wiz.run()
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertFalse(related_ml.analytic_account_id)
|
||||
self.assertFalse(related_ml.analytic_line_ids)
|
||||
@@ -1,17 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
© 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="invoice_supplier_form" model="ir.ui.view">
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="inherit_id" ref="account.invoice_supplier_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_invoice_draft" position="before">
|
||||
<button name="prepare_update_wizard" type="object" string="Update Invoice" states="open,paid" groups="account.group_account_invoice"/>
|
||||
<button name="invoice_cancel" position="before">
|
||||
<button name="%(account_invoice_update_action)d" type="action" string="Update Invoice" states="open,paid" groups="account.group_account_invoice"/>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
@@ -20,10 +21,11 @@
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="inherit_id" ref="account.invoice_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_invoice_draft" position="before">
|
||||
<button name="prepare_update_wizard" type="object" string="Update Invoice" states="open,paid" groups="account.group_account_invoice"/>
|
||||
<button name="invoice_cancel" position="before">
|
||||
<button name="%(account_invoice_update_action)d" type="action" string="Update Invoice" states="open,paid" groups="account.group_account_invoice"/>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_invoice_update
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# Copyright 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# Copyright 2018-2019 Camptocamp
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import UserError
|
||||
import odoo.addons.decimal_precision as dp
|
||||
from openerp import models, fields, api, _
|
||||
from openerp.exceptions import Warning as UserError
|
||||
import openerp.addons.decimal_precision as dp
|
||||
|
||||
|
||||
class AccountInvoiceUpdate(models.TransientModel):
|
||||
@@ -17,11 +17,15 @@ class AccountInvoiceUpdate(models.TransientModel):
|
||||
type = fields.Selection(related='invoice_id.type', readonly=True)
|
||||
company_id = fields.Many2one(
|
||||
related='invoice_id.company_id', readonly=True)
|
||||
partner_id = fields.Many2one(
|
||||
related='invoice_id.partner_id', readonly=True)
|
||||
commercial_partner_id = fields.Many2one(
|
||||
related='invoice_id.commercial_partner_id', readonly=True)
|
||||
user_id = fields.Many2one('res.users', string='Salesperson')
|
||||
payment_term_id = fields.Many2one(
|
||||
'account.payment.term', string='Payment Term')
|
||||
# I use the same field name as the original invoice field name
|
||||
# even if it the name is "bad"
|
||||
# Updating payment_term will not work if you use
|
||||
# the OCA module account_constraints (you will just get an error)
|
||||
payment_term = fields.Many2one(
|
||||
'account.payment.term', string='Payment Terms')
|
||||
reference = fields.Char(string='Invoice Reference')
|
||||
name = fields.Char(string='Reference/Description')
|
||||
origin = fields.Char(string='Source Document')
|
||||
@@ -38,7 +42,7 @@ class AccountInvoiceUpdate(models.TransientModel):
|
||||
|
||||
@api.model
|
||||
def _m2o_fields2update(self):
|
||||
return ['payment_term_id', 'user_id', 'partner_bank_id']
|
||||
return ['payment_term', 'user_id', 'partner_bank_id']
|
||||
|
||||
@api.model
|
||||
def _prepare_default_get(self, invoice):
|
||||
@@ -47,18 +51,22 @@ class AccountInvoiceUpdate(models.TransientModel):
|
||||
res[sfield] = invoice[sfield]
|
||||
for m2ofield in self._m2o_fields2update():
|
||||
res[m2ofield] = invoice[m2ofield].id or False
|
||||
for line in invoice.invoice_line_ids:
|
||||
aa_tags = line.analytic_tag_ids
|
||||
aa_tags = [(6, 0, aa_tags.ids)] if aa_tags else False
|
||||
res['line_ids'].append([0, 0, {
|
||||
for line in invoice.invoice_line:
|
||||
res['line_ids'].append({
|
||||
'invoice_line_id': line.id,
|
||||
'name': line.name,
|
||||
'quantity': line.quantity,
|
||||
'price_subtotal': line.price_subtotal,
|
||||
'account_analytic_id': line.account_analytic_id.id,
|
||||
'analytic_tag_ids': aa_tags,
|
||||
'display_type': line.display_type,
|
||||
}])
|
||||
})
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields_list):
|
||||
res = super(AccountInvoiceUpdate, self).default_get(fields_list)
|
||||
assert self._context.get('active_model') == 'account.invoice',\
|
||||
'active_model should be account.invoice'
|
||||
inv = self.env['account.invoice'].browse(self._context['active_id'])
|
||||
res = self._prepare_default_get(inv)
|
||||
return res
|
||||
|
||||
@api.onchange('type')
|
||||
@@ -66,10 +74,10 @@ class AccountInvoiceUpdate(models.TransientModel):
|
||||
res = {'domain': {}}
|
||||
if self.type in ('out_invoice', 'out_refund'):
|
||||
res['domain']['partner_bank_id'] =\
|
||||
"[('partner_id.ref_company_ids', 'in', [company_id])]"
|
||||
"[('partner_id.ref_companies', 'in', [company_id])]"
|
||||
else:
|
||||
res['domain']['partner_bank_id'] =\
|
||||
"[('partner_id', '=', partner_id)]"
|
||||
"[('partner_id', '=', commercial_partner_id)]"
|
||||
return res
|
||||
|
||||
@api.multi
|
||||
@@ -82,37 +90,18 @@ class AccountInvoiceUpdate(models.TransientModel):
|
||||
for m2ofield in self._m2o_fields2update():
|
||||
if self[m2ofield] != inv[m2ofield]:
|
||||
vals[m2ofield] = self[m2ofield].id or False
|
||||
if 'payment_term_id' in vals:
|
||||
pterm_list = self.payment_term_id.compute(
|
||||
if 'payment_term' in vals:
|
||||
pterm_list = self.payment_term.compute(
|
||||
value=1, date_ref=inv.date_invoice)[0]
|
||||
if pterm_list:
|
||||
vals['date_due'] = max(line[0] for line in pterm_list)
|
||||
return vals
|
||||
|
||||
@api.model
|
||||
def _line_simple_fields2update(self):
|
||||
return ["name",]
|
||||
|
||||
@api.model
|
||||
def _line_m2o_fields2update(self):
|
||||
return ["account_analytic_id",]
|
||||
|
||||
@api.model
|
||||
def _line_m2m_fields2update(self):
|
||||
return ["analytic_tag_ids",]
|
||||
|
||||
@api.model
|
||||
def _prepare_invoice_line(self, line):
|
||||
vals = {}
|
||||
for field in self._line_simple_fields2update():
|
||||
if line[field] != line.invoice_line_id[field]:
|
||||
vals[field] = line[field]
|
||||
for field in self._line_m2o_fields2update():
|
||||
if line[field] != line.invoice_line_id[field]:
|
||||
vals[field] = line[field].id
|
||||
for field in self._line_m2m_fields2update():
|
||||
if line[field] != line.invoice_line_id[field]:
|
||||
vals[field] = [(6, 0, line[field].ids)]
|
||||
if line.name != line.invoice_line_id.name:
|
||||
vals['name'] = line.name
|
||||
return vals
|
||||
|
||||
@api.multi
|
||||
@@ -125,65 +114,15 @@ class AccountInvoiceUpdate(models.TransientModel):
|
||||
mvals['ref'] = ref
|
||||
return mvals
|
||||
|
||||
@api.multi
|
||||
def _get_matching_inv_line(self, move_line):
|
||||
""" Find matching invoice line by product """
|
||||
# TODO make it accept more case as lines won't
|
||||
# be grouped unless journal.group_invoice_line is True
|
||||
inv_line = self.invoice_id.invoice_line_ids.filtered(
|
||||
lambda rec: rec.product_id == move_line.product_id)
|
||||
if len(inv_line) != 1:
|
||||
raise UserError(
|
||||
"Cannot match a single invoice line to move line %s" %
|
||||
move_line.name)
|
||||
return inv_line
|
||||
|
||||
@api.multi
|
||||
def _prepare_move_line(self, inv_line):
|
||||
mlvals = {}
|
||||
inv_line_upd = self.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == inv_line)
|
||||
|
||||
ini_aa = inv_line.account_analytic_id
|
||||
new_aa = inv_line_upd.account_analytic_id
|
||||
|
||||
if ini_aa != new_aa:
|
||||
mlvals['analytic_account_id'] = new_aa.id
|
||||
|
||||
ini_aa_tags = inv_line.analytic_tag_ids
|
||||
new_aa_tags = inv_line_upd.analytic_tag_ids
|
||||
|
||||
if ini_aa_tags != new_aa_tags:
|
||||
mlvals['analytic_tag_ids'] = [(6, None, new_aa_tags.ids)]
|
||||
return mlvals
|
||||
|
||||
@api.multi
|
||||
def _prepare_analytic_line(self, inv_line):
|
||||
alvals = {}
|
||||
inv_line_upd = self.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == inv_line)
|
||||
|
||||
ini_aa = inv_line.account_analytic_id
|
||||
new_aa = inv_line_upd.account_analytic_id
|
||||
|
||||
if ini_aa != new_aa:
|
||||
alvals['account_id'] = new_aa.id
|
||||
|
||||
ini_aa_tags = inv_line.analytic_tag_ids
|
||||
new_aa_tags = inv_line_upd.analytic_tag_ids
|
||||
|
||||
if ini_aa_tags != new_aa_tags:
|
||||
alvals['tag_ids'] = [(6, None, new_aa_tags.ids)]
|
||||
return alvals
|
||||
|
||||
@api.multi
|
||||
def _update_payment_term_move(self):
|
||||
self.ensure_one()
|
||||
inv = self.invoice_id
|
||||
if (
|
||||
self.payment_term_id and
|
||||
self.payment_term_id != inv.payment_term_id and
|
||||
inv.move_id):
|
||||
self.payment_term and
|
||||
self.payment_term != inv.payment_term and
|
||||
inv.move_id and
|
||||
inv.move_id.period_id.state == 'draft'):
|
||||
# I don't update pay term when the invoice is partially (or fully)
|
||||
# paid because if you have a payment term with several lines
|
||||
# of the same amount, you would also have to take into account
|
||||
@@ -195,7 +134,7 @@ class AccountInvoiceUpdate(models.TransientModel):
|
||||
"terms on an invoice which is partially or fully "
|
||||
"paid."))
|
||||
prec = self.env['decimal.precision'].precision_get('Account')
|
||||
term_res = self.payment_term_id.compute(
|
||||
term_res = self.payment_term.compute(
|
||||
inv.amount_total, inv.date_invoice)[0]
|
||||
new_pterm = {} # key = int(amount * 100), value = [date1, date2]
|
||||
for entry in term_res:
|
||||
@@ -205,14 +144,14 @@ class AccountInvoiceUpdate(models.TransientModel):
|
||||
else:
|
||||
new_pterm[amount] = [entry[0]]
|
||||
mlines = {} # key = int(amount * 100), value : [line1, line2]
|
||||
for line in inv.move_id.line_ids:
|
||||
for line in inv.move_id.line_id:
|
||||
if line.account_id == inv.account_id:
|
||||
amount = int(abs(line.credit - line.debit) * 10 * prec)
|
||||
if amount in mlines:
|
||||
mlines[amount].append(line)
|
||||
else:
|
||||
mlines[amount] = [line]
|
||||
for iamount, lines in mlines.items():
|
||||
for iamount, lines in mlines.iteritems():
|
||||
if len(lines) != len(new_pterm.get(iamount, [])):
|
||||
raise UserError(_(
|
||||
"The original payment term '%s' doesn't have the "
|
||||
@@ -220,7 +159,7 @@ class AccountInvoiceUpdate(models.TransientModel):
|
||||
"new payment term '%s'. You can only switch to a "
|
||||
"payment term that has the same number of terms "
|
||||
"with the same amount.") % (
|
||||
inv.payment_term_id.name, self.payment_term_id.name))
|
||||
inv.payment_term.name, self.payment_term.name))
|
||||
for line in lines:
|
||||
line.date_maturity = new_pterm[iamount].pop()
|
||||
|
||||
@@ -235,45 +174,17 @@ class AccountInvoiceUpdate(models.TransientModel):
|
||||
if ivals:
|
||||
updated = True
|
||||
inv.write(ivals)
|
||||
if inv.move_id:
|
||||
mvals = self._prepare_move()
|
||||
if mvals:
|
||||
inv.move_id.write(mvals)
|
||||
for ml in inv.move_id.line_ids.filtered(
|
||||
# we are only interested in invoice lines, not tax lines
|
||||
lambda rec: bool(rec.product_id)
|
||||
):
|
||||
if ml.credit == 0.0:
|
||||
continue
|
||||
inv_line = self._get_matching_inv_line(ml)
|
||||
mlvals = self._prepare_move_line(inv_line)
|
||||
if mlvals:
|
||||
updated = True
|
||||
ml.write(mlvals)
|
||||
aalines = ml.analytic_line_ids
|
||||
alvals = self._prepare_analytic_line(inv_line)
|
||||
if aalines and alvals:
|
||||
updated = True
|
||||
if ('account_id' in alvals and
|
||||
alvals['account_id'] is False):
|
||||
former_aa = inv_line.account_analytic_id
|
||||
to_remove_aalines = aalines.filtered(
|
||||
lambda rec: rec.account_id == former_aa)
|
||||
# remove existing analytic line
|
||||
to_remove_aalines.unlink()
|
||||
else:
|
||||
aalines.write(alvals)
|
||||
elif 'account_id' in alvals:
|
||||
# Create analytic lines if analytic account
|
||||
# is added later
|
||||
ml.create_analytic_lines()
|
||||
for line in self.line_ids:
|
||||
ilvals = self._prepare_invoice_line(line)
|
||||
if ilvals:
|
||||
updated = True
|
||||
line.invoice_line_id.write(ilvals)
|
||||
if inv.move_id and inv.move_id.period_id.state == 'draft':
|
||||
mvals = self._prepare_move()
|
||||
if mvals:
|
||||
inv.move_id.write(mvals)
|
||||
if updated:
|
||||
inv.message_post(body=_(
|
||||
inv.message_post(_(
|
||||
'Non-legal fields of invoice updated via the Invoice Update '
|
||||
'wizard.'))
|
||||
return True
|
||||
@@ -288,15 +199,8 @@ class AccountInvoiceLineUpdate(models.TransientModel):
|
||||
invoice_line_id = fields.Many2one(
|
||||
'account.invoice.line', string='Invoice Line', readonly=True)
|
||||
name = fields.Text(string='Description', required=True)
|
||||
display_type = fields.Selection([
|
||||
('line_section', "Section"),
|
||||
('line_note', "Note")], default=False, help="Technical field for UX purpose.")
|
||||
quantity = fields.Float(
|
||||
string='Quantity', digits=dp.get_precision('Product Unit of Measure'),
|
||||
readonly=True)
|
||||
price_subtotal = fields.Float(
|
||||
string='Amount', readonly=True, digits=dp.get_precision('Account'))
|
||||
account_analytic_id = fields.Many2one(
|
||||
'account.analytic.account', string='Analytic Account')
|
||||
analytic_tag_ids = fields.Many2many(
|
||||
'account.analytic.tag', string='Analytic Tags')
|
||||
|
||||
@@ -4,51 +4,51 @@
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="account_invoice_update_form" model="ir.ui.view">
|
||||
<field name="model">account.invoice.update</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Update Invoice Wizard">
|
||||
<group name="main">
|
||||
<field name="invoice_id" invisible="1"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="reference" attrs="{'invisible': [('type', 'not in', ('in_invoice', 'in_refund'))]}"/>
|
||||
<field name="origin"/>
|
||||
<field name="name"/>
|
||||
<field name="payment_term_id" widget="selection"/>
|
||||
<field name="partner_bank_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="comment"/>
|
||||
</group>
|
||||
<group name="lines">
|
||||
<field name="line_ids" nolabel="1">
|
||||
<tree editable="bottom" create="false" delete="false" edit="true">
|
||||
<field name="invoice_line_id" invisible="1"/>
|
||||
<field name="display_type" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="quantity" attrs="{'invisible': [('display_type', '!=', False)]}"/>
|
||||
<field name="price_subtotal" attrs="{'invisible': [('display_type', '!=', False)]}"/>
|
||||
<field name="account_analytic_id" attrs="{'invisible': [('display_type', '!=', False)]}" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="analytic_tag_ids" attrs="{'invisible': [('display_type', '!=', False)]}" groups="analytic.group_analytic_accounting" widget="many2many_tags"/>
|
||||
<record id="account_invoice_update_form" model="ir.ui.view">
|
||||
<field name="model">account.invoice.update</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Update Invoice Wizard">
|
||||
<group name="main">
|
||||
<field name="invoice_id" invisible="1"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="commercial_partner_id" invisible="1"/>
|
||||
<field name="reference" attrs="{'invisible': [('type', 'not in', ('in_invoice', 'in_refund'))]}"/>
|
||||
<field name="origin"/>
|
||||
<field name="name"/>
|
||||
<field name="payment_term" widget="selection"/>
|
||||
<field name="partner_bank_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="comment"/>
|
||||
</group>
|
||||
<group name="lines">
|
||||
<field name="line_ids" nolabel="1">
|
||||
<tree editable="bottom">
|
||||
<field name="invoice_line_id" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="quantity"/>
|
||||
<field name="price_subtotal"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="run" type="object" class="oe_highlight" string="Update"/>
|
||||
<button special="cancel" string="Cancel" class="oe_link"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
</field>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="run" type="object" class="oe_highlight" string="Update"/>
|
||||
or
|
||||
<button special="cancel" string="Cancel" class="oe_link"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account_invoice_update_action" model="ir.actions.act_window">
|
||||
<field name="name">Invoice Update Wizard</field>
|
||||
<field name="res_model">account.invoice.update</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
<record id="account_invoice_update_action" model="ir.actions.act_window">
|
||||
<field name="name">Invoice Update Wizard</field>
|
||||
<field name="res_model">account.invoice.update</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
3
account_move_line_filter_wizard/__init__.py
Normal file
3
account_move_line_filter_wizard/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import wizard
|
||||
43
account_move_line_filter_wizard/__openerp__.py
Normal file
43
account_move_line_filter_wizard/__openerp__.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Move Line Filter Wizard module for Odoo
|
||||
# Copyright (C) 2016 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Move Line Filter Wizard',
|
||||
'version': '0.1',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Easy and fast access to the details of an account',
|
||||
'description': """
|
||||
Account Move Line Filter Wizard
|
||||
===============================
|
||||
|
||||
This module adds a wizard in Accounting > ... >
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account_usability'],
|
||||
'data': ['wizard/account_move_line_filter_view.xml'],
|
||||
'installable': False,
|
||||
}
|
||||
3
account_move_line_filter_wizard/wizard/__init__.py
Normal file
3
account_move_line_filter_wizard/wizard/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_move_line_filter
|
||||
@@ -0,0 +1,65 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Move Line Filter Wizard module for Odoo
|
||||
# Copyright (C) 2016 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp import models, fields, api
|
||||
|
||||
|
||||
class AccountMoveLineFilterWizard(models.TransientModel):
|
||||
_name = 'account.move.line.filter.wizard'
|
||||
_description = 'Wizard for easy and fast access to account move lines'
|
||||
|
||||
partner_id = fields.Many2one(
|
||||
'res.partner', string='Partner', domain=[('parent_id', '=', False)])
|
||||
account_id = fields.Many2one(
|
||||
'account.account', string='Account',
|
||||
domain=[('type', 'not in', ('view', 'closed'))], required=True)
|
||||
account_reconcile = fields.Boolean(related='account_id.reconcile')
|
||||
reconcile = fields.Selection([
|
||||
('unreconciled', 'Unreconciled'),
|
||||
('reconciled', 'Fully Reconciled'),
|
||||
('partial_reconciled', 'Partially Reconciled'),
|
||||
], string='Reconciliation Filter')
|
||||
|
||||
@api.onchange('partner_id')
|
||||
def partner_id_change(self):
|
||||
if self.partner_id:
|
||||
if self.partner_id.customer:
|
||||
self.account_id =\
|
||||
self.partner_id.property_account_receivable.id
|
||||
else:
|
||||
self.account_id = self.partner_id.property_account_payable.id
|
||||
|
||||
@api.multi
|
||||
def go(self):
|
||||
self.ensure_one()
|
||||
action = self.env['ir.actions.act_window'].for_xml_id(
|
||||
'account', 'action_account_moves_all_a')
|
||||
action['context'] = {
|
||||
'search_default_account_id': [self.account_id.id],
|
||||
'journal_show_code_only': True,
|
||||
}
|
||||
if self.partner_id:
|
||||
action['context']['search_default_partner_id'] =\
|
||||
[self.partner_id.id]
|
||||
if self.reconcile:
|
||||
action['context']['search_default_%s' % self.reconcile] = True
|
||||
return action
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 2016 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="account_move_line_filter_wizard_form" model="ir.ui.view">
|
||||
<field name="name">account_move_line_filter_wizard_form</field>
|
||||
<field name="model">account.move.line.filter.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Account Move Lines">
|
||||
<group name="filters" string="Filters">
|
||||
<field name="partner_id"/>
|
||||
<field name="account_id"/>
|
||||
<field name="account_reconcile" invisible="1"/>
|
||||
<field name="reconcile"
|
||||
attrs="{'invisible': [('account_reconcile', '!=', True)]}"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button type="object" name="go" string="Go" class="oe_highlight"/>
|
||||
<button special="cancel" string="Cancel" class="oe_link"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account_move_line_filter_wizard_action" model="ir.actions.act_window">
|
||||
<field name="name">Journal Items of Account</field>
|
||||
<field name="res_model">account.move.line.filter.wizard</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="account_move_line_filter_wizard_menu"
|
||||
action="account_move_line_filter_wizard_action"
|
||||
parent="account.menu_finance_entries"
|
||||
sequence="-1"/>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
3
account_move_line_start_end_dates_xls/__init__.py
Normal file
3
account_move_line_start_end_dates_xls/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_move_line
|
||||
44
account_move_line_start_end_dates_xls/__openerp__.py
Normal file
44
account_move_line_start_end_dates_xls/__openerp__.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Move Line Start End Dates XLS module for Odoo
|
||||
# Copyright (C) 2014-2016 Akretion (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Move Line Start End Dates XLS',
|
||||
'version': '0.1',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Adds start and end dates in the XLS export of the move lines',
|
||||
'description': """
|
||||
Account Move Line Start End Dates XLS
|
||||
=====================================
|
||||
|
||||
This module adds *Start Date* and *End Date* in the XLS export of the account move lines.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion
|
||||
<alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com/',
|
||||
'depends': ['account_cutoff_prepaid', 'account_move_line_report_xls'],
|
||||
'data': [],
|
||||
'installable': False,
|
||||
}
|
||||
73
account_move_line_start_end_dates_xls/account_move_line.py
Normal file
73
account_move_line_start_end_dates_xls/account_move_line.py
Normal file
@@ -0,0 +1,73 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Move Line Start End Dates XLS module for Odoo
|
||||
# Copyright (C) 2014-2016 Akretion (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import xlwt
|
||||
import logging
|
||||
from openerp import models, api
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
try:
|
||||
from openerp.addons.report_xls.utils import _render
|
||||
from openerp.addons.report_xls.report_xls import report_xls
|
||||
except (ImportError, IOError) as err:
|
||||
_logger.debug(err)
|
||||
|
||||
|
||||
class AccountMoveLine(models.Model):
|
||||
_inherit = 'account.move.line'
|
||||
|
||||
@api.model
|
||||
def _report_xls_fields(self):
|
||||
res = super(AccountMoveLine, self)._report_xls_fields()
|
||||
return res + ['start_date', 'end_date']
|
||||
|
||||
@api.model
|
||||
def _report_xls_template(self):
|
||||
res = super(AccountMoveLine, self)._report_xls_template()
|
||||
bc = '22'
|
||||
aml_cell_style_date = xlwt.easyxf(
|
||||
'borders: left thin, right thin, top thin, bottom thin, '
|
||||
'left_colour %s, right_colour %s, top_colour %s, '
|
||||
'bottom_colour %s; align: horz left;'
|
||||
% (bc, bc, bc, bc), num_format_str=report_xls.date_format)
|
||||
res.update({
|
||||
'start_date': {
|
||||
'header': [1, 13, 'text', _render("_('Start Date')")],
|
||||
'lines': [1, 0, _render(
|
||||
"line.start_date and line.start_date != 'False' and "
|
||||
"'date' or 'text'"), _render(
|
||||
"line.start_date and line.start_date != 'False' and "
|
||||
"datetime.strptime(line.start_date, '%Y-%m-%d') or None"),
|
||||
None, aml_cell_style_date],
|
||||
'totals': [1, 0, 'text', None]},
|
||||
'end_date': {
|
||||
'header': [1, 13, 'text', _render("_('End Date')")],
|
||||
'lines': [1, 0, _render(
|
||||
"line.end_date and line.end_date != 'False' and "
|
||||
"'date' or 'text'"), _render(
|
||||
"line.end_date and line.end_date != 'False' and "
|
||||
"datetime.strptime(line.end_date, '%Y-%m-%d') or None"),
|
||||
None, aml_cell_style_date],
|
||||
'totals': [1, 0, 'text', None]},
|
||||
})
|
||||
return res
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
24
account_payment_force_maturity_date/__init__.py
Normal file
24
account_payment_force_maturity_date/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Payment Force Maturity Date module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
from . import payment_line
|
||||
41
account_payment_force_maturity_date/__openerp__.py
Normal file
41
account_payment_force_maturity_date/__openerp__.py
Normal file
@@ -0,0 +1,41 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Payment Force Maturity Date module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{
|
||||
'name': 'Account Payment Force Maturity Date',
|
||||
'version': '1.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Add a Force Maturity Date field on payment lines',
|
||||
'description': """
|
||||
Account Payment Force Maturity Date
|
||||
===================================
|
||||
|
||||
This module adds a field *Force Maturity Date* on payment lines. If this field is set, the maturity date of the payment line will take the value of this field instead of taking the value of the maturity date of the related account move line.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'depends': ['account_payment'],
|
||||
'data': ['payment_view.xml'],
|
||||
'installable': False,
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_payment_force_maturity_date
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 8.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2015-05-06 15:02+0000\n"
|
||||
"PO-Revision-Date: 2015-05-06 15:02+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: account_payment_force_maturity_date
|
||||
#: field:payment.line,force_maturity_date:0
|
||||
msgid "Force Due Date"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_payment_force_maturity_date
|
||||
#: model:ir.model,name:account_payment_force_maturity_date.model_payment_line
|
||||
msgid "Payment Line"
|
||||
msgstr ""
|
||||
|
||||
27
account_payment_force_maturity_date/i18n/fr.po
Normal file
27
account_payment_force_maturity_date/i18n/fr.po
Normal file
@@ -0,0 +1,27 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_payment_force_maturity_date
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 8.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2015-05-06 15:03+0000\n"
|
||||
"PO-Revision-Date: 2015-05-06 15:03+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: account_payment_force_maturity_date
|
||||
#: field:payment.line,force_maturity_date:0
|
||||
msgid "Force Due Date"
|
||||
msgstr "Force la date d'échéance"
|
||||
|
||||
#. module: account_payment_force_maturity_date
|
||||
#: model:ir.model,name:account_payment_force_maturity_date.model_payment_line
|
||||
msgid "Payment Line"
|
||||
msgstr "Ligne de paiement"
|
||||
|
||||
42
account_payment_force_maturity_date/payment_line.py
Normal file
42
account_payment_force_maturity_date/payment_line.py
Normal file
@@ -0,0 +1,42 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Payment Force Maturity Date module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
from openerp import models, fields, api
|
||||
|
||||
|
||||
class PaymentLine(models.Model):
|
||||
_inherit = 'payment.line'
|
||||
|
||||
@api.one
|
||||
@api.depends(
|
||||
'move_line_id', 'move_line_id.date_maturity', 'force_maturity_date')
|
||||
def _compute_ml_maturity_date(self):
|
||||
ml_maturity_date = False
|
||||
if self.force_maturity_date:
|
||||
ml_maturity_date = self.force_maturity_date
|
||||
elif self.move_line_id:
|
||||
ml_maturity_date = self.move_line_id.date_maturity
|
||||
self.ml_maturity_date = ml_maturity_date
|
||||
|
||||
ml_maturity_date = fields.Date(compute='_compute_ml_maturity_date')
|
||||
force_maturity_date = fields.Date(string='Force Due Date')
|
||||
23
account_payment_force_maturity_date/payment_view.xml
Normal file
23
account_payment_force_maturity_date/payment_view.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2015 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_payment_order_form" model="ir.ui.view">
|
||||
<field name="name">hide.communication2.on.payment.line.form</field>
|
||||
<field name="model">payment.order</field>
|
||||
<field name="inherit_id" ref="account_payment.view_payment_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='line_ids']/form//field[@name='ml_inv_ref']" position="after">
|
||||
<field name="force_maturity_date"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
21
account_payment_hide_communication2/__init__.py
Normal file
21
account_payment_hide_communication2/__init__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Payment Hide Communication2 module for OpenERP
|
||||
# Copyright (C) 2014 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
44
account_payment_hide_communication2/__openerp__.py
Normal file
44
account_payment_hide_communication2/__openerp__.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Payment Hide Communication2 module for OpenERP
|
||||
# Copyright (C) 2014 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{
|
||||
'name': 'Account Payment Hide Communication2',
|
||||
'version': '1.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Hide the field Communication2 on Payment Lines',
|
||||
'description': """
|
||||
Account Payment Hide Communication2
|
||||
===================================
|
||||
|
||||
This module hides the field 'Communication2' on the form view of Payment Lines. I consider that is field is useless and tend to confuse users.
|
||||
|
||||
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'depends': ['account_payment'],
|
||||
'data': [
|
||||
'payment_view.xml',
|
||||
],
|
||||
'active': False,
|
||||
'installable': False,
|
||||
}
|
||||
23
account_payment_hide_communication2/payment_view.xml
Normal file
23
account_payment_hide_communication2/payment_view.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2014 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="view_payment_order_form" model="ir.ui.view">
|
||||
<field name="name">hide.communication2.on.payment.line.form</field>
|
||||
<field name="model">payment.order</field>
|
||||
<field name="inherit_id" ref="account_payment.view_payment_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='line_ids']/form//field[@name='communication2']" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
21
account_payment_security/__init__.py
Normal file
21
account_payment_security/__init__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Payment Security module for OpenERP
|
||||
# Copyright (C) 2014 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
46
account_payment_security/__openerp__.py
Normal file
46
account_payment_security/__openerp__.py
Normal file
@@ -0,0 +1,46 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Payment Security module for OpenERP
|
||||
# Copyright (C) 2014 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{
|
||||
'name': 'Account Payment Security',
|
||||
'version': '1.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Only members of Account Payment can create/write on bank accounts',
|
||||
'description': """
|
||||
Account Payment Security
|
||||
========================
|
||||
|
||||
By default in OpenERP, members of the group *Contact Creation* can create and modify bank accounts ; this can be a risk, as explained in this mail : https://lists.launchpad.net/openerp-community/msg01035.html
|
||||
|
||||
With this module, only the members of the group *Accounting / Payments* can create and modify bank accounts. Also, some rights on the configuration of bank accounts (res.partner.bank.type and res.partner.bank.type.field) are moved from the group *Contact Creation* to *Financial Manager*.
|
||||
|
||||
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'depends': ['account_payment'],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
],
|
||||
'active': False,
|
||||
'installable': False,
|
||||
}
|
||||
5
account_payment_security/security/ir.model.access.csv
Normal file
5
account_payment_security/security/ir.model.access.csv
Normal file
@@ -0,0 +1,5 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
base.access_res_partner_bank_group_partner_manager,Full access on res.partner.bank to Account Payment,base.model_res_partner_bank,account_payment.group_account_payment,1,1,1,1
|
||||
base.access_res_bank_group_partner_manager,Full access on res.bank to Account Payment,base.model_res_bank,account_payment.group_account_payment,1,1,1,1
|
||||
base.access_res_partner_bank_type_group_partner_manager,Full access on res.partner.bank.type to Financial Manager,base.model_res_partner_bank_type,account.group_account_manager,1,1,1,1
|
||||
base.access_res_partner_bank_type_field_group_partner_manager,Full access on res.partner.bank.type.field to Financial Manager,base.model_res_partner_bank_type_field,account.group_account_manager,1,1,1,1
|
||||
|
@@ -1,97 +0,0 @@
|
||||
=================
|
||||
Account Usability
|
||||
=================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
:alt: Beta
|
||||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
|
||||
:target: https://github.com/akretion/odoo-usability/tree/12.0/account_usability
|
||||
:alt: akretion/odoo-usability
|
||||
|
||||
|badge1| |badge2| |badge3|
|
||||
|
||||
This modules adds the following functions:
|
||||
|
||||
* Add an *Overdue* filter on invoice search view (this feature was previously
|
||||
located in te module *account_invoice_overdue_filter*)
|
||||
* Increase the default limit of 80 lines in account move and account move line view.
|
||||
* disable reconciliation "guessing"
|
||||
* fast search on *Reconcile Ref* for account move line.
|
||||
* add sale dates to invoice report to be compliant with
|
||||
https://www.service-public.fr/professionnels-entreprises/vosdroits/F31808
|
||||
* Sale date on qweb invoices
|
||||
* A wizard to mark several invoices as sent at once (forward from v8)
|
||||
* Default date for Account Move Reversal is now D+1 instead of today
|
||||
* Track more fields on invoice (see details in account.py)
|
||||
* Add boolean fields `has_discount` and `has_attachment` on invoice
|
||||
* Add button "Delete line qty = 0" on supplier invoice
|
||||
* Cut name_get() of invoice if too long
|
||||
* A script for if Odoo screws up invoice attachment filename
|
||||
* help functions for py3o reports
|
||||
* Show code on name_get of journal
|
||||
* add direct search of journal using code
|
||||
* add copy=False on some fields
|
||||
* Add unicity constraint on analytic codes per company
|
||||
* Better default values on account move
|
||||
* Add link from account move line to invoice
|
||||
* Add start_date and end_date on bank statements
|
||||
* Add transfer_account_id to invoicing config page
|
||||
* Improve domain reconciliation widget
|
||||
* account.reconcile.model don't copy name to label via onchange
|
||||
* Add method to get fiscal position without partner_id
|
||||
* Restore drill-through on sale and invoice reports
|
||||
* don't attach PDF upon invoice report generation on supplier invoices/refunds
|
||||
* Add filter on debit and credit amount for Move Lines
|
||||
* Add supplier invoice number in invoice tree view
|
||||
* Add date in outstanding payment widget on invoice form view (requires `odoo PR 84180 <https://github.com/odoo/odoo/pull/84180>`_)
|
||||
|
||||
Together with this module, I recommend the use of the following modules:
|
||||
|
||||
* account_invoice_supplier_ref_unique (OCA project account-invoicing)
|
||||
* account_move_line_no_default_search (OCA project account-financial-tools)
|
||||
* invoice_fiscal_position_update (OCA project account-invoicing)
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20account_usability%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* Akretion
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* David Beal <david.beal@akretion.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/account_usability>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute.
|
||||
@@ -1,2 +1,3 @@
|
||||
from . import models
|
||||
from . import wizard
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
from . import account
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
# Copyright 2015-2020 Akretion (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': 'Account Usability',
|
||||
'version': '14.0.1.0.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Small usability enhancements in account module',
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': [
|
||||
'account',
|
||||
'base_view_inheritance_extension',
|
||||
'base_usability', # needed only to access base_usability.group_nobody
|
||||
# in v12, I may create a module only for group_nobody
|
||||
],
|
||||
'data': [
|
||||
'views/account_account_type.xml',
|
||||
'views/account_account.xml',
|
||||
'views/account_group.xml',
|
||||
'views/account_analytic_account.xml',
|
||||
'views/account_analytic_group.xml',
|
||||
'views/account_bank_statement.xml',
|
||||
'views/account_invoice_report.xml',
|
||||
'views/account_journal.xml',
|
||||
'views/account_move.xml',
|
||||
'views/account_menu.xml',
|
||||
'views/account_tax.xml',
|
||||
'views/product.xml',
|
||||
'views/res_config_settings.xml',
|
||||
'views/res_partner.xml',
|
||||
'views/res_company.xml',
|
||||
'views/account_report.xml',
|
||||
'wizard/account_invoice_mark_sent_view.xml',
|
||||
'wizard/account_group_generate_view.xml',
|
||||
'wizard/account_payment_register_views.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'report/invoice_report.xml',
|
||||
],
|
||||
'qweb': ['static/src/xml/account_payment.xml'],
|
||||
'installable': True,
|
||||
}
|
||||
54
account_usability/__openerp__.py
Normal file
54
account_usability/__openerp__.py
Normal file
@@ -0,0 +1,54 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Usability module for Odoo
|
||||
# Copyright (C) 2015 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Usability',
|
||||
'version': '0.3',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Small usability enhancements in account module',
|
||||
'description': """
|
||||
Account Usability
|
||||
=================
|
||||
|
||||
The usability enhancements include:
|
||||
* show the supplier invoice number in the tree view of supplier invoices
|
||||
* add an *Overdue* filter on invoice search view (this feature was previously located in te module *account_invoice_overdue_filter*)
|
||||
* Increase the default limit of 80 lines in account move and account move line view.
|
||||
* Fast search on *Reconcile Ref* for account move line.
|
||||
* disable reconciliation "guessing"
|
||||
|
||||
Together with this module, I recommend the use of the following modules:
|
||||
* account_invoice_supplier_ref_unique (OCA project account-invoicing)
|
||||
* account_move_line_no_default_search (OCA project account-financial-tools)
|
||||
* invoice_fiscal_position_update (OCA project account-invoicing)
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account'],
|
||||
'conflicts': ['account_invoice_overdue_filter'],
|
||||
'data': ['account_view.xml'],
|
||||
'installable': False,
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user