Compare commits
693 Commits
14.0-copie
...
10.0-accou
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
08cb6f2e86 | ||
|
|
d01820cd39 | ||
|
|
71ecc03001 | ||
|
|
913be476dd | ||
|
|
de9871fd17 | ||
|
|
90a2e26e79 | ||
|
|
21f3b14d7a | ||
|
|
a7a8271a38 | ||
|
|
4cfd326398 | ||
|
|
295bb4edb5 | ||
|
|
8c73a84c46 | ||
|
|
8f555c88ce | ||
|
|
b5af2e54b0 | ||
|
|
b298039af4 | ||
|
|
8fbac5c221 | ||
|
|
96680c893f | ||
|
|
cc3b9d73ae | ||
|
|
8416216a77 | ||
|
|
1a9126d9a1 | ||
|
|
4e8c6f47f6 | ||
|
|
1cabf721f4 | ||
|
|
929f79cd98 | ||
|
|
0fabc8c4c1 | ||
|
|
c25747b474 | ||
|
|
6fa8464ab7 | ||
|
|
c02f539f8f | ||
|
|
27f96b8af2 | ||
|
|
8b3205cc35 | ||
|
|
7908943645 | ||
|
|
ffd6a409cc | ||
|
|
6446e087be | ||
|
|
a4a9be78bc | ||
|
|
567e7f1f6e | ||
|
|
a29384b817 | ||
|
|
23bd22a009 | ||
|
|
020ca72188 | ||
|
|
2d9b133cf6 | ||
|
|
4e9ca8fc5c | ||
|
|
3fdc3b4256 | ||
|
|
4d7102d699 | ||
|
|
bfb0f5380a | ||
|
|
e02727e6ee | ||
|
|
7cb35a031d | ||
|
|
4f10be1bfe | ||
|
|
d547fd6916 | ||
|
|
357ad8d707 | ||
|
|
03bbe001ae | ||
|
|
b199228e1d | ||
|
|
7f0ea7fd0c | ||
|
|
0c94dde977 | ||
|
|
da92731607 | ||
|
|
2950f86219 | ||
|
|
744c0f487a | ||
|
|
d9fe676cae | ||
|
|
65d0d61c13 | ||
|
|
d61e48635b | ||
|
|
a7b2bde9e9 | ||
|
|
74966a7f15 | ||
|
|
3f47f7bf9f | ||
|
|
4d833d1c97 | ||
|
|
a577c4bbbd | ||
|
|
a2ea2534f0 | ||
|
|
1cae9ca021 | ||
|
|
953929cc4b | ||
|
|
068d57030a | ||
|
|
054bee90c0 | ||
|
|
782f1fdb92 | ||
|
|
72f7235c18 | ||
|
|
0a5c14b7f9 | ||
|
|
a4c382a546 | ||
|
|
5c9b6dd702 | ||
|
|
da6ba9b75e | ||
|
|
1ed7034ee4 | ||
|
|
9a8d9616b7 | ||
|
|
b9014e937d | ||
|
|
fc2dcbc359 | ||
|
|
b95837fa86 | ||
|
|
22a0d2b41b | ||
|
|
f9e554a312 | ||
|
|
559c301f2c | ||
|
|
295bf50cea | ||
|
|
8ed8c2bc70 | ||
|
|
b8a015a01e | ||
|
|
3024889c41 | ||
|
|
8a538c4e74 | ||
|
|
03ebc09eb0 | ||
|
|
81a4328531 | ||
|
|
1faecd98f7 | ||
|
|
0f4193e7c4 | ||
|
|
ecd05222a9 | ||
|
|
690a9196dd | ||
|
|
ab03ebe2cb | ||
|
|
074f4e517a | ||
|
|
26b27c398d | ||
|
|
e7afaa2c78 | ||
|
|
72116a7374 | ||
|
|
5d1df0b654 | ||
|
|
522d3d5aa0 | ||
|
|
bfd0c6f8cd | ||
|
|
a05263be77 | ||
|
|
f9951890b5 | ||
|
|
06a1d182e5 | ||
|
|
c4256b3005 | ||
|
|
c5776557cc | ||
|
|
361eb380e4 | ||
|
|
1034cc2347 | ||
|
|
f74dc15d4b | ||
|
|
c52412295f | ||
|
|
0d8e3a9066 | ||
|
|
238344b964 | ||
|
|
6ff67694ab | ||
|
|
662c37670c | ||
|
|
2b0c64b69e | ||
|
|
b40e4eca05 | ||
|
|
cc5291ba52 | ||
|
|
2f63e4e7a6 | ||
|
|
9ec29082b8 | ||
|
|
a11f9574ee | ||
|
|
ac05ca27a4 | ||
|
|
746d23fb3a | ||
|
|
aba8e33d48 | ||
|
|
d384b626e5 | ||
|
|
fcecfcc4e1 | ||
|
|
e6076c3f76 | ||
|
|
987e753a54 | ||
|
|
080e3decbc | ||
|
|
7d7424ad8a | ||
|
|
a32d091d83 | ||
|
|
bb849c0228 | ||
|
|
338d0d445d | ||
|
|
f0adce0034 | ||
|
|
2ebdc8e329 | ||
|
|
748614ba34 | ||
|
|
d0cdc96fbf | ||
|
|
61d576451e | ||
|
|
d56acb4a86 | ||
|
|
f3ad97de73 | ||
|
|
03cec78dc7 | ||
|
|
d4a936deaa | ||
|
|
9cfdaa88a3 | ||
|
|
e0732689b8 | ||
|
|
55d977914e | ||
|
|
0da06febfc | ||
|
|
a9d8137d1f | ||
|
|
19d2614feb | ||
|
|
dd05dfab28 | ||
|
|
a6e9568454 | ||
|
|
5a39df7423 | ||
|
|
2f9584e04e | ||
|
|
a3245985e5 | ||
|
|
19909b6761 | ||
|
|
aca7911d81 | ||
|
|
1d765aa4f7 | ||
|
|
16094358c7 | ||
|
|
2469c1f79d | ||
|
|
94926d188a | ||
|
|
e5221d6a96 | ||
|
|
d55b01ca7b | ||
|
|
5fda678474 | ||
|
|
390363d7e1 | ||
|
|
15a12feafd | ||
|
|
479e1a2710 | ||
|
|
735495656c | ||
|
|
b8255a5287 | ||
|
|
08445ad370 | ||
|
|
9267fca881 | ||
|
|
b8b307154a | ||
|
|
8b06320204 | ||
|
|
181ffab457 | ||
|
|
4d2f7a47ff | ||
|
|
216369f66c | ||
|
|
348e0205a0 | ||
|
|
ffda316d34 | ||
|
|
37281620af | ||
|
|
933bf336aa | ||
|
|
09b94dd01d | ||
|
|
0af5c20727 | ||
|
|
e3b305f117 | ||
|
|
1a191c9444 | ||
|
|
e30285caf7 | ||
|
|
fe7fec797f | ||
|
|
5304bde100 | ||
|
|
db7ea5681f | ||
|
|
0b12805495 | ||
|
|
f91b5267fe | ||
|
|
3396814a09 | ||
|
|
83c4e095f6 | ||
|
|
84bf228d92 | ||
|
|
7f8c461122 | ||
|
|
80b3d08ba5 | ||
|
|
7750ed1834 | ||
|
|
3b6973c4a2 | ||
|
|
b518594136 | ||
|
|
e353cdcad1 | ||
|
|
ea20effa7e | ||
|
|
c9bfc8bef2 | ||
|
|
6361e2e453 | ||
|
|
217afc8af0 | ||
|
|
2d74753bea | ||
|
|
d507311091 | ||
|
|
84c1caaf16 | ||
|
|
895a92393c | ||
|
|
fcba3e4129 | ||
|
|
a22148329f | ||
|
|
b2a96f4db2 | ||
|
|
a325a3a828 | ||
|
|
1c1855ec11 | ||
|
|
5bcfe45251 | ||
|
|
ddbdecd64e | ||
|
|
9e44400acd | ||
|
|
67e3c9a199 | ||
|
|
da5d35b8cb | ||
|
|
9fdbebc591 | ||
|
|
7f3d465a24 | ||
|
|
ad7a8d5e40 | ||
|
|
9617aedcb3 | ||
|
|
d8f0d061b7 | ||
|
|
5d7f512335 | ||
|
|
a7dc7a51ce | ||
|
|
da7ac67933 | ||
|
|
4d9659dee3 | ||
|
|
1f5887eb87 | ||
|
|
84ee109bdf | ||
|
|
80c90c7d35 | ||
|
|
bf4d613ed2 | ||
|
|
889fb28fd6 | ||
|
|
265210b4f1 | ||
|
|
ec6975ce6a | ||
|
|
b0f6832541 | ||
|
|
49f928199e | ||
|
|
94fd30c4b3 | ||
|
|
e51d19941b | ||
|
|
3284953528 | ||
|
|
52350ba5a7 | ||
|
|
95fb0d6f43 | ||
|
|
e7191d3ee1 | ||
|
|
8fc54fd37a | ||
|
|
85f505bd2d | ||
|
|
777fc14908 | ||
|
|
115c0b36de | ||
|
|
256c603796 | ||
|
|
985a894866 | ||
|
|
23cadc403c | ||
|
|
23139916b2 | ||
|
|
42b3505966 | ||
|
|
a9139b9430 | ||
|
|
3eab0c9d7a | ||
|
|
07f646dca3 | ||
|
|
4350679c22 | ||
|
|
5fb19a4a5e | ||
|
|
346de9be4b | ||
|
|
e4dc38b963 | ||
|
|
67e6860ec1 | ||
|
|
bdeb1a4101 | ||
|
|
e1f8e95bce | ||
|
|
f16095e343 | ||
|
|
c92ce72fd9 | ||
|
|
f90aa12a9f | ||
|
|
35163d8613 | ||
|
|
4e4d02aa14 | ||
|
|
9e3d62b4ba | ||
|
|
0bc2d19747 | ||
|
|
ed1937d501 | ||
|
|
acfd2f18a7 | ||
|
|
83140872ef | ||
|
|
6abb743736 | ||
|
|
5549139e5c | ||
|
|
e878021e63 | ||
|
|
6d7dc61dee | ||
|
|
cebc0e3b84 | ||
|
|
ef85216271 | ||
|
|
7c5ac7144c | ||
|
|
a35f1a3a32 | ||
|
|
022d7a719d | ||
|
|
e505ce2ad4 | ||
|
|
8bcbb83a91 | ||
|
|
07781aa724 | ||
|
|
42233bc0ce | ||
|
|
10eacdf226 | ||
|
|
1a46f39705 | ||
|
|
9e37c6e1ae | ||
|
|
96a7e6e443 | ||
|
|
c2f4e2066a | ||
|
|
b861521571 | ||
|
|
245c605ef5 | ||
|
|
aa278b3a0c | ||
|
|
a1ef881201 | ||
|
|
56095375d1 | ||
|
|
746a6926ea | ||
|
|
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 |
@@ -1,14 +0,0 @@
|
|||||||
# Do NOT update manually; changes here will be overwritten by Copier
|
|
||||||
_commit: v1.3.6
|
|
||||||
_src_path: https://github.com/OCA/oca-addons-repo-template.git
|
|
||||||
ci: Travis
|
|
||||||
dependency_installation_mode: OCA
|
|
||||||
generate_requirements_txt: true
|
|
||||||
include_wkhtmltopdf: false
|
|
||||||
odoo_version: 14.0
|
|
||||||
rebel_module_groups: []
|
|
||||||
repo_description: Modules that improve UX sensibly
|
|
||||||
repo_name: Odoo Usability modules
|
|
||||||
repo_slug: odoo-usability
|
|
||||||
travis_apt_packages: []
|
|
||||||
travis_apt_sources: []
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
# Configuration for known file extensions
|
|
||||||
[*.{css,js,json,less,md,py,rst,sass,scss,xml,yaml,yml}]
|
|
||||||
charset = utf-8
|
|
||||||
end_of_line = lf
|
|
||||||
indent_size = 4
|
|
||||||
indent_style = space
|
|
||||||
insert_final_newline = true
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
|
|
||||||
[*.{json,yml,yaml,rst,md}]
|
|
||||||
indent_size = 2
|
|
||||||
|
|
||||||
# Do not configure editor for libs and autogenerated content
|
|
||||||
[{*/static/{lib,src/lib}/**,*/static/description/index.html,*/readme/../README.rst}]
|
|
||||||
charset = unset
|
|
||||||
end_of_line = unset
|
|
||||||
indent_size = unset
|
|
||||||
indent_style = unset
|
|
||||||
insert_final_newline = false
|
|
||||||
trim_trailing_whitespace = false
|
|
||||||
187
.eslintrc.yml
187
.eslintrc.yml
@@ -1,187 +0,0 @@
|
|||||||
env:
|
|
||||||
browser: true
|
|
||||||
es6: true
|
|
||||||
|
|
||||||
# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
|
|
||||||
parserOptions:
|
|
||||||
ecmaVersion: 2017
|
|
||||||
|
|
||||||
overrides:
|
|
||||||
- files:
|
|
||||||
- "**/*.esm.js"
|
|
||||||
parserOptions:
|
|
||||||
sourceType: module
|
|
||||||
|
|
||||||
# Globals available in Odoo that shouldn't produce errorings
|
|
||||||
globals:
|
|
||||||
_: readonly
|
|
||||||
$: readonly
|
|
||||||
fuzzy: readonly
|
|
||||||
jQuery: readonly
|
|
||||||
moment: readonly
|
|
||||||
odoo: readonly
|
|
||||||
openerp: readonly
|
|
||||||
owl: readonly
|
|
||||||
|
|
||||||
# Styling is handled by Prettier, so we only need to enable AST rules;
|
|
||||||
# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890
|
|
||||||
rules:
|
|
||||||
accessor-pairs: warn
|
|
||||||
array-callback-return: warn
|
|
||||||
callback-return: warn
|
|
||||||
capitalized-comments:
|
|
||||||
- warn
|
|
||||||
- always
|
|
||||||
- ignoreConsecutiveComments: true
|
|
||||||
ignoreInlineComments: true
|
|
||||||
complexity:
|
|
||||||
- warn
|
|
||||||
- 15
|
|
||||||
constructor-super: warn
|
|
||||||
dot-notation: warn
|
|
||||||
eqeqeq: warn
|
|
||||||
global-require: warn
|
|
||||||
handle-callback-err: warn
|
|
||||||
id-blacklist: warn
|
|
||||||
id-match: warn
|
|
||||||
init-declarations: error
|
|
||||||
max-depth: warn
|
|
||||||
max-nested-callbacks: warn
|
|
||||||
max-statements-per-line: warn
|
|
||||||
no-alert: warn
|
|
||||||
no-array-constructor: warn
|
|
||||||
no-caller: warn
|
|
||||||
no-case-declarations: warn
|
|
||||||
no-class-assign: warn
|
|
||||||
no-cond-assign: error
|
|
||||||
no-const-assign: error
|
|
||||||
no-constant-condition: warn
|
|
||||||
no-control-regex: warn
|
|
||||||
no-debugger: error
|
|
||||||
no-delete-var: warn
|
|
||||||
no-div-regex: warn
|
|
||||||
no-dupe-args: error
|
|
||||||
no-dupe-class-members: error
|
|
||||||
no-dupe-keys: error
|
|
||||||
no-duplicate-case: error
|
|
||||||
no-duplicate-imports: error
|
|
||||||
no-else-return: warn
|
|
||||||
no-empty-character-class: warn
|
|
||||||
no-empty-function: error
|
|
||||||
no-empty-pattern: error
|
|
||||||
no-empty: warn
|
|
||||||
no-eq-null: error
|
|
||||||
no-eval: error
|
|
||||||
no-ex-assign: error
|
|
||||||
no-extend-native: warn
|
|
||||||
no-extra-bind: warn
|
|
||||||
no-extra-boolean-cast: warn
|
|
||||||
no-extra-label: warn
|
|
||||||
no-fallthrough: warn
|
|
||||||
no-func-assign: error
|
|
||||||
no-global-assign: error
|
|
||||||
no-implicit-coercion:
|
|
||||||
- warn
|
|
||||||
- allow: ["~"]
|
|
||||||
no-implicit-globals: warn
|
|
||||||
no-implied-eval: warn
|
|
||||||
no-inline-comments: warn
|
|
||||||
no-inner-declarations: warn
|
|
||||||
no-invalid-regexp: warn
|
|
||||||
no-irregular-whitespace: warn
|
|
||||||
no-iterator: warn
|
|
||||||
no-label-var: warn
|
|
||||||
no-labels: warn
|
|
||||||
no-lone-blocks: warn
|
|
||||||
no-lonely-if: error
|
|
||||||
no-mixed-requires: error
|
|
||||||
no-multi-str: warn
|
|
||||||
no-native-reassign: error
|
|
||||||
no-negated-condition: warn
|
|
||||||
no-negated-in-lhs: error
|
|
||||||
no-new-func: warn
|
|
||||||
no-new-object: warn
|
|
||||||
no-new-require: warn
|
|
||||||
no-new-symbol: warn
|
|
||||||
no-new-wrappers: warn
|
|
||||||
no-new: warn
|
|
||||||
no-obj-calls: warn
|
|
||||||
no-octal-escape: warn
|
|
||||||
no-octal: warn
|
|
||||||
no-param-reassign: warn
|
|
||||||
no-path-concat: warn
|
|
||||||
no-process-env: warn
|
|
||||||
no-process-exit: warn
|
|
||||||
no-proto: warn
|
|
||||||
no-prototype-builtins: warn
|
|
||||||
no-redeclare: warn
|
|
||||||
no-regex-spaces: warn
|
|
||||||
no-restricted-globals: warn
|
|
||||||
no-restricted-imports: warn
|
|
||||||
no-restricted-modules: warn
|
|
||||||
no-restricted-syntax: warn
|
|
||||||
no-return-assign: error
|
|
||||||
no-script-url: warn
|
|
||||||
no-self-assign: warn
|
|
||||||
no-self-compare: warn
|
|
||||||
no-sequences: warn
|
|
||||||
no-shadow-restricted-names: warn
|
|
||||||
no-shadow: warn
|
|
||||||
no-sparse-arrays: warn
|
|
||||||
no-sync: warn
|
|
||||||
no-this-before-super: warn
|
|
||||||
no-throw-literal: warn
|
|
||||||
no-undef-init: warn
|
|
||||||
no-undef: error
|
|
||||||
no-unmodified-loop-condition: warn
|
|
||||||
no-unneeded-ternary: error
|
|
||||||
no-unreachable: error
|
|
||||||
no-unsafe-finally: error
|
|
||||||
no-unused-expressions: error
|
|
||||||
no-unused-labels: error
|
|
||||||
no-unused-vars: error
|
|
||||||
no-use-before-define: error
|
|
||||||
no-useless-call: warn
|
|
||||||
no-useless-computed-key: warn
|
|
||||||
no-useless-concat: warn
|
|
||||||
no-useless-constructor: warn
|
|
||||||
no-useless-escape: warn
|
|
||||||
no-useless-rename: warn
|
|
||||||
no-void: warn
|
|
||||||
no-with: warn
|
|
||||||
operator-assignment: [error, always]
|
|
||||||
prefer-const: warn
|
|
||||||
radix: warn
|
|
||||||
require-yield: warn
|
|
||||||
sort-imports: warn
|
|
||||||
spaced-comment: [error, always]
|
|
||||||
strict: [error, function]
|
|
||||||
use-isnan: error
|
|
||||||
valid-jsdoc:
|
|
||||||
- warn
|
|
||||||
- prefer:
|
|
||||||
arg: param
|
|
||||||
argument: param
|
|
||||||
augments: extends
|
|
||||||
constructor: class
|
|
||||||
exception: throws
|
|
||||||
func: function
|
|
||||||
method: function
|
|
||||||
prop: property
|
|
||||||
return: returns
|
|
||||||
virtual: abstract
|
|
||||||
yield: yields
|
|
||||||
preferType:
|
|
||||||
array: Array
|
|
||||||
bool: Boolean
|
|
||||||
boolean: Boolean
|
|
||||||
number: Number
|
|
||||||
object: Object
|
|
||||||
str: String
|
|
||||||
string: String
|
|
||||||
requireParamDescription: false
|
|
||||||
requireReturn: false
|
|
||||||
requireReturnDescription: false
|
|
||||||
requireReturnType: false
|
|
||||||
valid-typeof: warn
|
|
||||||
yoda: warn
|
|
||||||
12
.flake8
12
.flake8
@@ -1,12 +0,0 @@
|
|||||||
[flake8]
|
|
||||||
max-line-length = 88
|
|
||||||
max-complexity = 16
|
|
||||||
# B = bugbear
|
|
||||||
# B9 = bugbear opinionated (incl line length)
|
|
||||||
select = C,E,F,W,B,B9
|
|
||||||
# E203: whitespace before ':' (black behaviour)
|
|
||||||
# E501: flake8 line length (covered by bugbear B950)
|
|
||||||
# W503: line break before binary operator (black behaviour)
|
|
||||||
ignore = E203,E501,W503
|
|
||||||
per-file-ignores=
|
|
||||||
__init__.py:F401
|
|
||||||
20
.github/workflows/pre-commit.yml
vendored
20
.github/workflows/pre-commit.yml
vendored
@@ -1,20 +0,0 @@
|
|||||||
name: pre-commit
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
pre-commit:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
# The pylint-odoo version we use here does not support python 3.10
|
|
||||||
# https://github.com/OCA/oca-addons-repo-template/issues/80
|
|
||||||
# We also need to pin to an older version of python for older odoo versions
|
|
||||||
# where we are not using black > 21. Older black versions won't work with
|
|
||||||
# Python 3.9.8+, and we can't bump black without reformatting.
|
|
||||||
python-version: "3.9.7"
|
|
||||||
- uses: pre-commit/action@v2.0.0
|
|
||||||
69
.github/workflows/stale.yml
vendored
69
.github/workflows/stale.yml
vendored
@@ -1,69 +0,0 @@
|
|||||||
name: Mark stale issues and pull requests
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "0 12 * * 0"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
stale:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Stale PRs and issues policy
|
|
||||||
uses: actions/stale@v4
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
# General settings.
|
|
||||||
ascending: true
|
|
||||||
remove-stale-when-updated: true
|
|
||||||
# Pull Requests settings.
|
|
||||||
# 120+30 day stale policy for PRs
|
|
||||||
# * Except PRs marked as "no stale"
|
|
||||||
days-before-pr-stale: 120
|
|
||||||
days-before-pr-close: 30
|
|
||||||
exempt-pr-labels: "no stale"
|
|
||||||
stale-pr-label: "stale"
|
|
||||||
stale-pr-message: >
|
|
||||||
There hasn't been any activity on this pull request in the past 4 months, so
|
|
||||||
it has been marked as stale and it will be closed automatically if no
|
|
||||||
further activity occurs in the next 30 days.
|
|
||||||
|
|
||||||
If you want this PR to never become stale, please ask a PSC member to apply
|
|
||||||
the "no stale" label.
|
|
||||||
# Issues settings.
|
|
||||||
# 180+30 day stale policy for open issues
|
|
||||||
# * Except Issues marked as "no stale"
|
|
||||||
days-before-issue-stale: 180
|
|
||||||
days-before-issue-close: 30
|
|
||||||
exempt-issue-labels: "no stale,needs more information"
|
|
||||||
stale-issue-label: "stale"
|
|
||||||
stale-issue-message: >
|
|
||||||
There hasn't been any activity on this issue in the past 6 months, so it has
|
|
||||||
been marked as stale and it will be closed automatically if no further
|
|
||||||
activity occurs in the next 30 days.
|
|
||||||
|
|
||||||
If you want this issue to never become stale, please ask a PSC member to
|
|
||||||
apply the "no stale" label.
|
|
||||||
|
|
||||||
# 15+30 day stale policy for issues pending more information
|
|
||||||
# * Issues that are pending more information
|
|
||||||
# * Except Issues marked as "no stale"
|
|
||||||
- name: Needs more information stale issues policy
|
|
||||||
uses: actions/stale@v4
|
|
||||||
with:
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
ascending: true
|
|
||||||
only-labels: "needs more information"
|
|
||||||
exempt-issue-labels: "no stale"
|
|
||||||
days-before-stale: 15
|
|
||||||
days-before-close: 30
|
|
||||||
days-before-pr-stale: -1
|
|
||||||
days-before-pr-close: -1
|
|
||||||
remove-stale-when-updated: true
|
|
||||||
stale-issue-label: "stale"
|
|
||||||
stale-issue-message: >
|
|
||||||
This issue needs more information and there hasn't been any activity
|
|
||||||
recently, so it has been marked as stale and it will be closed automatically
|
|
||||||
if no further activity occurs in the next 30 days.
|
|
||||||
|
|
||||||
If you think this is a mistake, please ask a PSC member to remove the "needs
|
|
||||||
more information" label.
|
|
||||||
19
.gitignore
vendored
19
.gitignore
vendored
@@ -1,8 +1,6 @@
|
|||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
/.venv
|
|
||||||
/.pytest_cache
|
|
||||||
|
|
||||||
# C extensions
|
# C extensions
|
||||||
*.so
|
*.so
|
||||||
@@ -23,7 +21,6 @@ var/
|
|||||||
*.egg-info/
|
*.egg-info/
|
||||||
.installed.cfg
|
.installed.cfg
|
||||||
*.egg
|
*.egg
|
||||||
*.eggs
|
|
||||||
|
|
||||||
# Installer logs
|
# Installer logs
|
||||||
pip-log.txt
|
pip-log.txt
|
||||||
@@ -43,19 +40,6 @@ coverage.xml
|
|||||||
# Pycharm
|
# Pycharm
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
# Eclipse
|
|
||||||
.settings
|
|
||||||
|
|
||||||
# Visual Studio cache/options directory
|
|
||||||
.vs/
|
|
||||||
.vscode
|
|
||||||
|
|
||||||
# OSX Files
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# Django stuff:
|
|
||||||
*.log
|
|
||||||
|
|
||||||
# Mr Developer
|
# Mr Developer
|
||||||
.mr.developer.cfg
|
.mr.developer.cfg
|
||||||
.project
|
.project
|
||||||
@@ -70,6 +54,3 @@ docs/_build/
|
|||||||
# Backup files
|
# Backup files
|
||||||
*~
|
*~
|
||||||
*.swp
|
*.swp
|
||||||
|
|
||||||
# OCA rules
|
|
||||||
!static/lib/
|
|
||||||
|
|||||||
13
.isort.cfg
13
.isort.cfg
@@ -1,13 +0,0 @@
|
|||||||
[settings]
|
|
||||||
; see https://github.com/psf/black
|
|
||||||
multi_line_output=3
|
|
||||||
include_trailing_comma=True
|
|
||||||
force_grid_wrap=0
|
|
||||||
combine_as_imports=True
|
|
||||||
use_parentheses=True
|
|
||||||
line_length=88
|
|
||||||
known_odoo=odoo
|
|
||||||
known_odoo_addons=odoo.addons
|
|
||||||
sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER
|
|
||||||
default_section=THIRDPARTY
|
|
||||||
ensure_newline_before_comments = True
|
|
||||||
@@ -1,160 +0,0 @@
|
|||||||
exclude: |
|
|
||||||
(?x)
|
|
||||||
# NOT INSTALLABLE ADDONS
|
|
||||||
^account_fiscal_position_payable_receivable/|
|
|
||||||
^account_invoice_margin/|
|
|
||||||
^account_invoice_update_wizard/|
|
|
||||||
^company_code/|
|
|
||||||
^developer_menu/|
|
|
||||||
^intrastat_product_type/|
|
|
||||||
^mass_mailing_usability/|
|
|
||||||
^mrp_average_cost/|
|
|
||||||
^mrp_no_product_template_menu/|
|
|
||||||
^mrp_product_tree_default/|
|
|
||||||
^sale_down_payment/|
|
|
||||||
^sale_margin_no_onchange/|
|
|
||||||
^sale_no_configurator_button/|
|
|
||||||
^sale_quotation_title/|
|
|
||||||
^service_line_qty_update_base/|
|
|
||||||
^service_line_qty_update_purchase/|
|
|
||||||
^service_line_qty_update_sale/|
|
|
||||||
^stock_no_product_template_menu/|
|
|
||||||
^stock_user_default_warehouse_base/|
|
|
||||||
^stock_user_default_warehouse_mrp/|
|
|
||||||
^stock_user_default_warehouse_purchase/|
|
|
||||||
^stock_user_default_warehouse_sale/|
|
|
||||||
^volume_precision/|
|
|
||||||
# END NOT INSTALLABLE ADDONS
|
|
||||||
# Files and folders generated by bots, to avoid loops
|
|
||||||
^setup/|/static/description/index\.html$|
|
|
||||||
# We don't want to mess with tool-generated files
|
|
||||||
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
|
|
||||||
# Maybe reactivate this when all README files include prettier ignore tags?
|
|
||||||
^README\.md$|
|
|
||||||
# Library files can have extraneous formatting (even minimized)
|
|
||||||
/static/(src/)?lib/|
|
|
||||||
# Repos using Sphinx to generate docs don't need prettying
|
|
||||||
^docs/_templates/.*\.html$|
|
|
||||||
# You don't usually want a bot to modify your legal texts
|
|
||||||
(LICENSE.*|COPYING.*)
|
|
||||||
default_language_version:
|
|
||||||
python: python3
|
|
||||||
node: "14.13.0"
|
|
||||||
repos:
|
|
||||||
- repo: local
|
|
||||||
hooks:
|
|
||||||
# These files are most likely copier diff rejection junks; if found,
|
|
||||||
# review them manually, fix the problem (if needed) and remove them
|
|
||||||
- id: forbidden-files
|
|
||||||
name: forbidden files
|
|
||||||
entry: found forbidden files; remove them
|
|
||||||
language: fail
|
|
||||||
files: "\\.rej$"
|
|
||||||
- repo: https://github.com/oca/maintainer-tools
|
|
||||||
rev: ab1d7f6
|
|
||||||
hooks:
|
|
||||||
# update the NOT INSTALLABLE ADDONS section above
|
|
||||||
- id: oca-update-pre-commit-excluded-addons
|
|
||||||
- id: oca-fix-manifest-website
|
|
||||||
args: ["https://github.com/OCA/odoo-usability"]
|
|
||||||
- repo: https://github.com/myint/autoflake
|
|
||||||
rev: v1.4
|
|
||||||
hooks:
|
|
||||||
- id: autoflake
|
|
||||||
args:
|
|
||||||
- --expand-star-imports
|
|
||||||
- --ignore-init-module-imports
|
|
||||||
- --in-place
|
|
||||||
- --remove-all-unused-imports
|
|
||||||
- --remove-duplicate-keys
|
|
||||||
- --remove-unused-variables
|
|
||||||
- repo: https://github.com/psf/black
|
|
||||||
rev: 20.8b1
|
|
||||||
hooks:
|
|
||||||
- id: black
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
|
||||||
rev: v2.1.2
|
|
||||||
hooks:
|
|
||||||
- id: prettier
|
|
||||||
name: prettier (with plugin-xml)
|
|
||||||
additional_dependencies:
|
|
||||||
- "prettier@2.1.2"
|
|
||||||
- "@prettier/plugin-xml@0.12.0"
|
|
||||||
args:
|
|
||||||
- --plugin=@prettier/plugin-xml
|
|
||||||
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-eslint
|
|
||||||
rev: v7.8.1
|
|
||||||
hooks:
|
|
||||||
- id: eslint
|
|
||||||
verbose: true
|
|
||||||
args:
|
|
||||||
- --color
|
|
||||||
- --fix
|
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
||||||
rev: v3.2.0
|
|
||||||
hooks:
|
|
||||||
- id: trailing-whitespace
|
|
||||||
# exclude autogenerated files
|
|
||||||
exclude: /README\.rst$|\.pot?$
|
|
||||||
- id: end-of-file-fixer
|
|
||||||
# exclude autogenerated files
|
|
||||||
exclude: /README\.rst$|\.pot?$
|
|
||||||
- id: debug-statements
|
|
||||||
- id: fix-encoding-pragma
|
|
||||||
args: ["--remove"]
|
|
||||||
- id: check-case-conflict
|
|
||||||
- id: check-docstring-first
|
|
||||||
- id: check-executables-have-shebangs
|
|
||||||
- id: check-merge-conflict
|
|
||||||
# exclude files where underlines are not distinguishable from merge conflicts
|
|
||||||
exclude: /README\.rst$|^docs/.*\.rst$
|
|
||||||
- id: check-symlinks
|
|
||||||
- id: check-xml
|
|
||||||
- id: mixed-line-ending
|
|
||||||
args: ["--fix=lf"]
|
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
|
||||||
rev: v2.7.2
|
|
||||||
hooks:
|
|
||||||
- id: pyupgrade
|
|
||||||
args: ["--keep-percent-format"]
|
|
||||||
- repo: https://github.com/PyCQA/isort
|
|
||||||
rev: 5.5.1
|
|
||||||
hooks:
|
|
||||||
- id: isort
|
|
||||||
name: isort except __init__.py
|
|
||||||
args:
|
|
||||||
- --settings=.
|
|
||||||
exclude: /__init__\.py$
|
|
||||||
- repo: https://github.com/acsone/setuptools-odoo
|
|
||||||
rev: 2.6.0
|
|
||||||
hooks:
|
|
||||||
- id: setuptools-odoo-make-default
|
|
||||||
- id: setuptools-odoo-get-requirements
|
|
||||||
args:
|
|
||||||
- --output
|
|
||||||
- requirements.txt
|
|
||||||
- --header
|
|
||||||
- "# generated from manifests external_dependencies"
|
|
||||||
- repo: https://gitlab.com/PyCQA/flake8
|
|
||||||
rev: 3.8.3
|
|
||||||
hooks:
|
|
||||||
- id: flake8
|
|
||||||
name: flake8
|
|
||||||
additional_dependencies: ["flake8-bugbear==20.1.4"]
|
|
||||||
- repo: https://github.com/PyCQA/pylint
|
|
||||||
rev: pylint-2.5.3
|
|
||||||
hooks:
|
|
||||||
- id: pylint
|
|
||||||
name: pylint with optional checks
|
|
||||||
args:
|
|
||||||
- --rcfile=.pylintrc
|
|
||||||
- --exit-zero
|
|
||||||
verbose: true
|
|
||||||
additional_dependencies: &pylint_deps
|
|
||||||
- pylint-odoo==3.5.0
|
|
||||||
- id: pylint
|
|
||||||
name: pylint with mandatory checks
|
|
||||||
args:
|
|
||||||
- --rcfile=.pylintrc-mandatory
|
|
||||||
additional_dependencies: *pylint_deps
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Defaults for all prettier-supported languages.
|
|
||||||
# Prettier will complete this with settings from .editorconfig file.
|
|
||||||
bracketSpacing: false
|
|
||||||
printWidth: 88
|
|
||||||
proseWrap: always
|
|
||||||
semi: true
|
|
||||||
trailingComma: "es5"
|
|
||||||
xmlWhitespaceSensitivity: "strict"
|
|
||||||
86
.pylintrc
86
.pylintrc
@@ -1,86 +0,0 @@
|
|||||||
[MASTER]
|
|
||||||
load-plugins=pylint_odoo
|
|
||||||
score=n
|
|
||||||
|
|
||||||
[ODOOLINT]
|
|
||||||
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
|
|
||||||
manifest_required_authors=Odoo Community Association (OCA)
|
|
||||||
manifest_required_keys=license
|
|
||||||
manifest_deprecated_keys=description,active
|
|
||||||
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
|
|
||||||
valid_odoo_versions=14.0
|
|
||||||
|
|
||||||
[MESSAGES CONTROL]
|
|
||||||
disable=all
|
|
||||||
|
|
||||||
# This .pylintrc contains optional AND mandatory checks and is meant to be
|
|
||||||
# loaded in an IDE to have it check everything, in the hope this will make
|
|
||||||
# optional checks more visible to contributors who otherwise never look at a
|
|
||||||
# green travis to see optional checks that failed.
|
|
||||||
# .pylintrc-mandatory containing only mandatory checks is used the pre-commit
|
|
||||||
# config as a blocking check.
|
|
||||||
|
|
||||||
enable=anomalous-backslash-in-string,
|
|
||||||
api-one-deprecated,
|
|
||||||
api-one-multi-together,
|
|
||||||
assignment-from-none,
|
|
||||||
attribute-deprecated,
|
|
||||||
class-camelcase,
|
|
||||||
dangerous-default-value,
|
|
||||||
dangerous-view-replace-wo-priority,
|
|
||||||
development-status-allowed,
|
|
||||||
duplicate-id-csv,
|
|
||||||
duplicate-key,
|
|
||||||
duplicate-xml-fields,
|
|
||||||
duplicate-xml-record-id,
|
|
||||||
eval-referenced,
|
|
||||||
eval-used,
|
|
||||||
incoherent-interpreter-exec-perm,
|
|
||||||
license-allowed,
|
|
||||||
manifest-author-string,
|
|
||||||
manifest-deprecated-key,
|
|
||||||
manifest-required-key,
|
|
||||||
method-compute,
|
|
||||||
method-inverse,
|
|
||||||
method-required-super,
|
|
||||||
method-search,
|
|
||||||
openerp-exception-warning,
|
|
||||||
pointless-statement,
|
|
||||||
pointless-string-statement,
|
|
||||||
print-used,
|
|
||||||
redundant-keyword-arg,
|
|
||||||
redundant-modulename-xml,
|
|
||||||
reimported,
|
|
||||||
relative-import,
|
|
||||||
return-in-init,
|
|
||||||
rst-syntax-error,
|
|
||||||
sql-injection,
|
|
||||||
too-few-format-args,
|
|
||||||
translation-field,
|
|
||||||
translation-required,
|
|
||||||
unreachable,
|
|
||||||
use-vim-comment,
|
|
||||||
wrong-tabs-instead-of-spaces,
|
|
||||||
xml-syntax-error,
|
|
||||||
# messages that do not cause the lint step to fail
|
|
||||||
consider-merging-classes-inherited,
|
|
||||||
create-user-wo-reset-password,
|
|
||||||
dangerous-filter-wo-user,
|
|
||||||
deprecated-module,
|
|
||||||
file-not-used,
|
|
||||||
invalid-commit,
|
|
||||||
missing-manifest-dependency,
|
|
||||||
missing-newline-extrafiles,
|
|
||||||
missing-readme,
|
|
||||||
no-utf8-coding-comment,
|
|
||||||
odoo-addons-relative-import,
|
|
||||||
old-api7-method-defined,
|
|
||||||
redefined-builtin,
|
|
||||||
too-complex,
|
|
||||||
unnecessary-utf8-coding-comment
|
|
||||||
|
|
||||||
|
|
||||||
[REPORTS]
|
|
||||||
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
|
|
||||||
output-format=colorized
|
|
||||||
reports=no
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
[MASTER]
|
|
||||||
load-plugins=pylint_odoo
|
|
||||||
score=n
|
|
||||||
|
|
||||||
[ODOOLINT]
|
|
||||||
readme_template_url="https://github.com/OCA/maintainer-tools/blob/master/template/module/README.rst"
|
|
||||||
manifest_required_authors=Odoo Community Association (OCA)
|
|
||||||
manifest_required_keys=license
|
|
||||||
manifest_deprecated_keys=description,active
|
|
||||||
license_allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
|
|
||||||
valid_odoo_versions=14.0
|
|
||||||
|
|
||||||
[MESSAGES CONTROL]
|
|
||||||
disable=all
|
|
||||||
|
|
||||||
enable=anomalous-backslash-in-string,
|
|
||||||
api-one-deprecated,
|
|
||||||
api-one-multi-together,
|
|
||||||
assignment-from-none,
|
|
||||||
attribute-deprecated,
|
|
||||||
class-camelcase,
|
|
||||||
dangerous-default-value,
|
|
||||||
dangerous-view-replace-wo-priority,
|
|
||||||
development-status-allowed,
|
|
||||||
duplicate-id-csv,
|
|
||||||
duplicate-key,
|
|
||||||
duplicate-xml-fields,
|
|
||||||
duplicate-xml-record-id,
|
|
||||||
eval-referenced,
|
|
||||||
eval-used,
|
|
||||||
incoherent-interpreter-exec-perm,
|
|
||||||
license-allowed,
|
|
||||||
manifest-author-string,
|
|
||||||
manifest-deprecated-key,
|
|
||||||
manifest-required-key,
|
|
||||||
method-compute,
|
|
||||||
method-inverse,
|
|
||||||
method-required-super,
|
|
||||||
method-search,
|
|
||||||
openerp-exception-warning,
|
|
||||||
pointless-statement,
|
|
||||||
pointless-string-statement,
|
|
||||||
print-used,
|
|
||||||
redundant-keyword-arg,
|
|
||||||
redundant-modulename-xml,
|
|
||||||
reimported,
|
|
||||||
relative-import,
|
|
||||||
return-in-init,
|
|
||||||
rst-syntax-error,
|
|
||||||
sql-injection,
|
|
||||||
too-few-format-args,
|
|
||||||
translation-field,
|
|
||||||
translation-required,
|
|
||||||
unreachable,
|
|
||||||
use-vim-comment,
|
|
||||||
wrong-tabs-instead-of-spaces,
|
|
||||||
xml-syntax-error
|
|
||||||
|
|
||||||
[REPORTS]
|
|
||||||
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
|
|
||||||
output-format=colorized
|
|
||||||
reports=no
|
|
||||||
41
.travis.yml
41
.travis.yml
@@ -1,41 +0,0 @@
|
|||||||
language: python
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- $HOME/.cache/pip
|
|
||||||
- $HOME/.cache/pre-commit
|
|
||||||
|
|
||||||
python:
|
|
||||||
- "3.6"
|
|
||||||
|
|
||||||
addons:
|
|
||||||
postgresql: "9.6"
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
- expect-dev # provides unbuffer utility
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- test
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
include:
|
|
||||||
- stage: test
|
|
||||||
env:
|
|
||||||
- TESTS=1 ODOO_REPO="odoo/odoo" MAKEPOT="1"
|
|
||||||
- stage: test
|
|
||||||
env:
|
|
||||||
- TESTS=1 ODOO_REPO="OCA/OCB"
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- VERSION="14.0" TESTS="0" LINT_CHECK="0" MAKEPOT="0"
|
|
||||||
|
|
||||||
install:
|
|
||||||
- git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git
|
|
||||||
${HOME}/maintainer-quality-tools
|
|
||||||
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
|
|
||||||
- travis_install_nightly
|
|
||||||
|
|
||||||
script:
|
|
||||||
- travis_run_tests
|
|
||||||
|
|
||||||
after_success:
|
|
||||||
- travis_after_tests_success
|
|
||||||
661
LICENSE
661
LICENSE
@@ -1,661 +0,0 @@
|
|||||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 19 November 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU Affero General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works, specifically designed to ensure
|
|
||||||
cooperation with the community in the case of network server software.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
our General Public Licenses are intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
Developers that use our General Public Licenses protect your rights
|
|
||||||
with two steps: (1) assert copyright on the software, and (2) offer
|
|
||||||
you this License which gives you legal permission to copy, distribute
|
|
||||||
and/or modify the software.
|
|
||||||
|
|
||||||
A secondary benefit of defending all users' freedom is that
|
|
||||||
improvements made in alternate versions of the program, if they
|
|
||||||
receive widespread use, become available for other developers to
|
|
||||||
incorporate. Many developers of free software are heartened and
|
|
||||||
encouraged by the resulting cooperation. However, in the case of
|
|
||||||
software used on network servers, this result may fail to come about.
|
|
||||||
The GNU General Public License permits making a modified version and
|
|
||||||
letting the public access it on a server without ever releasing its
|
|
||||||
source code to the public.
|
|
||||||
|
|
||||||
The GNU Affero General Public License is designed specifically to
|
|
||||||
ensure that, in such cases, the modified source code becomes available
|
|
||||||
to the community. It requires the operator of a network server to
|
|
||||||
provide the source code of the modified version running there to the
|
|
||||||
users of that server. Therefore, public use of a modified version, on
|
|
||||||
a publicly accessible server, gives the public access to the source
|
|
||||||
code of the modified version.
|
|
||||||
|
|
||||||
An older license, called the Affero General Public License and
|
|
||||||
published by Affero, was designed to accomplish similar goals. This is
|
|
||||||
a different license, not a version of the Affero GPL, but Affero has
|
|
||||||
released a new version of the Affero GPL which permits relicensing under
|
|
||||||
this license.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, if you modify the
|
|
||||||
Program, your modified version must prominently offer all users
|
|
||||||
interacting with it remotely through a computer network (if your version
|
|
||||||
supports such interaction) an opportunity to receive the Corresponding
|
|
||||||
Source of your version by providing access to the Corresponding Source
|
|
||||||
from a network server at no charge, through some standard or customary
|
|
||||||
means of facilitating copying of software. This Corresponding Source
|
|
||||||
shall include the Corresponding Source for any work covered by version 3
|
|
||||||
of the GNU General Public License that is incorporated pursuant to the
|
|
||||||
following paragraph.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the work with which it is combined will remain governed by version
|
|
||||||
3 of the GNU General Public License.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU Affero General Public License from time to time. Such new versions
|
|
||||||
will be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU Affero General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU Affero General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU Affero General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
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 <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If your software can interact with users remotely through a computer
|
|
||||||
network, you should also make sure that it provides a way for users to
|
|
||||||
get its source. For example, if your program is a web application, its
|
|
||||||
interface could display a "Source" link that leads users to an archive
|
|
||||||
of the code. There are many ways you could offer source, and different
|
|
||||||
solutions will be better for different programs; see section 13 for the
|
|
||||||
specific requirements.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
|
||||||
<https://www.gnu.org/licenses/>.
|
|
||||||
36
README.md
36
README.md
@@ -1,36 +0,0 @@
|
|||||||
[](https://runbot.odoo-community.org/runbot/repo/github-com-oca-odoo-usability-)
|
|
||||||
[](https://travis-ci.com/OCA/odoo-usability)
|
|
||||||
[](https://codecov.io/gh/OCA/odoo-usability)
|
|
||||||
[](https://translation.odoo-community.org/engage/odoo-usability-14-0/?utm_source=widget)
|
|
||||||
|
|
||||||
<!-- /!\ do not modify above this line -->
|
|
||||||
|
|
||||||
# Odoo Usability modules
|
|
||||||
|
|
||||||
Modules that improve UX sensibly
|
|
||||||
|
|
||||||
<!-- /!\ do not modify below this line -->
|
|
||||||
|
|
||||||
<!-- prettier-ignore-start -->
|
|
||||||
|
|
||||||
[//]: # (addons)
|
|
||||||
|
|
||||||
This part will be replaced when running the oca-gen-addons-table script from OCA/maintainer-tools.
|
|
||||||
|
|
||||||
[//]: # (end addons)
|
|
||||||
|
|
||||||
<!-- prettier-ignore-end -->
|
|
||||||
|
|
||||||
## Licenses
|
|
||||||
|
|
||||||
This repository is licensed under [AGPL-3.0](LICENSE).
|
|
||||||
|
|
||||||
However, each module can have a totally different license, as long as they adhere to OCA
|
|
||||||
policy. Consult each module's `__manifest__.py` file, which contains a `license` key
|
|
||||||
that explains its license.
|
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
OCA, or the [Odoo Community Association](http://odoo-community.org/), is a nonprofit
|
|
||||||
organization whose mission is to support the collaborative development of Odoo features
|
|
||||||
and promote its widespread use.
|
|
||||||
3
account_aged_balance_from_partner/__init__.py
Normal file
3
account_aged_balance_from_partner/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import partner
|
||||||
25
account_aged_balance_from_partner/__manifest__.py
Normal file
25
account_aged_balance_from_partner/__manifest__.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright 2015-2018 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': 'Aged Partner Balance from Partner',
|
||||||
|
'version': '10.0.0.1.0',
|
||||||
|
'category': 'Accounting',
|
||||||
|
'license': 'AGPL-3',
|
||||||
|
'summary': 'Direct access to the aged partner balance report from the partner form',
|
||||||
|
'description': """
|
||||||
|
Aged Partner Balance from Partner
|
||||||
|
=================================
|
||||||
|
|
||||||
|
This module adds a button on the partner form view (the icon on the button is a banknote) to easily open the detailed aged partner balance of the partner in PDF format.
|
||||||
|
|
||||||
|
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||||
|
""",
|
||||||
|
'author': 'Akretion',
|
||||||
|
'website': 'http://www.akretion.com',
|
||||||
|
'depends': ['account_financial_report_qweb'],
|
||||||
|
'data': ['partner_view.xml'],
|
||||||
|
'installable': True,
|
||||||
|
}
|
||||||
30
account_aged_balance_from_partner/partner.py
Normal file
30
account_aged_balance_from_partner/partner.py
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2015-2018 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).
|
||||||
|
|
||||||
|
|
||||||
|
from odoo import models, fields, api
|
||||||
|
|
||||||
|
|
||||||
|
class ResPartner(models.Model):
|
||||||
|
_inherit = 'res.partner'
|
||||||
|
|
||||||
|
@api.depends('credit', 'debit')
|
||||||
|
def _compute_balance(self):
|
||||||
|
for partner in self:
|
||||||
|
partner.balance = partner.credit - partner.debit
|
||||||
|
|
||||||
|
# The field 'currency_id' defined in the account module
|
||||||
|
# is a computed field that gets the company currency
|
||||||
|
balance = fields.Monetary(
|
||||||
|
compute='_compute_balance', readonly=True,
|
||||||
|
string="Account Balance")
|
||||||
|
|
||||||
|
def open_aged_open_invoices_report(self):
|
||||||
|
wiz = self.env['aged.partner.balance.wizard'].create({
|
||||||
|
'show_move_line_details': True,
|
||||||
|
'partner_ids': [(6, 0, self.ids)],
|
||||||
|
})
|
||||||
|
action = wiz.button_export_pdf()
|
||||||
|
return action
|
||||||
31
account_aged_balance_from_partner/partner_view.xml
Normal file
31
account_aged_balance_from_partner/partner_view.xml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2015-2018 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).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="view_partner_form" model="ir.ui.view">
|
||||||
|
<field name="name">account.balance.button.partner.form</field>
|
||||||
|
<field name="model">res.partner</field>
|
||||||
|
<field name="inherit_id" ref="account.partner_view_buttons"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<button name="open_partner_history" type="object" position="after">
|
||||||
|
<button class="oe_stat_button" type="object"
|
||||||
|
name="open_aged_open_invoices_report"
|
||||||
|
attrs="{'invisible': [('parent_id', '!=', False)]}"
|
||||||
|
icon="fa-money">
|
||||||
|
<div class="o_form_field o_stat_info">
|
||||||
|
<span class="o_stat_value"><field name="balance"/></span>
|
||||||
|
<span class="o_stat_text">Account Balance</span>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
</button>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
</odoo>
|
||||||
35
account_bank_statement_import_fr_hsbc_card/README.rst
Normal file
35
account_bank_statement_import_fr_hsbc_card/README.rst
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
|
||||||
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||||
|
:alt: License: AGPL-3
|
||||||
|
|
||||||
|
=======================================
|
||||||
|
Import French HSBC Card Bank Statements
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
This module allows you to import French HSBC credit cards bank statements (CSV version).
|
||||||
|
|
||||||
|
Configuration
|
||||||
|
=============
|
||||||
|
|
||||||
|
Create a bank journal dedicated to HSBC credit cards. Associate it with a new bank account on which you will set the account number to *HSBC_CARD_EUR*.
|
||||||
|
|
||||||
|
Usage
|
||||||
|
=====
|
||||||
|
|
||||||
|
In the dashboard of the *Accounting* menu, click on the button *Import Statement* located on the journal corresponding to the bank account of the statement file you are importing.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
Credits
|
||||||
|
=======
|
||||||
|
|
||||||
|
Contributors
|
||||||
|
------------
|
||||||
|
|
||||||
|
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
3
account_bank_statement_import_fr_hsbc_card/__init__.py
Normal file
3
account_bank_statement_import_fr_hsbc_card/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import wizard
|
||||||
16
account_bank_statement_import_fr_hsbc_card/__manifest__.py
Normal file
16
account_bank_statement_import_fr_hsbc_card/__manifest__.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 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).
|
||||||
|
|
||||||
|
{
|
||||||
|
'name': 'Import French HSBC Card Bank Statements',
|
||||||
|
'version': '10.0.1.0.0',
|
||||||
|
'license': 'AGPL-3',
|
||||||
|
'author': "Akretion",
|
||||||
|
'website': 'http://www.akretion.com',
|
||||||
|
'summary': 'Import French HSBC Card Bank Statements in Odoo (CSV version)',
|
||||||
|
'depends': ['account_bank_statement_import'],
|
||||||
|
'data': ['views/account_bank_statement_import.xml'],
|
||||||
|
'installable': True,
|
||||||
|
}
|
||||||
69
account_bank_statement_import_fr_hsbc_card/i18n/nb_NO.po
Normal file
69
account_bank_statement_import_fr_hsbc_card/i18n/nb_NO.po
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * account_bank_statement_import_fr_cfonb
|
||||||
|
#
|
||||||
|
# Translators:
|
||||||
|
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 10.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2017-01-13 03:36+0000\n"
|
||||||
|
"PO-Revision-Date: 2017-01-13 03:36+0000\n"
|
||||||
|
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\n"
|
||||||
|
"Language-Team: Norwegian Bokmål (Norway) (https://www.transifex.com/oca/teams/23907/nb_NO/)\n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Language: nb_NO\n"
|
||||||
|
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||||
|
|
||||||
|
#. module: account_bank_statement_import_fr_cfonb
|
||||||
|
#: code:addons/account_bank_statement_import_fr_cfonb/models/account_bank_statement_import.py:146
|
||||||
|
#, python-format
|
||||||
|
msgid "Account %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: account_bank_statement_import_fr_cfonb
|
||||||
|
#: model:ir.ui.view,arch_db:account_bank_statement_import_fr_cfonb.account_bank_statement_import_view
|
||||||
|
msgid "CFONB (French format, fixed-length text lines of 120 caracters)"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: account_bank_statement_import_fr_cfonb
|
||||||
|
#: model:ir.model,name:account_bank_statement_import_fr_cfonb.model_account_bank_statement_import
|
||||||
|
msgid "Import Bank Statement"
|
||||||
|
msgstr "Importer bankutsagn"
|
||||||
|
|
||||||
|
#. module: account_bank_statement_import_fr_cfonb
|
||||||
|
#: code:addons/account_bank_statement_import_fr_cfonb/models/account_bank_statement_import.py:70
|
||||||
|
#, python-format
|
||||||
|
msgid ""
|
||||||
|
"Line %d is %d caracters long. All lines of a CFONB bank statement file must "
|
||||||
|
"be 120 caracters long."
|
||||||
|
msgstr ""
|
||||||
|
"Linje %d er %d tegn langt. Alle linjer i en CFONB-bankutsagnsfil må være 120"
|
||||||
|
" tegn langt."
|
||||||
|
|
||||||
|
#. module: account_bank_statement_import_fr_cfonb
|
||||||
|
#: code:addons/account_bank_statement_import_fr_cfonb/models/account_bank_statement_import.py:110
|
||||||
|
#, python-format
|
||||||
|
msgid ""
|
||||||
|
"Only single-account files and single-currency files are supported for the "
|
||||||
|
"moment. It is not the case starting from line %d."
|
||||||
|
msgstr ""
|
||||||
|
"Kun enkeltkontofiler og enkeltmyntenhetsfiler støttes for øyeblikket. Dette "
|
||||||
|
"er ikke tilfellet fra og med linje %d og utover."
|
||||||
|
|
||||||
|
#. module: account_bank_statement_import_fr_cfonb
|
||||||
|
#: code:addons/account_bank_statement_import_fr_cfonb/models/account_bank_statement_import.py:99
|
||||||
|
#, python-format
|
||||||
|
msgid ""
|
||||||
|
"The 2 first letters of the first line are '%s'. A CFONB file should start "
|
||||||
|
"with '01'"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: account_bank_statement_import_fr_cfonb
|
||||||
|
#: code:addons/account_bank_statement_import_fr_cfonb/models/account_bank_statement_import.py:52
|
||||||
|
#, python-format
|
||||||
|
msgid "The file is empty."
|
||||||
|
msgstr "Filen er tom."
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" ?>
|
||||||
|
<!--
|
||||||
|
© 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="account_bank_statement_import_view" model="ir.ui.view">
|
||||||
|
<field name="name">hsbc.fr.csv.account.bank.statement.import.form</field>
|
||||||
|
<field name="model">account.bank.statement.import</field>
|
||||||
|
<field name="inherit_id" ref="account_bank_statement_import.account_bank_statement_import_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//ul[@id='statement_format']" position="inside">
|
||||||
|
<li>French HSBC Credit Cards (CSV format)</li>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
</odoo>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import account_bank_statement_import
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 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).
|
||||||
|
|
||||||
|
import logging
|
||||||
|
import unicodecsv
|
||||||
|
from tempfile import TemporaryFile
|
||||||
|
from datetime import datetime
|
||||||
|
from odoo import models, fields, api, _
|
||||||
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class AccountBankStatementImport(models.TransientModel):
|
||||||
|
_inherit = 'account.bank.statement.import'
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _check_hsbc_card_csv(self, data_file):
|
||||||
|
return data_file.strip().startswith(
|
||||||
|
'Titulaire;Division;;Cpt Affaires;Num carte;')
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _parse_file(self, data_file):
|
||||||
|
""" Import a file in French HSBC CSV Credit card format"""
|
||||||
|
hsbc_csv = self._check_hsbc_card_csv(data_file)
|
||||||
|
if not hsbc_csv:
|
||||||
|
return super(AccountBankStatementImport, self)._parse_file(
|
||||||
|
data_file)
|
||||||
|
transactions = []
|
||||||
|
fileobj = TemporaryFile('w+')
|
||||||
|
fileobj.write(data_file)
|
||||||
|
fileobj.seek(0)
|
||||||
|
reader = unicodecsv.DictReader(
|
||||||
|
fileobj,
|
||||||
|
fieldnames=[
|
||||||
|
'company', 'division', 'empty', 'account',
|
||||||
|
'card_num', 'title', 'lastname', 'firstname',
|
||||||
|
'op_code', 'seller_type', 'seller', 'date', 'acc_date',
|
||||||
|
'hour', 'city', 'code', 'label', 'local_amount',
|
||||||
|
'local_currency', 'acc_amount', 'acc_currency'],
|
||||||
|
delimiter=';',
|
||||||
|
quoting=unicodecsv.QUOTE_MINIMAL,
|
||||||
|
encoding='latin1')
|
||||||
|
i = 0
|
||||||
|
start_balance = end_balance = 0.0
|
||||||
|
currency_code = 'EUR'
|
||||||
|
account_number = 'HSBC_CARD_EUR'
|
||||||
|
for line in reader:
|
||||||
|
i += 1
|
||||||
|
if i == 1:
|
||||||
|
continue # skip title line
|
||||||
|
_logger.debug("Line %d: %s" % (i, line))
|
||||||
|
if not line:
|
||||||
|
continue
|
||||||
|
# cleanup
|
||||||
|
for key, value in line.iteritems():
|
||||||
|
line[key] = value and value.strip() or False
|
||||||
|
if not line['date'] or not line['acc_amount']:
|
||||||
|
continue
|
||||||
|
labels = [
|
||||||
|
'%s %s' % (line['firstname'], line['lastname']),
|
||||||
|
'%s (%s)' % (line['seller'], line['seller_type']),
|
||||||
|
line['city']]
|
||||||
|
if line['local_currency'] != currency_code:
|
||||||
|
labels.append(
|
||||||
|
'%s %s' % (line['local_amount'], line['local_currency']))
|
||||||
|
name = ', '.join(labels)
|
||||||
|
amount = float(
|
||||||
|
line['acc_amount'].replace(',', '.').replace(' ', '')) * -1
|
||||||
|
end_balance += amount
|
||||||
|
date_dt = datetime.strptime(line['date'], '%d/%m/%Y')
|
||||||
|
date_str = fields.Date.to_string(date_dt)
|
||||||
|
if line['acc_currency'] != currency_code:
|
||||||
|
raise UserError(_(
|
||||||
|
"On line %d of the HSBC CSV file, the column "
|
||||||
|
"'Dev Cpt Affaires' contains '%s' instead of 'EUR'")
|
||||||
|
% (line['acc_currency'], i))
|
||||||
|
vals_line = {
|
||||||
|
'date': date_str,
|
||||||
|
'name': name,
|
||||||
|
'ref': False,
|
||||||
|
# unfortunately, I'm obliged to include i in
|
||||||
|
# the unique_import_id, which will disable the auto-delete
|
||||||
|
# of already imported lines. But experice has proven that
|
||||||
|
# Internet payment often have hour=00:00, and it's possible
|
||||||
|
# to have 2 internet payments for the same supplier the same
|
||||||
|
# day with the same amount (e.g. purchase a return ticket)
|
||||||
|
'unique_import_id': '%s-%s-%.2f-%s-%d' % (
|
||||||
|
date_str, line['hour'], amount, name, i),
|
||||||
|
'amount': amount,
|
||||||
|
'partner_id': False,
|
||||||
|
}
|
||||||
|
transactions.append(vals_line)
|
||||||
|
vals_bank_statement = {
|
||||||
|
'name': _('HSBC Cards'),
|
||||||
|
'balance_start': start_balance,
|
||||||
|
'balance_end_real': end_balance,
|
||||||
|
'transactions': transactions,
|
||||||
|
}
|
||||||
|
fileobj.close()
|
||||||
|
# from pprint import pprint
|
||||||
|
# pprint(vals_bank_statement)
|
||||||
|
return currency_code, account_number, [vals_bank_statement]
|
||||||
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
|
||||||
29
account_bank_statement_import_usability/__manifest__.py
Normal file
29
account_bank_statement_import_usability/__manifest__.py
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2015-2016 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 Bank Statement Import Usability',
|
||||||
|
'version': '10.0.0.1.0',
|
||||||
|
'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:
|
||||||
|
|
||||||
|
* Works if the bank statement file only contain the account number and not the full IBAN
|
||||||
|
|
||||||
|
* remove start balance and end balance (doesn't work with OFX, which is one of the most used file format !)
|
||||||
|
|
||||||
|
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': True,
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2015-2016 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).
|
||||||
|
|
||||||
|
from odoo import models, api
|
||||||
|
|
||||||
|
|
||||||
|
class AccountBankStatementImport(models.TransientModel):
|
||||||
|
_inherit = 'account.bank.statement.import'
|
||||||
|
|
||||||
|
def _check_journal_bank_account(self, journal, account_number):
|
||||||
|
if account_number in journal.bank_account_id.sanitized_acc_number:
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
@api.multi
|
||||||
|
def _balance_check(self):
|
||||||
|
return True
|
||||||
48
account_bank_statement_import_usability/account_view.xml
Normal file
48
account_bank_statement_import_usability/account_view.xml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
© 2016 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).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Let's try again to work with balance_start and balance_end_real
|
||||||
|
in v10 to see if we can work with it in v10 or not...
|
||||||
|
If we really can't, I'll re-activate this view inheritance again
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
|
||||||
|
</odoo>
|
||||||
3
account_bank_statement_no_reconcile_guess/__init__.py
Normal file
3
account_bank_statement_no_reconcile_guess/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import account
|
||||||
33
account_bank_statement_no_reconcile_guess/__manifest__.py
Normal file
33
account_bank_statement_no_reconcile_guess/__manifest__.py
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 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).
|
||||||
|
|
||||||
|
{
|
||||||
|
'name': 'Account Bank Statement No Reconcile Guess',
|
||||||
|
'version': '10.0.1.0.0',
|
||||||
|
'category': 'Accounting & Finance',
|
||||||
|
'license': 'AGPL-3',
|
||||||
|
'summary': "Don't pre-select lines to reconcile in bank statements",
|
||||||
|
'description': """
|
||||||
|
Account Bank Statement No Reconcile Guess
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
Here is a scenario where the "reconcile guess" feature is a problem for the accountant:
|
||||||
|
|
||||||
|
1) The accountant imports a large bank statement with 40 bank statement lines.
|
||||||
|
2) The "reconcile guess" feature will pre-select reconcile of line X with line 39 of the bank statement. But this guess is a mistake and line X should be reconciled with line 2 of the bank statement.
|
||||||
|
=> The accountant will not understand why he can't select line X to be reconciled with line 2 of the bank statement. To be able to reconcile line 2 correctif, he has to:
|
||||||
|
3) click several times on the "next page" button to reach line 39 of the bank statement and unselect line X.
|
||||||
|
4) Go back to line 2 of the bank statement and now he will be able to select line X.
|
||||||
|
|
||||||
|
This module disables the "reconcile guess" feature to avoid this problem.
|
||||||
|
|
||||||
|
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': [],
|
||||||
|
'installable': True,
|
||||||
|
}
|
||||||
14
account_bank_statement_no_reconcile_guess/account.py
Normal file
14
account_bank_statement_no_reconcile_guess/account.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 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).
|
||||||
|
|
||||||
|
from odoo import models
|
||||||
|
|
||||||
|
|
||||||
|
class AccountBankStatementLine(models.Model):
|
||||||
|
_inherit = 'account.bank.statement.line'
|
||||||
|
|
||||||
|
def get_reconciliation_proposition(self, excluded_ids=None):
|
||||||
|
self.ensure_one()
|
||||||
|
return self.env['account.move.line']
|
||||||
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/__manifest__.py
Normal file
46
account_credit_control_usability/__manifest__.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/__manifest__.py
Normal file
24
account_cutoff_accrual_picking_ods/__manifest__.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/__manifest__.py
Normal file
43
account_cutoff_prepaid_ods/__manifest__.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/__manifest__.py
Normal file
47
account_direct_debit_autogenerate/__manifest__.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,13 +1,14 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
# © 2016-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
# © 2016-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "Account Fiscal Position Payable Receivable",
|
'name': 'Account Fiscal Position Payable Receivable',
|
||||||
"version": "12.0.1.0.0",
|
'version': '10.0.1.0.0',
|
||||||
"category": "Accounting & Finance",
|
'category': 'Accounting & Finance',
|
||||||
"license": "AGPL-3",
|
'license': 'AGPL-3',
|
||||||
"summary": "Configure payable/receivable accounts on fiscal positions",
|
'summary': 'Configure payable/receivable accounts on fiscal positions',
|
||||||
"description": """
|
'description': """
|
||||||
Account Fiscal Position Payable Receivable
|
Account Fiscal Position Payable Receivable
|
||||||
==========================================
|
==========================================
|
||||||
|
|
||||||
@@ -15,9 +16,11 @@ This module allows to configure a special *Partner Receivable Account* and a spe
|
|||||||
|
|
||||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||||
""",
|
""",
|
||||||
"author": "Akretion",
|
'author': "Akretion",
|
||||||
"website": "https://github.com/OCA/odoo-usability",
|
'website': 'http://www.akretion.com',
|
||||||
"depends": ["account"],
|
'depends': ['account'],
|
||||||
"data": ["views/account_fiscal_position_view.xml"],
|
'data': [
|
||||||
"installable": False,
|
'account_fiscal_position_view.xml',
|
||||||
|
],
|
||||||
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 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, api
|
||||||
|
|
||||||
|
|
||||||
|
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')])
|
||||||
|
|
||||||
|
|
||||||
|
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')
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
|
|
||||||
@@ -12,8 +13,8 @@
|
|||||||
<field name="inherit_id" ref="account.view_account_position_form" />
|
<field name="inherit_id" ref="account.view_account_position_form" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="company_id" position="after">
|
<field name="company_id" position="after">
|
||||||
<field name="receivable_account_id" />
|
<field name="receivable_account_id"/>
|
||||||
<field name="payable_account_id" />
|
<field name="payable_account_id"/>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -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 fields, models
|
|
||||||
|
|
||||||
|
|
||||||
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 api, models
|
|
||||||
|
|
||||||
|
|
||||||
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"
|
|
||||||
)
|
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from . import account_invoice
|
from . import account_invoice
|
||||||
from . import account_invoice_report
|
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
# Copyright 2015-2019 Akretion France (http://www.akretion.com)
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2015-2017 Akretion (http://www.akretion.com)
|
||||||
# @author Alexis de Lattre <alexis.delattre@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",
|
'name': 'Account Invoice Margin',
|
||||||
"version": "12.0.1.0.0",
|
'version': '10.0.1.0.0',
|
||||||
"category": "Invoicing Management",
|
'category': 'Accounting & Finance',
|
||||||
"license": "AGPL-3",
|
'license': 'AGPL-3',
|
||||||
"summary": "Copy standard price on invoice line and compute margins",
|
'summary': 'Copy standard price on invoice line and compute margins',
|
||||||
"description": """
|
'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 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
|
This module has been written by Alexis de Lattre from Akretion
|
||||||
<alexis.delattre@akretion.com>.
|
<alexis.delattre@akretion.com>.
|
||||||
""",
|
""",
|
||||||
"author": "Akretion",
|
'author': 'Akretion',
|
||||||
"website": "https://github.com/OCA/odoo-usability",
|
'website': 'http://www.akretion.com',
|
||||||
"depends": ["account"],
|
'depends': ['account'],
|
||||||
"data": [
|
'data': [
|
||||||
"account_invoice_view.xml",
|
'account_invoice_view.xml',
|
||||||
],
|
],
|
||||||
"installable": False,
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,64 +1,42 @@
|
|||||||
# Copyright 2015-2019 Akretion France (http://www.akretion.com)
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2015-2017 Akretion (http://www.akretion.com)
|
||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo import api, fields, models
|
from odoo import models, fields, api
|
||||||
|
|
||||||
import odoo.addons.decimal_precision as dp
|
import odoo.addons.decimal_precision as dp
|
||||||
|
|
||||||
|
|
||||||
class AccountInvoiceLine(models.Model):
|
class AccountInvoiceLine(models.Model):
|
||||||
_inherit = "account.invoice.line"
|
_inherit = 'account.invoice.line'
|
||||||
|
|
||||||
standard_price_company_currency = fields.Float(
|
standard_price_company_currency = fields.Float(
|
||||||
string="Cost Price in Company Currency",
|
string='Cost Price in Company Currency', readonly=True,
|
||||||
readonly=True,
|
digits=dp.get_precision('Product Price'),
|
||||||
digits=dp.get_precision("Product Price"),
|
|
||||||
help="Cost price in company currency in the unit of measure "
|
help="Cost price in company currency in the unit of measure "
|
||||||
"of the invoice line (which may be different from the unit "
|
"of the invoice line (which may be different from the unit "
|
||||||
"of measure of the product).",
|
"of measure of the product).")
|
||||||
)
|
|
||||||
standard_price_invoice_currency = fields.Float(
|
standard_price_invoice_currency = fields.Float(
|
||||||
string="Cost Price in Invoice Currency",
|
string='Cost Price in Invoice Currency', readonly=True,
|
||||||
readonly=True,
|
compute='_compute_margin', store=True,
|
||||||
compute="_compute_margin",
|
digits=dp.get_precision('Product Price'),
|
||||||
store=True,
|
|
||||||
digits=dp.get_precision("Product Price"),
|
|
||||||
help="Cost price in invoice currency in the unit of measure "
|
help="Cost price in invoice currency in the unit of measure "
|
||||||
"of the invoice line",
|
"of the invoice line")
|
||||||
)
|
|
||||||
margin_invoice_currency = fields.Monetary(
|
margin_invoice_currency = fields.Monetary(
|
||||||
string="Margin in Invoice Currency",
|
string='Margin in Invoice Currency', readonly=True, store=True,
|
||||||
readonly=True,
|
compute='_compute_margin', currency_field='currency_id')
|
||||||
store=True,
|
|
||||||
compute="_compute_margin",
|
|
||||||
currency_field="currency_id",
|
|
||||||
)
|
|
||||||
margin_company_currency = fields.Monetary(
|
margin_company_currency = fields.Monetary(
|
||||||
string="Margin in Company Currency",
|
string='Margin in Company Currency', readonly=True, store=True,
|
||||||
readonly=True,
|
compute='_compute_margin', currency_field='company_currency_id')
|
||||||
store=True,
|
|
||||||
compute="_compute_margin",
|
|
||||||
currency_field="company_currency_id",
|
|
||||||
)
|
|
||||||
margin_rate = fields.Float(
|
margin_rate = fields.Float(
|
||||||
string="Margin Rate",
|
string="Margin Rate", readonly=True, store=True,
|
||||||
readonly=True,
|
compute='_compute_margin',
|
||||||
store=True,
|
digits=(16, 2), help="Margin rate in percentage of the sale price")
|
||||||
compute="_compute_margin",
|
|
||||||
digits=(16, 2),
|
|
||||||
help="Margin rate in percentage of the sale price",
|
|
||||||
)
|
|
||||||
|
|
||||||
@api.depends(
|
@api.depends(
|
||||||
"standard_price_company_currency",
|
'standard_price_company_currency', 'invoice_id.currency_id',
|
||||||
"invoice_id.currency_id",
|
'invoice_id.type', 'invoice_id.company_id',
|
||||||
"invoice_id.type",
|
'invoice_id.date_invoice', 'quantity', 'price_subtotal')
|
||||||
"invoice_id.company_id",
|
|
||||||
"invoice_id.date_invoice",
|
|
||||||
"quantity",
|
|
||||||
"price_subtotal",
|
|
||||||
)
|
|
||||||
def _compute_margin(self):
|
def _compute_margin(self):
|
||||||
for il in self:
|
for il in self:
|
||||||
standard_price_inv_cur = 0.0
|
standard_price_inv_cur = 0.0
|
||||||
@@ -66,27 +44,25 @@ class AccountInvoiceLine(models.Model):
|
|||||||
margin_comp_cur = 0.0
|
margin_comp_cur = 0.0
|
||||||
margin_rate = 0.0
|
margin_rate = 0.0
|
||||||
inv = il.invoice_id
|
inv = il.invoice_id
|
||||||
if inv and inv.type in ("out_invoice", "out_refund"):
|
if inv and inv.type in ('out_invoice', 'out_refund'):
|
||||||
# it works in _get_current_rate
|
# it works in _get_current_rate
|
||||||
# even if we set date = False in context
|
# even if we set date = False in context
|
||||||
# standard_price_inv_cur is in the UoM of the invoice line
|
# standard_price_inv_cur is in the UoM of the invoice line
|
||||||
date = inv._get_currency_rate_date() or fields.Date.context_today(self)
|
standard_price_inv_cur =\
|
||||||
company = inv.company_id
|
inv.company_id.currency_id.with_context(
|
||||||
company_currency = company.currency_id
|
date=inv.date_invoice).compute(
|
||||||
standard_price_inv_cur = company_currency._convert(
|
il.standard_price_company_currency,
|
||||||
il.standard_price_company_currency, inv.currency_id, company, date
|
inv.currency_id)
|
||||||
)
|
margin_inv_cur =\
|
||||||
margin_inv_cur = (
|
|
||||||
il.price_subtotal - il.quantity * standard_price_inv_cur
|
il.price_subtotal - il.quantity * standard_price_inv_cur
|
||||||
)
|
margin_comp_cur = inv.currency_id.with_context(
|
||||||
margin_comp_cur = inv.currency_id._convert(
|
date=inv.date_invoice).compute(
|
||||||
margin_inv_cur, company_currency, company, date
|
margin_inv_cur, inv.company_id.currency_id)
|
||||||
)
|
|
||||||
if il.price_subtotal:
|
if il.price_subtotal:
|
||||||
margin_rate = 100 * margin_inv_cur / il.price_subtotal
|
margin_rate = 100 * margin_inv_cur / il.price_subtotal
|
||||||
# for a refund, margin should be negative
|
# for a refund, margin should be negative
|
||||||
# but margin rate should stay positive
|
# but margin rate should stay positive
|
||||||
if inv.type == "out_refund":
|
if inv.type == 'out_refund':
|
||||||
margin_inv_cur *= -1
|
margin_inv_cur *= -1
|
||||||
margin_comp_cur *= -1
|
margin_comp_cur *= -1
|
||||||
il.standard_price_invoice_currency = standard_price_inv_cur
|
il.standard_price_invoice_currency = standard_price_inv_cur
|
||||||
@@ -102,32 +78,35 @@ class AccountInvoiceLine(models.Model):
|
|||||||
# because we don't have access to the 'type' of the invoice
|
# because we don't have access to the 'type' of the invoice
|
||||||
@api.model
|
@api.model
|
||||||
def create(self, vals):
|
def create(self, vals):
|
||||||
if vals.get("product_id"):
|
if vals.get('product_id'):
|
||||||
pp = self.env["product.product"].browse(vals["product_id"])
|
pp = self.env['product.product'].browse(vals['product_id'])
|
||||||
std_price = pp.standard_price
|
std_price = pp.standard_price
|
||||||
inv_uom_id = vals.get("uom_id")
|
inv_uom_id = vals.get('uom_id')
|
||||||
if inv_uom_id and inv_uom_id != pp.uom_id.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 = self.env['product.uom']._compute_price(
|
||||||
std_price = pp.uom_id._compute_price(std_price, inv_uom)
|
pp.uom_id.id, std_price, inv_uom_id)
|
||||||
vals["standard_price_company_currency"] = std_price
|
vals['standard_price_company_currency'] = std_price
|
||||||
return super(AccountInvoiceLine, self).create(vals)
|
return super(AccountInvoiceLine, self).create(vals)
|
||||||
|
|
||||||
|
@api.multi
|
||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
if not vals:
|
if not vals:
|
||||||
vals = {}
|
vals = {}
|
||||||
if "product_id" in vals or "uom_id" in vals:
|
if 'product_id' in vals or 'uom_id' in vals:
|
||||||
for il in self:
|
for il in self:
|
||||||
if "product_id" in vals:
|
if 'product_id' in vals:
|
||||||
if vals.get("product_id"):
|
if vals.get('product_id'):
|
||||||
pp = self.env["product.product"].browse(vals["product_id"])
|
pp = self.env['product.product'].browse(
|
||||||
|
vals['product_id'])
|
||||||
else:
|
else:
|
||||||
pp = False
|
pp = False
|
||||||
else:
|
else:
|
||||||
pp = il.product_id or False
|
pp = il.product_id or False
|
||||||
# uom_id is NOT a required field
|
# uom_id is NOT a required field
|
||||||
if "uom_id" in vals:
|
if 'uom_id' in vals:
|
||||||
if vals.get("uom_id"):
|
if vals.get('uom_id'):
|
||||||
inv_uom = self.env["uom.uom"].browse(vals["uom_id"])
|
inv_uom = self.env['product.uom'].browse(
|
||||||
|
vals['uom_id'])
|
||||||
else:
|
else:
|
||||||
inv_uom = False
|
inv_uom = False
|
||||||
else:
|
else:
|
||||||
@@ -136,43 +115,35 @@ class AccountInvoiceLine(models.Model):
|
|||||||
if pp:
|
if pp:
|
||||||
std_price = pp.standard_price
|
std_price = pp.standard_price
|
||||||
if inv_uom and inv_uom != pp.uom_id:
|
if inv_uom and inv_uom != pp.uom_id:
|
||||||
std_price = pp.uom_id._compute_price(std_price, inv_uom)
|
std_price = pp.uom_id._compute_price(
|
||||||
il.write({"standard_price_company_currency": std_price})
|
std_price, inv_uom)
|
||||||
|
il.write({'standard_price_company_currency': std_price})
|
||||||
return super(AccountInvoiceLine, self).write(vals)
|
return super(AccountInvoiceLine, self).write(vals)
|
||||||
|
|
||||||
|
|
||||||
class AccountInvoice(models.Model):
|
class AccountInvoice(models.Model):
|
||||||
_inherit = "account.invoice"
|
_inherit = 'account.invoice'
|
||||||
|
|
||||||
margin_invoice_currency = fields.Monetary(
|
margin_invoice_currency = fields.Monetary(
|
||||||
string="Margin in Invoice Currency",
|
string='Margin in Invoice Currency',
|
||||||
compute="_compute_margin",
|
readonly=True, compute='_compute_margin', store=True,
|
||||||
store=True,
|
currency_field='currency_id')
|
||||||
readonly=True,
|
|
||||||
currency_field="currency_id",
|
|
||||||
)
|
|
||||||
margin_company_currency = fields.Monetary(
|
margin_company_currency = fields.Monetary(
|
||||||
string="Margin in Company Currency",
|
string='Margin in Company Currency',
|
||||||
compute="_compute_margin",
|
readonly=True, compute='_compute_margin', store=True,
|
||||||
store=True,
|
currency_field='company_currency_id')
|
||||||
readonly=True,
|
|
||||||
currency_field="company_currency_id",
|
|
||||||
)
|
|
||||||
|
|
||||||
@api.depends(
|
@api.depends(
|
||||||
"type",
|
'type',
|
||||||
"invoice_line_ids.margin_invoice_currency",
|
'invoice_line_ids.margin_invoice_currency',
|
||||||
"invoice_line_ids.margin_company_currency",
|
'invoice_line_ids.margin_company_currency')
|
||||||
)
|
|
||||||
def _compute_margin(self):
|
def _compute_margin(self):
|
||||||
res = self.env["account.invoice.line"].read_group(
|
for inv in self:
|
||||||
[("invoice_id", "in", self.ids)],
|
margin_inv_cur = 0.0
|
||||||
["invoice_id", "margin_invoice_currency", "margin_company_currency"],
|
margin_comp_cur = 0.0
|
||||||
["invoice_id"],
|
if inv.type in ('out_invoice', 'out_refund'):
|
||||||
)
|
for il in inv.invoice_line_ids:
|
||||||
for re in res:
|
margin_inv_cur += il.margin_invoice_currency
|
||||||
if re["invoice_id"]:
|
margin_comp_cur += il.margin_company_currency
|
||||||
inv = self.browse(re["invoice_id"][0])
|
inv.margin_invoice_currency = margin_inv_cur
|
||||||
if inv.type in ("out_invoice", "out_refund"):
|
inv.margin_company_currency = margin_comp_cur
|
||||||
inv.margin_invoice_currency = re["margin_invoice_currency"]
|
|
||||||
inv.margin_company_currency = re["margin_company_currency"]
|
|
||||||
|
|||||||
@@ -1,83 +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,62 +1,51 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
© 2015-2017 Akretion (http://www.akretion.com/)
|
© 2015-2017 Akretion (http://www.akretion.com/)
|
||||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<record id="view_invoice_line_form" model="ir.ui.view">
|
<record id="view_invoice_line_form" model="ir.ui.view">
|
||||||
<field name="name">margin.account.invoice.line.form</field>
|
<field name="name">margin.account.invoice.line.form</field>
|
||||||
<field name="model">account.invoice.line</field>
|
<field name="model">account.invoice.line</field>
|
||||||
<field name="inherit_id" ref="account.view_invoice_line_form" />
|
<field name="inherit_id" ref="account.view_invoice_line_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='analytic_tag_ids']/.." position="inside">
|
<field name="discount" position="after">
|
||||||
<field
|
<field name="standard_price_company_currency"
|
||||||
name="standard_price_company_currency"
|
groups="account.group_account_user"/>
|
||||||
string="Cost Price in Comp. Cur."
|
<field name="standard_price_invoice_currency"
|
||||||
groups="base.group_no_one"
|
widget="monetary"
|
||||||
/>
|
options="{'currency_field': 'currency_id'}"
|
||||||
<field
|
groups="account.group_account_user"/>
|
||||||
name="standard_price_invoice_currency"
|
<field name="margin_invoice_currency"
|
||||||
string="Cost Price in Inv. Cur."
|
groups="account.group_account_user"/>
|
||||||
groups="base.group_no_one"
|
<field name="margin_company_currency"
|
||||||
/>
|
groups="account.group_account_user"/>
|
||||||
<field
|
</field>
|
||||||
name="margin_invoice_currency"
|
|
||||||
string="Margin in Inv. Cur."
|
|
||||||
groups="base.group_no_one"
|
|
||||||
/>
|
|
||||||
<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>
|
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="invoice_form" model="ir.ui.view">
|
<record id="invoice_form" model="ir.ui.view">
|
||||||
<field name="name">margin.account.invoice.form</field>
|
<field name="name">margin.account.invoice.form</field>
|
||||||
<field name="model">account.invoice</field>
|
<field name="model">account.invoice</field>
|
||||||
<field name="inherit_id" ref="account.invoice_form" />
|
<field name="inherit_id" ref="account.invoice_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="move_id" position="after">
|
<field name="move_id" position="after">
|
||||||
<field
|
<field name="margin_invoice_currency"
|
||||||
name="margin_invoice_currency"
|
string="Margin" groups="account.group_account_user"/>
|
||||||
string="Margin in Inv. Cur."
|
<field name="margin_company_currency"
|
||||||
groups="base.group_no_one"
|
groups="account.group_account_user"/>
|
||||||
/>
|
|
||||||
<field
|
|
||||||
name="margin_company_currency"
|
|
||||||
string="Margin in Comp. Cur."
|
|
||||||
groups="base.group_no_one"
|
|
||||||
/>
|
|
||||||
</field>
|
</field>
|
||||||
|
<xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='price_subtotal']" position="after">
|
||||||
|
<field name="standard_price_invoice_currency" groups="base.group_no_one" widget="monetary" options="{'currency_field': 'currency_id'}"/>
|
||||||
|
<field name="standard_price_company_currency" groups="base.group_no_one" widget="monetary" options="{'currency_field': 'company_currency_id'}"/>
|
||||||
|
<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"/>
|
||||||
|
<field name="company_currency_id" invisible="1"/>
|
||||||
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|||||||
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/__manifest__.py
Normal file
41
account_invoice_margin_report/__manifest__.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
account_invoice_transmit_method_street3/__init__.py
Normal file
1
account_invoice_transmit_method_street3/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
26
account_invoice_transmit_method_street3/__manifest__.py
Normal file
26
account_invoice_transmit_method_street3/__manifest__.py
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright 2018 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': 'partner_address_street3 / account_invoice_transmit_method compat.',
|
||||||
|
'version': '10.0.0.1.0',
|
||||||
|
'category': 'Partner',
|
||||||
|
'license': 'AGPL-3',
|
||||||
|
'summary': 'Compatibility between partner_address_street3 and account_invoice_transmit_method',
|
||||||
|
'description': """
|
||||||
|
Glue module between partner_address_street3 and account_invoice_transmit_method
|
||||||
|
===============================================================================
|
||||||
|
|
||||||
|
Stupid technical module to workaround an Odoo framework limitation about the inherit of the context attribute in a view.
|
||||||
|
""",
|
||||||
|
'author': 'Akretion',
|
||||||
|
'website': 'http://www.akretion.com',
|
||||||
|
'depends': ['partner_address_street3', 'account_invoice_transmit_method'],
|
||||||
|
'data': [
|
||||||
|
'partner_view.xml',
|
||||||
|
],
|
||||||
|
'installable': True,
|
||||||
|
'auto_install': True,
|
||||||
|
}
|
||||||
23
account_invoice_transmit_method_street3/partner_view.xml
Normal file
23
account_invoice_transmit_method_street3/partner_view.xml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 2018 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
|
||||||
|
<record id="view_partner_form" model="ir.ui.view">
|
||||||
|
<field name="name">Compatibility partner_address_street3 / account_invoice_transmit_method</field>
|
||||||
|
<field name="model">res.partner</field>
|
||||||
|
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||||
|
<field name="priority">1000</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="child_ids" position="attributes">
|
||||||
|
<attribute name="context">{'default_parent_id': active_id, 'default_street': street, 'default_street2': street2, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_supplier': supplier, 'default_customer': customer, 'default_lang': lang, 'default_customer_invoice_transmit_method_code': customer_invoice_transmit_method_code, 'default_supplier_invoice_transmit_method_code': supplier_invoice_transmit_method_code, 'default_street3': street3}</attribute>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
</odoo>
|
||||||
@@ -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 @@
|
|||||||
from . import models
|
|
||||||
from . import wizard
|
from . import wizard
|
||||||
|
|||||||
@@ -1,21 +1,37 @@
|
|||||||
# Copyright 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright 2018-2019 Camptocamp
|
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||||
|
# Copyright 2018 Camptocamp
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "Account Invoice Update Wizard",
|
'name': 'Account Invoice Update Wizard',
|
||||||
"version": "12.0.1.0.0",
|
'version': '8.0.1.0.0',
|
||||||
"category": "Accounting & Finance",
|
'category': 'Accounting & Finance',
|
||||||
"license": "AGPL-3",
|
'license': 'AGPL-3',
|
||||||
"summary": "Wizard to update non-legal fields of an open/paid invoice",
|
'summary': 'Wizard to update non-legal fields of an open/paid invoice',
|
||||||
"author": "Akretion",
|
'description': """
|
||||||
"website": "https://github.com/OCA/odoo-usability",
|
Account Invoice Update Wizard
|
||||||
"depends": [
|
=============================
|
||||||
"account",
|
|
||||||
|
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
|
||||||
|
|
||||||
|
""",
|
||||||
|
'author': 'Akretion',
|
||||||
|
'website': 'http://www.akretion.com',
|
||||||
|
'depends': ['account'],
|
||||||
|
'data': [
|
||||||
|
'wizard/account_invoice_update_view.xml',
|
||||||
|
'views/account_invoice.xml',
|
||||||
],
|
],
|
||||||
"data": [
|
'installable': True,
|
||||||
"wizard/account_invoice_update_view.xml",
|
|
||||||
"views/account_invoice.xml",
|
|
||||||
],
|
|
||||||
"installable": False,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
from . import account_invoice
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# Copyright 2019 Camptocamp
|
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
||||||
|
|
||||||
from odoo import models
|
|
||||||
|
|
||||||
|
|
||||||
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,61 +1,56 @@
|
|||||||
# Copyright 2018-2019 Camptocamp
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright 2018 Camptocamp
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
from odoo.tests.common import TransactionCase
|
||||||
from odoo.exceptions import UserError
|
from odoo.exceptions import UserError
|
||||||
from odoo.tests.common import SavepointCase
|
|
||||||
|
|
||||||
|
|
||||||
class TestAccountInvoiceUpdateWizard(SavepointCase):
|
class TestAccountInvoiceUpdateWizard(TransactionCase):
|
||||||
@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(
|
def setUp(self):
|
||||||
{
|
super(TestAccountInvoiceUpdateWizard, self).setUp()
|
||||||
"name": "Test invoice",
|
self.customer12 = self.env.ref('base.res_partner_12')
|
||||||
"partner_id": cls.customer12.id,
|
self.product16 = self.env.ref('product.product_product_16')
|
||||||
}
|
self.product24 = self.env.ref('product.product_product_24')
|
||||||
)
|
uom_unit = self.env.ref('product.product_uom_categ_unit')
|
||||||
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")
|
self.invoice1 = self.env['account.invoice'].create({
|
||||||
cls.aa2 = cls.env.ref("analytic.analytic_nebula")
|
'name': 'Test invoice',
|
||||||
cls.atag1 = cls.env.ref("analytic.tag_contract")
|
'partner_id': self.customer12.id,
|
||||||
cls.atag2 = cls.env["account.analytic.tag"].create(
|
})
|
||||||
{
|
self.inv_line1 = self.env['account.invoice.line'].create({
|
||||||
"name": "の",
|
'invoice_id': self.invoice1.id,
|
||||||
}
|
'name': "Line1",
|
||||||
)
|
'product_id': self.product16.id,
|
||||||
|
'product_uom_id': uom_unit.id,
|
||||||
|
'account_id': self.invoice1.account_id.id,
|
||||||
|
'price_unit': 42.0,
|
||||||
|
})
|
||||||
|
self.inv_line2 = self.env['account.invoice.line'].create({
|
||||||
|
'invoice_id': self.invoice1.id,
|
||||||
|
'name': "Line2",
|
||||||
|
'product_id': self.product24.id,
|
||||||
|
'product_uom_id': uom_unit.id,
|
||||||
|
'account_id': self.invoice1.account_id.id,
|
||||||
|
'price_unit': 1111.1,
|
||||||
|
})
|
||||||
|
|
||||||
def create_wizard(self, invoice):
|
self.aa1 = self.env.ref('analytic.analytic_partners_camp_to_camp')
|
||||||
res = self.invoice1.prepare_update_wizard()
|
self.aa2 = self.env.ref('analytic.analytic_nebula')
|
||||||
self.wiz = self.env["account.invoice.update"].browse(res["res_id"])
|
self.atag1 = self.env.ref('analytic.tag_contract')
|
||||||
|
self.atag2 = self.env['account.analytic.tag'].create({
|
||||||
|
'name': u'の',
|
||||||
|
})
|
||||||
|
|
||||||
|
def create_wizard(self):
|
||||||
|
UpdateWizard = self.env['account.invoice.update'].with_context(
|
||||||
|
active_model='account.invoice',
|
||||||
|
active_id=self.invoice1.id)
|
||||||
|
self.wiz = UpdateWizard.create({})
|
||||||
|
|
||||||
def test_add_analytic_account_line1(self):
|
def test_add_analytic_account_line1(self):
|
||||||
"""Add analytic account on an invoice line
|
""" Add analytic account on an invoice line
|
||||||
after the invoice has been approved.
|
after the invoice has been approved.
|
||||||
|
|
||||||
This will:
|
This will:
|
||||||
@@ -63,22 +58,20 @@ class TestAccountInvoiceUpdateWizard(SavepointCase):
|
|||||||
- create a new analytic line.
|
- create a new analytic line.
|
||||||
"""
|
"""
|
||||||
self.invoice1.action_invoice_open()
|
self.invoice1.action_invoice_open()
|
||||||
self.create_wizard(self.invoice1)
|
self.create_wizard()
|
||||||
|
|
||||||
wiz_line = self.wiz.line_ids.filtered(
|
wiz_line = self.wiz.line_ids.filtered(
|
||||||
lambda rec: rec.invoice_line_id == self.inv_line1
|
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||||
)
|
|
||||||
wiz_line.account_analytic_id = self.aa1
|
wiz_line.account_analytic_id = self.aa1
|
||||||
self.wiz.run()
|
self.wiz.run()
|
||||||
|
|
||||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||||
lambda rec: rec.product_id == self.product16
|
lambda rec: rec.product_id == self.product16)
|
||||||
)
|
|
||||||
self.assertEqual(related_ml.analytic_account_id, self.aa1)
|
self.assertEqual(related_ml.analytic_account_id, self.aa1)
|
||||||
self.assertEqual(related_ml.analytic_line_ids.account_id, self.aa1)
|
self.assertEqual(related_ml.analytic_line_ids.account_id, self.aa1)
|
||||||
|
|
||||||
def test_change_analytic_account_line1(self):
|
def test_change_analytic_account_line1(self):
|
||||||
"""Change analytic account on an invoice line
|
""" Change analytic account on an invoice line
|
||||||
after the invoice has been approved.
|
after the invoice has been approved.
|
||||||
|
|
||||||
This will:
|
This will:
|
||||||
@@ -87,22 +80,20 @@ class TestAccountInvoiceUpdateWizard(SavepointCase):
|
|||||||
self.inv_line1.account_analytic_id = self.aa2
|
self.inv_line1.account_analytic_id = self.aa2
|
||||||
|
|
||||||
self.invoice1.action_invoice_open()
|
self.invoice1.action_invoice_open()
|
||||||
self.create_wizard(self.invoice1)
|
self.create_wizard()
|
||||||
|
|
||||||
wiz_line = self.wiz.line_ids.filtered(
|
wiz_line = self.wiz.line_ids.filtered(
|
||||||
lambda rec: rec.invoice_line_id == self.inv_line1
|
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||||
)
|
|
||||||
wiz_line.account_analytic_id = self.aa1
|
wiz_line.account_analytic_id = self.aa1
|
||||||
self.wiz.run()
|
self.wiz.run()
|
||||||
|
|
||||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||||
lambda rec: rec.product_id == self.product16
|
lambda rec: rec.product_id == self.product16)
|
||||||
)
|
|
||||||
self.assertEqual(related_ml.analytic_account_id, self.aa1)
|
self.assertEqual(related_ml.analytic_account_id, self.aa1)
|
||||||
self.assertEqual(related_ml.analytic_line_ids.account_id, self.aa1)
|
self.assertEqual(related_ml.analytic_line_ids.account_id, self.aa1)
|
||||||
|
|
||||||
def test_error_grouped_move_lines(self):
|
def test_error_grouped_move_lines(self):
|
||||||
"""Change analytic account on an invoice line
|
""" Change analytic account on an invoice line
|
||||||
after the invoice has been approved where both
|
after the invoice has been approved where both
|
||||||
lines were grouped in the same move line.
|
lines were grouped in the same move line.
|
||||||
|
|
||||||
@@ -114,7 +105,7 @@ class TestAccountInvoiceUpdateWizard(SavepointCase):
|
|||||||
self.inv_line2.unit_price = 42.0
|
self.inv_line2.unit_price = 42.0
|
||||||
|
|
||||||
self.invoice1.action_invoice_open()
|
self.invoice1.action_invoice_open()
|
||||||
self.create_wizard(self.invoice1)
|
self.create_wizard()
|
||||||
|
|
||||||
line1 = self.wiz.line_ids[0]
|
line1 = self.wiz.line_ids[0]
|
||||||
line1.account_analytic_id = self.aa1
|
line1.account_analytic_id = self.aa1
|
||||||
@@ -122,28 +113,26 @@ class TestAccountInvoiceUpdateWizard(SavepointCase):
|
|||||||
self.wiz.run()
|
self.wiz.run()
|
||||||
|
|
||||||
def test_add_analytic_tags_line1(self):
|
def test_add_analytic_tags_line1(self):
|
||||||
"""Add analytic tags on an invoice line
|
""" Add analytic tags on an invoice line
|
||||||
after the invoice has been approved.
|
after the invoice has been approved.
|
||||||
|
|
||||||
This will update move line.
|
This will update move line.
|
||||||
"""
|
"""
|
||||||
self.invoice1.action_invoice_open()
|
self.invoice1.action_invoice_open()
|
||||||
self.create_wizard(self.invoice1)
|
self.create_wizard()
|
||||||
|
|
||||||
wiz_line = self.wiz.line_ids.filtered(
|
wiz_line = self.wiz.line_ids.filtered(
|
||||||
lambda rec: rec.invoice_line_id == self.inv_line1
|
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||||
)
|
|
||||||
wiz_line.analytic_tag_ids = self.atag2
|
wiz_line.analytic_tag_ids = self.atag2
|
||||||
self.wiz.run()
|
self.wiz.run()
|
||||||
|
|
||||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||||
lambda rec: rec.product_id == self.product16
|
lambda rec: rec.product_id == self.product16)
|
||||||
)
|
|
||||||
self.assertEqual(related_ml.analytic_tag_ids, self.atag2)
|
self.assertEqual(related_ml.analytic_tag_ids, self.atag2)
|
||||||
self.assertFalse(related_ml.analytic_line_ids)
|
self.assertFalse(related_ml.analytic_line_ids)
|
||||||
|
|
||||||
def test_change_analytic_tags_line1(self):
|
def test_change_analytic_tags_line1(self):
|
||||||
"""Change analytic tags on an invoice line
|
""" Change analytic tags on an invoice line
|
||||||
after the invoice has been approved.
|
after the invoice has been approved.
|
||||||
|
|
||||||
It will update move line and analytic line
|
It will update move line and analytic line
|
||||||
@@ -152,22 +141,20 @@ class TestAccountInvoiceUpdateWizard(SavepointCase):
|
|||||||
self.inv_line1.analytic_tag_ids = self.atag1
|
self.inv_line1.analytic_tag_ids = self.atag1
|
||||||
|
|
||||||
self.invoice1.action_invoice_open()
|
self.invoice1.action_invoice_open()
|
||||||
self.create_wizard(self.invoice1)
|
self.create_wizard()
|
||||||
|
|
||||||
wiz_line = self.wiz.line_ids.filtered(
|
wiz_line = self.wiz.line_ids.filtered(
|
||||||
lambda rec: rec.invoice_line_id == self.inv_line1
|
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||||
)
|
|
||||||
wiz_line.analytic_tag_ids = self.atag2
|
wiz_line.analytic_tag_ids = self.atag2
|
||||||
self.wiz.run()
|
self.wiz.run()
|
||||||
|
|
||||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||||
lambda rec: rec.product_id == self.product16
|
lambda rec: rec.product_id == self.product16)
|
||||||
)
|
|
||||||
self.assertEqual(related_ml.analytic_tag_ids, self.atag2)
|
self.assertEqual(related_ml.analytic_tag_ids, self.atag2)
|
||||||
self.assertEqual(related_ml.analytic_line_ids.tag_ids, self.atag2)
|
self.assertEqual(related_ml.analytic_line_ids.tag_ids, self.atag2)
|
||||||
|
|
||||||
def test_add_analytic_info_line1(self):
|
def test_add_analytic_info_line1(self):
|
||||||
"""Add analytic account and tags on an invoice line
|
""" Add analytic account and tags on an invoice line
|
||||||
after the invoice has been approved.
|
after the invoice has been approved.
|
||||||
|
|
||||||
This will:
|
This will:
|
||||||
@@ -175,25 +162,23 @@ class TestAccountInvoiceUpdateWizard(SavepointCase):
|
|||||||
- create an analytic line
|
- create an analytic line
|
||||||
"""
|
"""
|
||||||
self.invoice1.action_invoice_open()
|
self.invoice1.action_invoice_open()
|
||||||
self.create_wizard(self.invoice1)
|
self.create_wizard()
|
||||||
|
|
||||||
wiz_line = self.wiz.line_ids.filtered(
|
wiz_line = self.wiz.line_ids.filtered(
|
||||||
lambda rec: rec.invoice_line_id == self.inv_line1
|
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||||
)
|
|
||||||
wiz_line.account_analytic_id = self.aa1
|
wiz_line.account_analytic_id = self.aa1
|
||||||
wiz_line.analytic_tag_ids = self.atag2
|
wiz_line.analytic_tag_ids = self.atag2
|
||||||
self.wiz.run()
|
self.wiz.run()
|
||||||
|
|
||||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||||
lambda rec: rec.product_id == self.product16
|
lambda rec: rec.product_id == self.product16)
|
||||||
)
|
|
||||||
self.assertEqual(related_ml.analytic_account_id, self.aa1)
|
self.assertEqual(related_ml.analytic_account_id, self.aa1)
|
||||||
self.assertEqual(related_ml.analytic_tag_ids, self.atag2)
|
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.account_id, self.aa1)
|
||||||
self.assertEqual(related_ml.analytic_line_ids.tag_ids, self.atag2)
|
self.assertEqual(related_ml.analytic_line_ids.tag_ids, self.atag2)
|
||||||
|
|
||||||
def test_empty_analytic_account_line1(self):
|
def test_empty_analytic_account_line1(self):
|
||||||
"""Remove analytic account
|
""" Remove analytic account
|
||||||
after the invoice has been approved.
|
after the invoice has been approved.
|
||||||
|
|
||||||
This will raise an error as it is not implemented.
|
This will raise an error as it is not implemented.
|
||||||
@@ -201,15 +186,13 @@ class TestAccountInvoiceUpdateWizard(SavepointCase):
|
|||||||
self.inv_line1.account_analytic_id = self.aa2
|
self.inv_line1.account_analytic_id = self.aa2
|
||||||
|
|
||||||
self.invoice1.action_invoice_open()
|
self.invoice1.action_invoice_open()
|
||||||
self.create_wizard(self.invoice1)
|
self.create_wizard()
|
||||||
|
|
||||||
wiz_line = self.wiz.line_ids.filtered(
|
wiz_line = self.wiz.line_ids.filtered(
|
||||||
lambda rec: rec.invoice_line_id == self.inv_line1
|
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||||
)
|
|
||||||
wiz_line.account_analytic_id = False
|
wiz_line.account_analytic_id = False
|
||||||
self.wiz.run()
|
self.wiz.run()
|
||||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||||
lambda rec: rec.product_id == self.product16
|
lambda rec: rec.product_id == self.product16)
|
||||||
)
|
|
||||||
self.assertFalse(related_ml.analytic_account_id)
|
self.assertFalse(related_ml.analytic_account_id)
|
||||||
self.assertFalse(related_ml.analytic_line_ids)
|
self.assertFalse(related_ml.analytic_line_ids)
|
||||||
|
|||||||
@@ -1,38 +1,27 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?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).
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<record id="invoice_supplier_form" model="ir.ui.view">
|
<record id="invoice_supplier_form" model="ir.ui.view">
|
||||||
<field name="model">account.invoice</field>
|
<field name="model">account.invoice</field>
|
||||||
<field name="inherit_id" ref="account.invoice_supplier_form" />
|
<field name="inherit_id" ref="account.invoice_supplier_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<button name="action_invoice_draft" position="before">
|
<button name="action_invoice_cancel" position="before">
|
||||||
<button
|
<button name="%(account_invoice_update_action)d" type="action" string="Update Invoice" states="open,paid" groups="account.group_account_invoice"/>
|
||||||
name="prepare_update_wizard"
|
|
||||||
type="object"
|
|
||||||
string="Update Invoice"
|
|
||||||
states="open,paid"
|
|
||||||
groups="account.group_account_invoice"
|
|
||||||
/>
|
|
||||||
</button>
|
</button>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="invoice_form" model="ir.ui.view">
|
<record id="invoice_form" model="ir.ui.view">
|
||||||
<field name="model">account.invoice</field>
|
<field name="model">account.invoice</field>
|
||||||
<field name="inherit_id" ref="account.invoice_form" />
|
<field name="inherit_id" ref="account.invoice_form"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<button name="action_invoice_draft" position="before">
|
<button name="action_invoice_cancel" position="before">
|
||||||
<button
|
<button name="%(account_invoice_update_action)d" type="action" string="Update Invoice" states="open,paid" groups="account.group_account_invoice"/>
|
||||||
name="prepare_update_wizard"
|
|
||||||
type="object"
|
|
||||||
string="Update Invoice"
|
|
||||||
states="open,paid"
|
|
||||||
groups="account.group_account_invoice"
|
|
||||||
/>
|
|
||||||
</button>
|
</button>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -1,46 +1,49 @@
|
|||||||
# Copyright 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright 2018-2019 Camptocamp
|
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||||
|
# Copyright 2018 Camptocamp
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo import _, api, fields, models
|
from odoo import models, fields, api, _
|
||||||
from odoo.exceptions import UserError
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
import odoo.addons.decimal_precision as dp
|
import odoo.addons.decimal_precision as dp
|
||||||
|
|
||||||
|
|
||||||
class AccountInvoiceUpdate(models.TransientModel):
|
class AccountInvoiceUpdate(models.TransientModel):
|
||||||
_name = "account.invoice.update"
|
_name = 'account.invoice.update'
|
||||||
_description = "Wizard to update non-legal fields of invoice"
|
_description = 'Wizard to update non-legal fields of invoice'
|
||||||
|
|
||||||
invoice_id = fields.Many2one(
|
invoice_id = fields.Many2one(
|
||||||
"account.invoice", string="Invoice", required=True, readonly=True
|
'account.invoice', string='Invoice', required=True,
|
||||||
)
|
readonly=True)
|
||||||
type = fields.Selection(related="invoice_id.type", readonly=True)
|
type = fields.Selection(related='invoice_id.type', readonly=True)
|
||||||
company_id = fields.Many2one(related="invoice_id.company_id", readonly=True)
|
company_id = fields.Many2one(
|
||||||
partner_id = fields.Many2one(related="invoice_id.partner_id", readonly=True)
|
related='invoice_id.company_id', readonly=True)
|
||||||
user_id = fields.Many2one("res.users", string="Salesperson")
|
partner_id = fields.Many2one(
|
||||||
payment_term_id = fields.Many2one("account.payment.term", string="Payment Term")
|
related='invoice_id.partner_id', readonly=True)
|
||||||
reference = fields.Char(string="Invoice Reference")
|
user_id = fields.Many2one('res.users', string='Salesperson')
|
||||||
name = fields.Char(string="Reference/Description")
|
payment_term_id = fields.Many2one(
|
||||||
origin = fields.Char(string="Source Document")
|
'account.payment.term', string='Payment Term')
|
||||||
comment = fields.Text("Additional Information")
|
reference = fields.Char(string='Invoice Reference')
|
||||||
partner_bank_id = fields.Many2one("res.partner.bank", string="Bank Account")
|
name = fields.Char(string='Reference/Description')
|
||||||
|
origin = fields.Char(string='Source Document')
|
||||||
|
comment = fields.Text('Additional Information')
|
||||||
|
partner_bank_id = fields.Many2one(
|
||||||
|
'res.partner.bank', string='Bank Account')
|
||||||
line_ids = fields.One2many(
|
line_ids = fields.One2many(
|
||||||
"account.invoice.line.update", "parent_id", string="Invoice Lines"
|
'account.invoice.line.update', 'parent_id', string='Invoice Lines')
|
||||||
)
|
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _simple_fields2update(self):
|
def _simple_fields2update(self):
|
||||||
"""List boolean, date, datetime, char, text fields"""
|
'''List boolean, date, datetime, char, text fields'''
|
||||||
return ["reference", "name", "origin", "comment"]
|
return ['reference', 'name', 'origin', 'comment']
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _m2o_fields2update(self):
|
def _m2o_fields2update(self):
|
||||||
return ["payment_term_id", "user_id", "partner_bank_id"]
|
return ['payment_term_id', 'user_id', 'partner_bank_id']
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _prepare_default_get(self, invoice):
|
def _prepare_default_get(self, invoice):
|
||||||
res = {"invoice_id": invoice.id, "line_ids": []}
|
res = {'invoice_id': invoice.id, 'line_ids': []}
|
||||||
for sfield in self._simple_fields2update():
|
for sfield in self._simple_fields2update():
|
||||||
res[sfield] = invoice[sfield]
|
res[sfield] = invoice[sfield]
|
||||||
for m2ofield in self._m2o_fields2update():
|
for m2ofield in self._m2o_fields2update():
|
||||||
@@ -48,32 +51,34 @@ class AccountInvoiceUpdate(models.TransientModel):
|
|||||||
for line in invoice.invoice_line_ids:
|
for line in invoice.invoice_line_ids:
|
||||||
aa_tags = line.analytic_tag_ids
|
aa_tags = line.analytic_tag_ids
|
||||||
aa_tags = [(6, 0, aa_tags.ids)] if aa_tags else False
|
aa_tags = [(6, 0, aa_tags.ids)] if aa_tags else False
|
||||||
res["line_ids"].append(
|
res['line_ids'].append([0, 0, {
|
||||||
[
|
'invoice_line_id': line.id,
|
||||||
0,
|
'name': line.name,
|
||||||
0,
|
'quantity': line.quantity,
|
||||||
{
|
'price_subtotal': line.price_subtotal,
|
||||||
"invoice_line_id": line.id,
|
'account_analytic_id': line.account_analytic_id.id,
|
||||||
"name": line.name,
|
'analytic_tag_ids': aa_tags,
|
||||||
"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
|
return res
|
||||||
|
|
||||||
@api.onchange("type")
|
@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')
|
||||||
def type_on_change(self):
|
def type_on_change(self):
|
||||||
res = {"domain": {}}
|
res = {'domain': {}}
|
||||||
if self.type in ("out_invoice", "out_refund"):
|
if self.type in ('out_invoice', 'out_refund'):
|
||||||
res["domain"][
|
res['domain']['partner_bank_id'] =\
|
||||||
"partner_bank_id"
|
"[('partner_id.ref_company_ids', 'in', [company_id])]"
|
||||||
] = "[('partner_id.ref_company_ids', 'in', [company_id])]"
|
|
||||||
else:
|
else:
|
||||||
res["domain"]["partner_bank_id"] = "[('partner_id', '=', partner_id)]"
|
res['domain']['partner_bank_id'] =\
|
||||||
|
"[('partner_id', '=', partner_id)]"
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@@ -86,31 +91,24 @@ class AccountInvoiceUpdate(models.TransientModel):
|
|||||||
for m2ofield in self._m2o_fields2update():
|
for m2ofield in self._m2o_fields2update():
|
||||||
if self[m2ofield] != inv[m2ofield]:
|
if self[m2ofield] != inv[m2ofield]:
|
||||||
vals[m2ofield] = self[m2ofield].id or False
|
vals[m2ofield] = self[m2ofield].id or False
|
||||||
if "payment_term_id" in vals:
|
if 'payment_term_id' in vals:
|
||||||
pterm_list = self.payment_term_id.compute(
|
pterm_list = self.payment_term_id.compute(
|
||||||
value=1, date_ref=inv.date_invoice
|
value=1, date_ref=inv.date_invoice)[0]
|
||||||
)[0]
|
|
||||||
if pterm_list:
|
if pterm_list:
|
||||||
vals["date_due"] = max(line[0] for line in pterm_list)
|
vals['date_due'] = max(line[0] for line in pterm_list)
|
||||||
return vals
|
return vals
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _line_simple_fields2update(self):
|
def _line_simple_fields2update(self):
|
||||||
return [
|
return ["name",]
|
||||||
"name",
|
|
||||||
]
|
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _line_m2o_fields2update(self):
|
def _line_m2o_fields2update(self):
|
||||||
return [
|
return ["account_analytic_id",]
|
||||||
"account_analytic_id",
|
|
||||||
]
|
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _line_m2m_fields2update(self):
|
def _line_m2m_fields2update(self):
|
||||||
return [
|
return ["analytic_tag_ids",]
|
||||||
"analytic_tag_ids",
|
|
||||||
]
|
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _prepare_invoice_line(self, line):
|
def _prepare_invoice_line(self, line):
|
||||||
@@ -133,7 +131,7 @@ class AccountInvoiceUpdate(models.TransientModel):
|
|||||||
ini_ref = inv.move_id.ref
|
ini_ref = inv.move_id.ref
|
||||||
ref = inv.reference or inv.name
|
ref = inv.reference or inv.name
|
||||||
if ini_ref != ref:
|
if ini_ref != ref:
|
||||||
mvals["ref"] = ref
|
mvals['ref'] = ref
|
||||||
return mvals
|
return mvals
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@@ -142,52 +140,49 @@ class AccountInvoiceUpdate(models.TransientModel):
|
|||||||
# TODO make it accept more case as lines won't
|
# TODO make it accept more case as lines won't
|
||||||
# be grouped unless journal.group_invoice_line is True
|
# be grouped unless journal.group_invoice_line is True
|
||||||
inv_line = self.invoice_id.invoice_line_ids.filtered(
|
inv_line = self.invoice_id.invoice_line_ids.filtered(
|
||||||
lambda rec: rec.product_id == move_line.product_id
|
lambda rec: rec.product_id == move_line.product_id)
|
||||||
)
|
if len(inv_line) <> 1:
|
||||||
if len(inv_line) != 1:
|
|
||||||
raise UserError(
|
raise UserError(
|
||||||
"Cannot match a single invoice line to move line %s" % move_line.name
|
"Cannot match a single invoice line to move line %s" %
|
||||||
)
|
move_line.name)
|
||||||
return inv_line
|
return inv_line
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def _prepare_move_line(self, inv_line):
|
def _prepare_move_line(self, inv_line):
|
||||||
mlvals = {}
|
mlvals = {}
|
||||||
inv_line_upd = self.line_ids.filtered(
|
inv_line_upd = self.line_ids.filtered(
|
||||||
lambda rec: rec.invoice_line_id == inv_line
|
lambda rec: rec.invoice_line_id == inv_line)
|
||||||
)
|
|
||||||
|
|
||||||
ini_aa = inv_line.account_analytic_id
|
ini_aa = inv_line.account_analytic_id
|
||||||
new_aa = inv_line_upd.account_analytic_id
|
new_aa = inv_line_upd.account_analytic_id
|
||||||
|
|
||||||
if ini_aa != new_aa:
|
if ini_aa != new_aa:
|
||||||
mlvals["analytic_account_id"] = new_aa.id
|
mlvals['analytic_account_id'] = new_aa.id
|
||||||
|
|
||||||
ini_aa_tags = inv_line.analytic_tag_ids
|
ini_aa_tags = inv_line.analytic_tag_ids
|
||||||
new_aa_tags = inv_line_upd.analytic_tag_ids
|
new_aa_tags = inv_line_upd.analytic_tag_ids
|
||||||
|
|
||||||
if ini_aa_tags != new_aa_tags:
|
if ini_aa_tags != new_aa_tags:
|
||||||
mlvals["analytic_tag_ids"] = [(6, None, new_aa_tags.ids)]
|
mlvals['analytic_tag_ids'] = [(6, None, new_aa_tags.ids)]
|
||||||
return mlvals
|
return mlvals
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def _prepare_analytic_line(self, inv_line):
|
def _prepare_analytic_line(self, inv_line):
|
||||||
alvals = {}
|
alvals = {}
|
||||||
inv_line_upd = self.line_ids.filtered(
|
inv_line_upd = self.line_ids.filtered(
|
||||||
lambda rec: rec.invoice_line_id == inv_line
|
lambda rec: rec.invoice_line_id == inv_line)
|
||||||
)
|
|
||||||
|
|
||||||
ini_aa = inv_line.account_analytic_id
|
ini_aa = inv_line.account_analytic_id
|
||||||
new_aa = inv_line_upd.account_analytic_id
|
new_aa = inv_line_upd.account_analytic_id
|
||||||
|
|
||||||
if ini_aa != new_aa:
|
if ini_aa != new_aa:
|
||||||
alvals["account_id"] = new_aa.id
|
alvals['account_id'] = new_aa.id
|
||||||
|
|
||||||
ini_aa_tags = inv_line.analytic_tag_ids
|
ini_aa_tags = inv_line.analytic_tag_ids
|
||||||
new_aa_tags = inv_line_upd.analytic_tag_ids
|
new_aa_tags = inv_line_upd.analytic_tag_ids
|
||||||
|
|
||||||
if ini_aa_tags != new_aa_tags:
|
if ini_aa_tags != new_aa_tags:
|
||||||
alvals["tag_ids"] = [(6, None, new_aa_tags.ids)]
|
alvals['tag_ids'] = [(6, None, new_aa_tags.ids)]
|
||||||
return alvals
|
return alvals
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@@ -195,27 +190,22 @@ class AccountInvoiceUpdate(models.TransientModel):
|
|||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
inv = self.invoice_id
|
inv = self.invoice_id
|
||||||
if (
|
if (
|
||||||
self.payment_term_id
|
self.payment_term_id and
|
||||||
and self.payment_term_id != inv.payment_term_id
|
self.payment_term_id != inv.payment_term_id and
|
||||||
and inv.move_id
|
inv.move_id):
|
||||||
):
|
|
||||||
# I don't update pay term when the invoice is partially (or fully)
|
# I don't update pay term when the invoice is partially (or fully)
|
||||||
# paid because if you have a payment term with several lines
|
# paid because if you have a payment term with several lines
|
||||||
# of the same amount, you would also have to take into account
|
# of the same amount, you would also have to take into account
|
||||||
# the reconcile marks to put the new maturity date on the right
|
# the reconcile marks to put the new maturity date on the right
|
||||||
# lines
|
# lines
|
||||||
if inv.payment_ids:
|
if inv.payment_ids:
|
||||||
raise UserError(
|
raise UserError(_(
|
||||||
_(
|
|
||||||
"This wizard doesn't support the update of payment "
|
"This wizard doesn't support the update of payment "
|
||||||
"terms on an invoice which is partially or fully "
|
"terms on an invoice which is partially or fully "
|
||||||
"paid."
|
"paid."))
|
||||||
)
|
prec = self.env['decimal.precision'].precision_get('Account')
|
||||||
)
|
term_res = self.payment_term_id.compute(
|
||||||
prec = self.env["decimal.precision"].precision_get("Account")
|
inv.amount_total, inv.date_invoice)[0]
|
||||||
term_res = self.payment_term_id.compute(inv.amount_total, inv.date_invoice)[
|
|
||||||
0
|
|
||||||
]
|
|
||||||
new_pterm = {} # key = int(amount * 100), value = [date1, date2]
|
new_pterm = {} # key = int(amount * 100), value = [date1, date2]
|
||||||
for entry in term_res:
|
for entry in term_res:
|
||||||
amount = int(entry[1] * 10 * prec)
|
amount = int(entry[1] * 10 * prec)
|
||||||
@@ -231,18 +221,15 @@ class AccountInvoiceUpdate(models.TransientModel):
|
|||||||
mlines[amount].append(line)
|
mlines[amount].append(line)
|
||||||
else:
|
else:
|
||||||
mlines[amount] = [line]
|
mlines[amount] = [line]
|
||||||
for iamount, lines in mlines.items():
|
for iamount, lines in mlines.iteritems():
|
||||||
if len(lines) != len(new_pterm.get(iamount, [])):
|
if len(lines) != len(new_pterm.get(iamount, [])):
|
||||||
raise UserError(
|
raise UserError(_(
|
||||||
_(
|
|
||||||
"The original payment term '%s' doesn't have the "
|
"The original payment term '%s' doesn't have the "
|
||||||
"same terms (number of terms and/or amount) as the "
|
"same terms (number of terms and/or amount) as the "
|
||||||
"new payment term '%s'. You can only switch to a "
|
"new payment term '%s'. You can only switch to a "
|
||||||
"payment term that has the same number of terms "
|
"payment term that has the same number of terms "
|
||||||
"with the same amount."
|
"with the same amount.") % (
|
||||||
)
|
inv.payment_term_id.name, self.payment_term_id.name))
|
||||||
% (inv.payment_term_id.name, self.payment_term_id.name)
|
|
||||||
)
|
|
||||||
for line in lines:
|
for line in lines:
|
||||||
line.date_maturity = new_pterm[iamount].pop()
|
line.date_maturity = new_pterm[iamount].pop()
|
||||||
|
|
||||||
@@ -276,16 +263,16 @@ class AccountInvoiceUpdate(models.TransientModel):
|
|||||||
alvals = self._prepare_analytic_line(inv_line)
|
alvals = self._prepare_analytic_line(inv_line)
|
||||||
if aalines and alvals:
|
if aalines and alvals:
|
||||||
updated = True
|
updated = True
|
||||||
if "account_id" in alvals and alvals["account_id"] is False:
|
if ('account_id' in alvals and
|
||||||
|
alvals['account_id'] is False):
|
||||||
former_aa = inv_line.account_analytic_id
|
former_aa = inv_line.account_analytic_id
|
||||||
to_remove_aalines = aalines.filtered(
|
to_remove_aalines = aalines.filtered(
|
||||||
lambda rec: rec.account_id == former_aa
|
lambda rec: rec.account_id == former_aa)
|
||||||
)
|
|
||||||
# remove existing analytic line
|
# remove existing analytic line
|
||||||
to_remove_aalines.unlink()
|
to_remove_aalines.unlink()
|
||||||
else:
|
else:
|
||||||
aalines.write(alvals)
|
aalines.write(alvals)
|
||||||
elif "account_id" in alvals:
|
elif 'account_id' in alvals:
|
||||||
# Create analytic lines if analytic account
|
# Create analytic lines if analytic account
|
||||||
# is added later
|
# is added later
|
||||||
ml.create_analytic_lines()
|
ml.create_analytic_lines()
|
||||||
@@ -295,40 +282,27 @@ class AccountInvoiceUpdate(models.TransientModel):
|
|||||||
updated = True
|
updated = True
|
||||||
line.invoice_line_id.write(ilvals)
|
line.invoice_line_id.write(ilvals)
|
||||||
if updated:
|
if updated:
|
||||||
inv.message_post(
|
inv.message_post(_(
|
||||||
body=_(
|
'Non-legal fields of invoice updated via the Invoice Update '
|
||||||
"Non-legal fields of invoice updated via the Invoice Update "
|
'wizard.'))
|
||||||
"wizard."
|
|
||||||
)
|
|
||||||
)
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
class AccountInvoiceLineUpdate(models.TransientModel):
|
class AccountInvoiceLineUpdate(models.TransientModel):
|
||||||
_name = "account.invoice.line.update"
|
_name = 'account.invoice.line.update'
|
||||||
_description = "Update non-legal fields of invoice lines"
|
_description = 'Update non-legal fields of invoice lines'
|
||||||
|
|
||||||
parent_id = fields.Many2one(
|
parent_id = fields.Many2one(
|
||||||
"account.invoice.update", string="Wizard", ondelete="cascade"
|
'account.invoice.update', string='Wizard', ondelete='cascade')
|
||||||
)
|
|
||||||
invoice_line_id = fields.Many2one(
|
invoice_line_id = fields.Many2one(
|
||||||
"account.invoice.line", string="Invoice Line", readonly=True
|
'account.invoice.line', string='Invoice Line', readonly=True)
|
||||||
)
|
name = fields.Text(string='Description', required=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(
|
quantity = fields.Float(
|
||||||
string="Quantity",
|
string='Quantity', digits=dp.get_precision('Product Unit of Measure'),
|
||||||
digits=dp.get_precision("Product Unit of Measure"),
|
readonly=True)
|
||||||
readonly=True,
|
|
||||||
)
|
|
||||||
price_subtotal = fields.Float(
|
price_subtotal = fields.Float(
|
||||||
string="Amount", readonly=True, digits=dp.get_precision("Account")
|
string='Amount', readonly=True, digits=dp.get_precision('Account'))
|
||||||
)
|
|
||||||
account_analytic_id = fields.Many2one(
|
account_analytic_id = fields.Many2one(
|
||||||
"account.analytic.account", string="Analytic Account"
|
'account.analytic.account', string='Analytic Account')
|
||||||
)
|
analytic_tag_ids = fields.Many2many(
|
||||||
analytic_tag_ids = fields.Many2many("account.analytic.tag", string="Analytic Tags")
|
'account.analytic.tag', string='Analytic Tags')
|
||||||
|
|||||||
@@ -1,81 +1,53 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
© 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).
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<record id="account_invoice_update_form" model="ir.ui.view">
|
<record id="account_invoice_update_form" model="ir.ui.view">
|
||||||
<field name="model">account.invoice.update</field>
|
<field name="model">account.invoice.update</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Update Invoice Wizard">
|
<form string="Update Invoice Wizard">
|
||||||
<group name="main">
|
<group name="main">
|
||||||
<field name="invoice_id" invisible="1" />
|
<field name="invoice_id" invisible="1"/>
|
||||||
<field name="type" invisible="1" />
|
<field name="type" invisible="1"/>
|
||||||
<field name="company_id" invisible="1" />
|
<field name="company_id" invisible="1"/>
|
||||||
<field name="partner_id" invisible="1" />
|
<field name="partner_id" invisible="1"/>
|
||||||
<field
|
<field name="reference" attrs="{'invisible': [('type', 'not in', ('in_invoice', 'in_refund'))]}"/>
|
||||||
name="reference"
|
<field name="origin"/>
|
||||||
attrs="{'invisible': [('type', 'not in', ('in_invoice', 'in_refund'))]}"
|
<field name="name"/>
|
||||||
/>
|
<field name="payment_term_id" widget="selection"/>
|
||||||
<field name="origin" />
|
<field name="partner_bank_id"/>
|
||||||
<field name="name" />
|
<field name="user_id"/>
|
||||||
<field name="payment_term_id" widget="selection" />
|
<field name="comment"/>
|
||||||
<field name="partner_bank_id" />
|
|
||||||
<field name="user_id" />
|
|
||||||
<field name="comment" />
|
|
||||||
</group>
|
</group>
|
||||||
<group name="lines">
|
<group name="lines">
|
||||||
<field name="line_ids" nolabel="1">
|
<field name="line_ids" nolabel="1">
|
||||||
<tree
|
<tree editable="bottom">
|
||||||
editable="bottom"
|
<field name="invoice_line_id" invisible="1"/>
|
||||||
create="false"
|
<field name="name"/>
|
||||||
delete="false"
|
<field name="quantity"/>
|
||||||
edit="true"
|
<field name="price_subtotal"/>
|
||||||
>
|
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||||
<field name="invoice_line_id" invisible="1" />
|
<field name="analytic_tag_ids" groups="analytic.group_analytic_accounting" widget="many2many_tags"/>
|
||||||
<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"
|
|
||||||
/>
|
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</group>
|
</group>
|
||||||
<footer>
|
<footer>
|
||||||
<button
|
<button name="run" type="object" class="oe_highlight" string="Update"/>
|
||||||
name="run"
|
<button special="cancel" string="Cancel" class="oe_link"/>
|
||||||
type="object"
|
|
||||||
class="oe_highlight"
|
|
||||||
string="Update"
|
|
||||||
/>
|
|
||||||
<button special="cancel" string="Cancel" class="oe_link" />
|
|
||||||
</footer>
|
</footer>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="account_invoice_update_action" model="ir.actions.act_window">
|
<record id="account_invoice_update_action" model="ir.actions.act_window">
|
||||||
<field name="name">Invoice Update Wizard</field>
|
<field name="name">Invoice Update Wizard</field>
|
||||||
<field name="res_model">account.invoice.update</field>
|
<field name="res_model">account.invoice.update</field>
|
||||||
<field name="view_mode">form</field>
|
<field name="view_mode">form</field>
|
||||||
<field name="target">new</field>
|
<field name="target">new</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
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
|
||||||
25
account_move_line_filter_wizard/__manifest__.py
Normal file
25
account_move_line_filter_wizard/__manifest__.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright (C) 2016-2018 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 Move Line Filter Wizard',
|
||||||
|
'version': '10.0.1.0.0',
|
||||||
|
'category': 'Accounting',
|
||||||
|
'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': True,
|
||||||
|
}
|
||||||
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,46 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright 2016-2018 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).
|
||||||
|
|
||||||
|
from odoo 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=[('deprecated', '=', False)], required=True)
|
||||||
|
account_reconcile = fields.Boolean(
|
||||||
|
related='account_id.reconcile', readonly=True)
|
||||||
|
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.id
|
||||||
|
else:
|
||||||
|
self.account_id =\
|
||||||
|
self.partner_id.property_account_payable_id.id
|
||||||
|
|
||||||
|
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]}
|
||||||
|
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,44 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2016-2018 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).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<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="btn-primary"/>
|
||||||
|
<button special="cancel" string="Cancel" class="btn-default"/>
|
||||||
|
</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"/>
|
||||||
|
|
||||||
|
|
||||||
|
</odoo>
|
||||||
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/__manifest__.py
Normal file
44
account_move_line_start_end_dates_xls/__manifest__.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,
|
||||||
|
}
|
||||||
66
account_move_line_start_end_dates_xls/account_move_line.py
Normal file
66
account_move_line_start_end_dates_xls/account_move_line.py
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
# -*- 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
|
||||||
|
from openerp import models, api
|
||||||
|
from openerp.addons.report_xls.utils import _render
|
||||||
|
from openerp.addons.report_xls.report_xls import report_xls
|
||||||
|
|
||||||
|
|
||||||
|
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 |
1
account_no_analytic_tags/__init__.py
Normal file
1
account_no_analytic_tags/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
25
account_no_analytic_tags/__manifest__.py
Normal file
25
account_no_analytic_tags/__manifest__.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 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).
|
||||||
|
|
||||||
|
{
|
||||||
|
'name': 'Account No Analytic Tags',
|
||||||
|
'version': '10.0.1.0.0',
|
||||||
|
'category': 'Accounting & Finance',
|
||||||
|
'license': 'AGPL-3',
|
||||||
|
'summary': 'No Analytic Tags in Accounting',
|
||||||
|
'description': """
|
||||||
|
Account No Analytic Tags
|
||||||
|
========================
|
||||||
|
|
||||||
|
This module hides analytic tags on invoices and 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'],
|
||||||
|
'data': ['account_view.xml'],
|
||||||
|
'installable': True,
|
||||||
|
}
|
||||||
46
account_no_analytic_tags/account_view.xml
Normal file
46
account_no_analytic_tags/account_view.xml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
© 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).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<!-- INVOICE -->
|
||||||
|
<record id="invoice_supplier_form" model="ir.ui.view">
|
||||||
|
<field name="name">account_no_analytic_tags.supplier.invoice.form</field>
|
||||||
|
<field name="model">account.invoice</field>
|
||||||
|
<field name="inherit_id" ref="account.invoice_supplier_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='analytic_tag_ids']" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="invoice_form" model="ir.ui.view">
|
||||||
|
<field name="name">account_no_analytic_tags.invoice.form</field>
|
||||||
|
<field name="model">account.invoice</field>
|
||||||
|
<field name="inherit_id" ref="account.invoice_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='analytic_tag_ids']" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- ACCOUNT MOVE LINE -->
|
||||||
|
<record id="view_move_line_form" model="ir.ui.view">
|
||||||
|
<field name="name">account_no_analytic_tags.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">
|
||||||
|
<field name="analytic_tag_ids" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
</odoo>
|
||||||
@@ -1,96 +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
|
|
||||||
|
|
||||||
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,5 @@
|
|||||||
from . import models
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from . import account
|
||||||
|
from . import partner
|
||||||
from . import wizard
|
from . import wizard
|
||||||
|
|||||||
@@ -1,38 +1,45 @@
|
|||||||
# Copyright 2015-2020 Akretion (http://www.akretion.com)
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2015-2016 Akretion (http://www.akretion.com)
|
||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "Account Usability",
|
'name': 'Account Usability',
|
||||||
"version": "14.0.1.0.0",
|
'version': '10.0.1.0.0',
|
||||||
"category": "Accounting & Finance",
|
'category': 'Accounting & Finance',
|
||||||
"license": "AGPL-3",
|
'license': 'AGPL-3',
|
||||||
"summary": "Small usability enhancements in account module",
|
'summary': 'Small usability enhancements in account module',
|
||||||
"author": "Akretion",
|
'description': """
|
||||||
"website": "https://github.com/OCA/odoo-usability",
|
Account Usability
|
||||||
"depends": [
|
=================
|
||||||
"account",
|
|
||||||
"base_view_inheritance_extension",
|
The usability enhancements include:
|
||||||
"base_usability", # needed only to access base_usability.group_nobody
|
* 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',
|
||||||
|
'base_usability', # needed only to access base_usability.group_nobody
|
||||||
# in v12, I may create a module only for group_nobody
|
# in v12, I may create a module only for group_nobody
|
||||||
],
|
],
|
||||||
"data": [
|
'data': [
|
||||||
"views/account_account_type.xml",
|
'account_view.xml',
|
||||||
"views/account_account.xml",
|
'account_report.xml',
|
||||||
"views/account_bank_statement.xml",
|
'partner_view.xml',
|
||||||
"views/account_invoice_report.xml",
|
'product_view.xml',
|
||||||
"views/account_journal.xml",
|
'wizard/account_invoice_mark_sent_view.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/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",
|
|
||||||
],
|
],
|
||||||
"installable": True,
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
472
account_usability/account.py
Normal file
472
account_usability/account.py
Normal file
@@ -0,0 +1,472 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# © 2015-2016 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).
|
||||||
|
|
||||||
|
from odoo import models, fields, api, _
|
||||||
|
from odoo.tools import float_compare, float_is_zero
|
||||||
|
from odoo.exceptions import UserError, ValidationError
|
||||||
|
from odoo import SUPERUSER_ID
|
||||||
|
import logging
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class AccountInvoice(models.Model):
|
||||||
|
_inherit = 'account.invoice'
|
||||||
|
|
||||||
|
origin = fields.Char(track_visibility='onchange')
|
||||||
|
reference = fields.Char(track_visibility='onchange')
|
||||||
|
sent = fields.Boolean(track_visibility='onchange')
|
||||||
|
date_invoice = fields.Date(track_visibility='onchange')
|
||||||
|
date_due = fields.Date(track_visibility='onchange')
|
||||||
|
payment_term_id = fields.Many2one(track_visibility='onchange')
|
||||||
|
account_id = fields.Many2one(track_visibility='onchange')
|
||||||
|
journal_id = fields.Many2one(track_visibility='onchange')
|
||||||
|
partner_bank_id = fields.Many2one(track_visibility='onchange')
|
||||||
|
fiscal_position_id = fields.Many2one(track_visibility='onchange')
|
||||||
|
amount_total = fields.Monetary(track_visibility='onchange')
|
||||||
|
# for those fields, the 'account' module sets track_visibility='always':
|
||||||
|
partner_id = fields.Many2one(track_visibility='onchange')
|
||||||
|
currency_id = fields.Many2one(track_visibility='onchange')
|
||||||
|
type = fields.Selection(track_visibility='onchange')
|
||||||
|
amount_untaxed = fields.Monetary(track_visibility='onchange')
|
||||||
|
# I want to see the number of cancelled invoice in chatter
|
||||||
|
move_id = fields.Many2one(track_visibility='onchange')
|
||||||
|
# for invoice report
|
||||||
|
has_discount = fields.Boolean(
|
||||||
|
compute='_compute_has_discount', readonly=True)
|
||||||
|
# has_attachment is useful for those who use attachment to archive
|
||||||
|
# supplier invoices. It allows them to find supplier invoices
|
||||||
|
# that don't have any attachment
|
||||||
|
has_attachment = fields.Boolean(
|
||||||
|
compute='_compute_has_attachment',
|
||||||
|
search='_search_has_attachment', readonly=True)
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def _compute_has_discount(self):
|
||||||
|
prec = self.env['decimal.precision'].precision_get('Discount')
|
||||||
|
for inv in self:
|
||||||
|
has_discount = False
|
||||||
|
for line in inv.invoice_line_ids:
|
||||||
|
if not float_is_zero(line.discount, precision_digits=prec):
|
||||||
|
has_discount = True
|
||||||
|
break
|
||||||
|
inv.has_discount = has_discount
|
||||||
|
|
||||||
|
def _compute_has_attachment(self):
|
||||||
|
iao = self.env['ir.attachment']
|
||||||
|
for inv in self:
|
||||||
|
if iao.search([
|
||||||
|
('res_model', '=', 'account.invoice'),
|
||||||
|
('res_id', '=', inv.id),
|
||||||
|
('type', '=', 'binary'),
|
||||||
|
('company_id', '=', inv.company_id.id)], limit=1):
|
||||||
|
inv.has_attachment = True
|
||||||
|
else:
|
||||||
|
inv.has_attachment = False
|
||||||
|
|
||||||
|
def _search_has_attachment(self, operator, value):
|
||||||
|
att_inv_ids = {}
|
||||||
|
if operator == '=':
|
||||||
|
search_res = self.env['ir.attachment'].search_read([
|
||||||
|
('res_model', '=', 'account.invoice'),
|
||||||
|
('type', '=', 'binary'),
|
||||||
|
('res_id', '!=', False)], ['res_id'])
|
||||||
|
for att in search_res:
|
||||||
|
att_inv_ids[att['res_id']] = True
|
||||||
|
res = [('id', value and 'in' or 'not in', att_inv_ids.keys())]
|
||||||
|
return res
|
||||||
|
|
||||||
|
# I really hate to see a "/" in the 'name' field of the account.move.line
|
||||||
|
# generated from customer invoices linked to the partners' account because:
|
||||||
|
# 1) the label of an account move line is an important field, we can't
|
||||||
|
# write a rubbish '/' in it !
|
||||||
|
# 2) the 'name' field of the account.move.line is used in the overdue
|
||||||
|
# letter, and '/' is not meaningful for our customer !
|
||||||
|
@api.multi
|
||||||
|
def action_move_create(self):
|
||||||
|
res = super(AccountInvoice, self).action_move_create()
|
||||||
|
for inv in self:
|
||||||
|
self._cr.execute(
|
||||||
|
"UPDATE account_move_line SET name= "
|
||||||
|
"CASE WHEN name='/' THEN %s "
|
||||||
|
"ELSE %s||' - '||name END "
|
||||||
|
"WHERE move_id=%s", (inv.number, inv.number, inv.move_id.id))
|
||||||
|
self.invalidate_cache()
|
||||||
|
return res
|
||||||
|
|
||||||
|
def delete_lines_qty_zero(self):
|
||||||
|
lines = self.env['account.invoice.line'].search([
|
||||||
|
('invoice_id', 'in', self.ids), ('quantity', '=', 0)])
|
||||||
|
lines.unlink()
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
class AccountInvoiceLine(models.Model):
|
||||||
|
_inherit = 'account.invoice.line'
|
||||||
|
|
||||||
|
# In the 'account' module, we have related stored field for:
|
||||||
|
# company_id, partner_id, currency_id
|
||||||
|
invoice_type = fields.Selection(
|
||||||
|
related='invoice_id.type', store=True, readonly=True)
|
||||||
|
date_invoice = fields.Date(
|
||||||
|
related='invoice_id.date_invoice', store=True, readonly=True)
|
||||||
|
commercial_partner_id = fields.Many2one(
|
||||||
|
related='invoice_id.partner_id.commercial_partner_id',
|
||||||
|
store=True, readonly=True)
|
||||||
|
state = fields.Selection(
|
||||||
|
related='invoice_id.state', store=True, readonly=True,
|
||||||
|
string='Invoice State')
|
||||||
|
invoice_number = fields.Char(
|
||||||
|
related='invoice_id.move_id.name', store=True, readonly=True,
|
||||||
|
string='Invoice Number')
|
||||||
|
|
||||||
|
|
||||||
|
class AccountJournal(models.Model):
|
||||||
|
_inherit = 'account.journal'
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
@api.depends(
|
||||||
|
'name', 'currency_id', 'company_id', 'company_id.currency_id', 'code')
|
||||||
|
def name_get(self):
|
||||||
|
res = []
|
||||||
|
if self._context.get('journal_show_code_only'):
|
||||||
|
for journal in self:
|
||||||
|
res.append((journal.id, journal.code))
|
||||||
|
return res
|
||||||
|
else:
|
||||||
|
for journal in self:
|
||||||
|
currency = journal.currency_id or\
|
||||||
|
journal.company_id.currency_id
|
||||||
|
name = "[%s] %s (%s)" % (
|
||||||
|
journal.code, journal.name, currency.name)
|
||||||
|
res.append((journal.id, name))
|
||||||
|
return res
|
||||||
|
|
||||||
|
# Also search on start of 'code', not only on 'name'
|
||||||
|
@api.model
|
||||||
|
def name_search(
|
||||||
|
self, name='', args=None, operator='ilike', limit=80):
|
||||||
|
if args is None:
|
||||||
|
args = []
|
||||||
|
if name:
|
||||||
|
jrls = self.search(
|
||||||
|
[('code', '=ilike', name + '%')] + args, limit=limit)
|
||||||
|
if jrls:
|
||||||
|
return jrls.name_get()
|
||||||
|
return super(AccountJournal, self).name_search(
|
||||||
|
name=name, args=args, operator=operator, limit=limit)
|
||||||
|
|
||||||
|
@api.constrains('default_credit_account_id', 'default_debit_account_id')
|
||||||
|
def _check_account_type_on_bank_journal(self):
|
||||||
|
bank_acc_type = self.env.ref('account.data_account_type_liquidity')
|
||||||
|
for jrl in self:
|
||||||
|
if jrl.type in ('bank', 'cash'):
|
||||||
|
if (
|
||||||
|
jrl.default_debit_account_id and
|
||||||
|
jrl.default_debit_account_id.user_type_id !=
|
||||||
|
bank_acc_type):
|
||||||
|
raise ValidationError(_(
|
||||||
|
"On journal '%s', the default debit account '%s' "
|
||||||
|
"should be configured with Type = 'Bank and Cash'.")
|
||||||
|
% (jrl.display_name,
|
||||||
|
jrl.default_debit_account_id.display_name))
|
||||||
|
if (
|
||||||
|
jrl.default_credit_account_id and
|
||||||
|
jrl.default_credit_account_id.user_type_id !=
|
||||||
|
bank_acc_type):
|
||||||
|
raise ValidationError(_(
|
||||||
|
"On journal '%s', the default credit account '%s' "
|
||||||
|
"should be configured with Type = 'Bank and Cash'.")
|
||||||
|
% (jrl.display_name,
|
||||||
|
jrl.default_credit_account_id.display_name))
|
||||||
|
|
||||||
|
|
||||||
|
class AccountAccount(models.Model):
|
||||||
|
_inherit = 'account.account'
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def name_get(self):
|
||||||
|
if self._context.get('account_account_show_code_only'):
|
||||||
|
res = []
|
||||||
|
for record in self:
|
||||||
|
res.append((record.id, record.code))
|
||||||
|
return res
|
||||||
|
else:
|
||||||
|
return super(AccountAccount, self).name_get()
|
||||||
|
|
||||||
|
# https://github.com/odoo/odoo/issues/23040
|
||||||
|
def fix_bank_account_types(self):
|
||||||
|
aao = self.env['account.account']
|
||||||
|
companies = self.env['res.company'].search([])
|
||||||
|
if len(companies) > 1 and self.env.user.id != SUPERUSER_ID:
|
||||||
|
raise UserError(
|
||||||
|
"In multi-company setups, you should run this "
|
||||||
|
"script as admin user")
|
||||||
|
logger.info("START the script 'fix bank and cash account types'")
|
||||||
|
bank_type = self.env.ref('account.data_account_type_liquidity')
|
||||||
|
asset_type = self.env.ref('account.data_account_type_current_assets')
|
||||||
|
journals = self.env['account.journal'].search(
|
||||||
|
[('type', 'in', ('bank', 'cash'))], order='company_id')
|
||||||
|
journal_accounts_bank_type = aao
|
||||||
|
for journal in journals:
|
||||||
|
for account in [
|
||||||
|
journal.default_credit_account_id,
|
||||||
|
journal.default_debit_account_id]:
|
||||||
|
if account:
|
||||||
|
if account.user_type_id != bank_type:
|
||||||
|
account.user_type_id = bank_type.id
|
||||||
|
logger.info(
|
||||||
|
'Company %s: Account %s updated to Bank '
|
||||||
|
'and Cash type',
|
||||||
|
account.company_id.display_name, account.code)
|
||||||
|
if account not in journal_accounts_bank_type:
|
||||||
|
journal_accounts_bank_type += account
|
||||||
|
accounts = aao.search([
|
||||||
|
('user_type_id', '=', bank_type.id)], order='company_id, code')
|
||||||
|
for account in aao.search([('user_type_id', '=', bank_type.id)]):
|
||||||
|
if account not in journal_accounts_bank_type:
|
||||||
|
account.user_type_id = asset_type.id
|
||||||
|
logger.info(
|
||||||
|
'Company %s: Account %s updated to Current Asset type',
|
||||||
|
account.company_id.display_name, account.code)
|
||||||
|
logger.info("END of the script 'fix bank and cash account types'")
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
class AccountAnalyticAccount(models.Model):
|
||||||
|
_inherit = 'account.analytic.account'
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def name_get(self):
|
||||||
|
if self._context.get('analytic_account_show_code_only'):
|
||||||
|
res = []
|
||||||
|
for record in self:
|
||||||
|
res.append((
|
||||||
|
record.id,
|
||||||
|
record.code or record._get_one_full_name(record)))
|
||||||
|
return res
|
||||||
|
else:
|
||||||
|
return super(AccountAnalyticAccount, self).name_get()
|
||||||
|
|
||||||
|
_sql_constraints = [(
|
||||||
|
'code_company_unique',
|
||||||
|
'unique(code, company_id)',
|
||||||
|
'An analytic account with the same code already '
|
||||||
|
'exists in the same company!')]
|
||||||
|
|
||||||
|
|
||||||
|
class AccountMove(models.Model):
|
||||||
|
_inherit = 'account.move'
|
||||||
|
|
||||||
|
default_move_line_name = fields.Char(
|
||||||
|
string='Default Label', states={'posted': [('readonly', True)]})
|
||||||
|
# By default, we can still modify "ref" when account move is posted
|
||||||
|
# which seems a bit lazy for me...
|
||||||
|
ref = fields.Char(states={'posted': [('readonly', True)]})
|
||||||
|
|
||||||
|
|
||||||
|
class AccountMoveLine(models.Model):
|
||||||
|
_inherit = 'account.move.line'
|
||||||
|
# Native order:
|
||||||
|
# _order = "date desc, id desc"
|
||||||
|
# Problem: when you manually create a journal entry, the
|
||||||
|
# order of the lines is inverted when you save ! It is quite annoying for
|
||||||
|
# the user...
|
||||||
|
_order = "date desc, id asc"
|
||||||
|
|
||||||
|
# Update field only to add a string (there is no string in account module)
|
||||||
|
invoice_id = fields.Many2one(string='Invoice')
|
||||||
|
|
||||||
|
@api.onchange('credit')
|
||||||
|
def _credit_onchange(self):
|
||||||
|
prec = self.env['decimal.precision'].precision_get('Account')
|
||||||
|
if (
|
||||||
|
not float_is_zero(self.credit, precision_digits=prec) and
|
||||||
|
not float_is_zero(self.debit, precision_digits=prec)):
|
||||||
|
self.debit = 0
|
||||||
|
|
||||||
|
@api.onchange('debit')
|
||||||
|
def _debit_onchange(self):
|
||||||
|
prec = self.env['decimal.precision'].precision_get('Account')
|
||||||
|
if (
|
||||||
|
not float_is_zero(self.debit, precision_digits=prec) and
|
||||||
|
not float_is_zero(self.credit, precision_digits=prec)):
|
||||||
|
self.credit = 0
|
||||||
|
|
||||||
|
@api.onchange('currency_id', 'amount_currency')
|
||||||
|
def _amount_currency_change(self):
|
||||||
|
prec = self.env['decimal.precision'].precision_get('Account')
|
||||||
|
if (
|
||||||
|
self.currency_id and
|
||||||
|
self.amount_currency and
|
||||||
|
float_is_zero(self.credit, precision_digits=prec) and
|
||||||
|
float_is_zero(self.debit, precision_digits=prec)):
|
||||||
|
date = self.date or None
|
||||||
|
amount_company_currency = self.currency_id.with_context(
|
||||||
|
date=date).compute(
|
||||||
|
self.amount_currency, self.env.user.company_id.currency_id)
|
||||||
|
precision = self.env['decimal.precision'].precision_get('Account')
|
||||||
|
if float_compare(
|
||||||
|
amount_company_currency, 0,
|
||||||
|
precision_digits=precision) == -1:
|
||||||
|
self.debit = amount_company_currency * -1
|
||||||
|
else:
|
||||||
|
self.credit = amount_company_currency
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def show_account_move_form(self):
|
||||||
|
self.ensure_one()
|
||||||
|
action = self.env['ir.actions.act_window'].for_xml_id(
|
||||||
|
'account', 'action_move_line_form')
|
||||||
|
action.update({
|
||||||
|
'res_id': self.move_id.id,
|
||||||
|
'view_id': False,
|
||||||
|
'views': False,
|
||||||
|
'view_mode': 'form,tree',
|
||||||
|
})
|
||||||
|
return action
|
||||||
|
|
||||||
|
|
||||||
|
class AccountBankStatement(models.Model):
|
||||||
|
_inherit = 'account.bank.statement'
|
||||||
|
|
||||||
|
start_date = fields.Date(
|
||||||
|
compute='_compute_dates', string='Start Date', readonly=True,
|
||||||
|
store=True)
|
||||||
|
end_date = fields.Date(
|
||||||
|
compute='_compute_dates', string='End Date', readonly=True,
|
||||||
|
store=True)
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
@api.depends('line_ids.date')
|
||||||
|
def _compute_dates(self):
|
||||||
|
for st in self:
|
||||||
|
dates = [line.date for line in st.line_ids]
|
||||||
|
st.start_date = dates and min(dates) or False
|
||||||
|
st.end_date = dates and max(dates) or False
|
||||||
|
|
||||||
|
|
||||||
|
class AccountBankStatementLine(models.Model):
|
||||||
|
_inherit = 'account.bank.statement.line'
|
||||||
|
# Native order is:
|
||||||
|
# _order = 'statement_id desc, sequence, id desc'
|
||||||
|
_order = 'statement_id desc, date desc, sequence, id desc'
|
||||||
|
|
||||||
|
# Disable guessing for reconciliation
|
||||||
|
# because my experience with several customers shows that it is a problem
|
||||||
|
# in the following scenario : move line 'x' has been "guessed" by OpenERP
|
||||||
|
# to be reconciled with a statement line 'Y' at the end of the bank
|
||||||
|
# statement, but it is a mistake because it should be reconciled with
|
||||||
|
# statement line 'B' at the beginning of the bank statement
|
||||||
|
# When the user is on statement line 'B', he tries to select
|
||||||
|
# move line 'x', but it can't find it... because it is already "reserved"
|
||||||
|
# by the guess of OpenERP for statement line 'Y' ! To solve this problem,
|
||||||
|
# the user must go to statement line 'Y' and unselect move line 'x'
|
||||||
|
# and then come back on statement line 'B' and select move line 'A'...
|
||||||
|
# but non super-expert users can't do that because it is impossible to
|
||||||
|
# figure out that the fact that the user can't find move line 'x'
|
||||||
|
# is caused by this.
|
||||||
|
# Set search_reconciliation_proposition to False by default
|
||||||
|
# TODO: re-write in v10
|
||||||
|
# def get_data_for_reconciliations(
|
||||||
|
# self, cr, uid, ids, excluded_ids=None,
|
||||||
|
# search_reconciliation_proposition=False, context=None):
|
||||||
|
# # Make variable name shorted for PEP8 !
|
||||||
|
# search_rec_prop = search_reconciliation_proposition
|
||||||
|
# return super(AccountBankStatementLine, self).\
|
||||||
|
# get_data_for_reconciliations(
|
||||||
|
# cr, uid, ids, excluded_ids=excluded_ids,
|
||||||
|
# search_reconciliation_proposition=search_rec_prop,
|
||||||
|
# context=context)
|
||||||
|
|
||||||
|
def _prepare_reconciliation_move(self, move_ref):
|
||||||
|
vals = super(AccountBankStatementLine, self).\
|
||||||
|
_prepare_reconciliation_move(move_ref)
|
||||||
|
# By default, ref contains the name of the statement + name of the
|
||||||
|
# statement line. It causes 2 problems:
|
||||||
|
# 1) The 'ref' field is too big
|
||||||
|
# 2) The name of the statement line is already written in the name of
|
||||||
|
# the move line -> not useful to have the info 2 times
|
||||||
|
# In the end, I think it's better to just put nothing (we could write
|
||||||
|
# the name of the statement which has the account number, but it
|
||||||
|
# doesn't bring any useful info to the accountant)
|
||||||
|
# The only "good" thing to do would be to have a sequence per
|
||||||
|
# statement line and write it in this 'ref' field
|
||||||
|
# But that would required an additionnal field on statement lines
|
||||||
|
vals['ref'] = False
|
||||||
|
return vals
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
def show_account_move(self):
|
||||||
|
self.ensure_one()
|
||||||
|
action = self.env['ir.actions.act_window'].for_xml_id(
|
||||||
|
'account', 'action_move_journal_line')
|
||||||
|
if self.journal_entry_ids:
|
||||||
|
action.update({
|
||||||
|
'views': False,
|
||||||
|
'view_id': False,
|
||||||
|
'view_mode': 'form,tree',
|
||||||
|
'res_id': self.journal_entry_ids[0].id,
|
||||||
|
})
|
||||||
|
return action
|
||||||
|
else:
|
||||||
|
raise UserError(_(
|
||||||
|
'No journal entry linked to this bank statement line.'))
|
||||||
|
|
||||||
|
|
||||||
|
class AccountFiscalPosition(models.Model):
|
||||||
|
_inherit = 'account.fiscal.position'
|
||||||
|
|
||||||
|
note = fields.Text(translate=True)
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def get_fiscal_position_no_partner(
|
||||||
|
self, company_id=None, vat_subjected=False, country_id=None):
|
||||||
|
'''This method is inspired by the method get_fiscal_position()
|
||||||
|
in odoo/addons/account/partner.py : it uses the same algo
|
||||||
|
but without a real partner.
|
||||||
|
Returns a recordset of fiscal position, or False'''
|
||||||
|
domains = [[
|
||||||
|
('auto_apply', '=', True),
|
||||||
|
('vat_required', '=', vat_subjected),
|
||||||
|
('company_id', '=', company_id)]]
|
||||||
|
if vat_subjected:
|
||||||
|
domains += [[
|
||||||
|
('auto_apply', '=', True),
|
||||||
|
('vat_required', '=', False),
|
||||||
|
('company_id', '=', company_id)]]
|
||||||
|
|
||||||
|
for domain in domains:
|
||||||
|
if country_id:
|
||||||
|
fps = self.search(
|
||||||
|
domain + [('country_id', '=', country_id)], limit=1)
|
||||||
|
if fps:
|
||||||
|
return fps[0]
|
||||||
|
|
||||||
|
fps = self.search(
|
||||||
|
domain +
|
||||||
|
[('country_group_id.country_ids', '=', country_id)],
|
||||||
|
limit=1)
|
||||||
|
if fps:
|
||||||
|
return fps[0]
|
||||||
|
|
||||||
|
fps = self.search(
|
||||||
|
domain +
|
||||||
|
[('country_id', '=', None), ('country_group_id', '=', None)],
|
||||||
|
limit=1)
|
||||||
|
if fps:
|
||||||
|
return fps[0]
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
class AccountReconcileModel(models.Model):
|
||||||
|
_inherit = 'account.reconcile.model'
|
||||||
|
|
||||||
|
@api.onchange('name')
|
||||||
|
def onchange_name(self):
|
||||||
|
# Do NOT copy by default name on label
|
||||||
|
# Because it's much better to have the bank statement line label as
|
||||||
|
# label of the counter-part move line, then the label of the button
|
||||||
|
assert True # Stupid line of code just to have something...
|
||||||
15
account_usability/account_report.xml
Normal file
15
account_usability/account_report.xml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 2018 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).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<record id="account.account_invoices" model="ir.actions.report.xml">
|
||||||
|
<!-- Don't attach on supplier invoices/refunds ! -->
|
||||||
|
<field name="attachment">(object.type in ('out_invoice', 'out_refund')) and (object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
53
account_usability/account_several_improvements.diff
Normal file
53
account_usability/account_several_improvements.diff
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py
|
||||||
|
index 8ed1e48..615da43 100644
|
||||||
|
--- a/addons/account/models/account_bank_statement.py
|
||||||
|
+++ b/addons/account/models/account_bank_statement.py
|
||||||
|
@@ -563,7 +563,13 @@ class AccountBankStatementLine(models.Model):
|
||||||
|
"""
|
||||||
|
# Blue lines = payment on bank account not assigned to a statement yet
|
||||||
|
reconciliation_aml_accounts = [self.journal_id.default_credit_account_id.id, self.journal_id.default_debit_account_id.id]
|
||||||
|
- domain_reconciliation = ['&', '&', ('statement_id', '=', False), ('account_id', 'in', reconciliation_aml_accounts), ('payment_id','<>', False)]
|
||||||
|
+ # AKRETION HACK 11/7/2017
|
||||||
|
+ # Remove ('payment_id','<>', False) in order to allow to select move lines
|
||||||
|
+ # generated from payment orders or check deposit
|
||||||
|
+ # but I add ('journal_id', '=', self.journal_id.id) to exclude the
|
||||||
|
+ # opening entry of the first fiscal year
|
||||||
|
+ #domain_reconciliation = ['&', '&', ('statement_id', '=', False), ('account_id', 'in', reconciliation_aml_accounts), ('payment_id','<>', False)]
|
||||||
|
+ domain_reconciliation = ['&', '&', ('statement_id', '=', False), ('account_id', 'in', reconciliation_aml_accounts), ('journal_id', '=', self.journal_id.id)]
|
||||||
|
|
||||||
|
# Black lines = unreconciled & (not linked to a payment or open balance created by statement
|
||||||
|
domain_matching = [('reconciled', '=', False)]
|
||||||
|
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
|
||||||
|
index b60ffbe..6c27c57 100644
|
||||||
|
--- a/addons/account/models/account_move.py
|
||||||
|
+++ b/addons/account/models/account_move.py
|
||||||
|
@@ -599,6 +599,7 @@ class AccountMoveLine(models.Model):
|
||||||
|
domain = expression.AND([domain, [('id', 'not in', excluded_ids)]])
|
||||||
|
if str:
|
||||||
|
str_domain = [
|
||||||
|
+ '|', ('account_id.code', '=ilike', str + '%'),
|
||||||
|
'|', ('move_id.name', 'ilike', str),
|
||||||
|
'|', ('move_id.ref', 'ilike', str),
|
||||||
|
'|', ('date_maturity', 'like', str),
|
||||||
|
diff --git a/addons/account/static/src/js/account_reconciliation_widgets.js b/addons/account/static/src/js/account_reconciliation_widgets.js
|
||||||
|
index 453bd41..48c396e 100644
|
||||||
|
--- a/addons/account/static/src/js/account_reconciliation_widgets.js
|
||||||
|
+++ b/addons/account/static/src/js/account_reconciliation_widgets.js
|
||||||
|
@@ -76,7 +76,7 @@ var abstractReconciliation = Widget.extend(ControlPanelMixin, {
|
||||||
|
this.model_res_users = new Model("res.users");
|
||||||
|
this.model_tax = new Model("account.tax");
|
||||||
|
this.model_presets = new Model("account.reconcile.model");
|
||||||
|
- this.max_move_lines_displayed = 5;
|
||||||
|
+ this.max_move_lines_displayed = 15;
|
||||||
|
// Number of reconciliations loaded initially and by clicking 'show more'
|
||||||
|
this.num_reconciliations_fetched_in_batch = 10;
|
||||||
|
this.animation_speed = 100; // "Blocking" animations
|
||||||
|
@@ -1755,7 +1755,7 @@ var bankStatementReconciliationLine = abstractReconciliationLine.extend({
|
||||||
|
relation: "res.partner",
|
||||||
|
string: _t("Partner"),
|
||||||
|
type: "many2one",
|
||||||
|
- domain: [['parent_id','=',false], '|', ['customer','=',true], ['supplier','=',true]],
|
||||||
|
+ domain: [['parent_id','=',false]], // AKRETION HACK 26/6/2017 allow all parent partners
|
||||||
|
help: "",
|
||||||
|
readonly: false,
|
||||||
|
required: true,
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py
|
||||||
|
index 4374528..aea1361 100644
|
||||||
|
--- a/addons/account/models/account_bank_statement.py
|
||||||
|
+++ b/addons/account/models/account_bank_statement.py
|
||||||
|
@@ -1008,7 +1008,7 @@ class AccountBankStatementLine(models.Model):
|
||||||
|
#record the move name on the statement line to be able to retrieve it in case of unreconciliation
|
||||||
|
self.write({'move_name': move.name})
|
||||||
|
payment.write({'payment_reference': move.name})
|
||||||
|
- elif self.move_name:
|
||||||
|
- raise UserError(_('Operation not allowed. Since your statement line already received a number, you cannot reconcile it entirely with existing journal entries otherwise it would make a gap in the numbering. You should book an entry and make a regular revert of it in case you want to cancel it.'))
|
||||||
|
+ #elif self.move_name:
|
||||||
|
+ # raise UserError(_('Operation not allowed. Since your statement line already received a number, you cannot reconcile it entirely with existing journal entries otherwise it would make a gap in the numbering. You should book an entry and make a regular revert of it in case you want to cancel it.'))
|
||||||
|
counterpart_moves.assert_balanced()
|
||||||
|
return counterpart_moves
|
||||||
482
account_usability/account_view.xml
Normal file
482
account_usability/account_view.xml
Normal file
@@ -0,0 +1,482 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
© 2015-2016 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).
|
||||||
|
-->
|
||||||
|
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<!-- INVOICE -->
|
||||||
|
<record id="invoice_supplier_form" model="ir.ui.view">
|
||||||
|
<field name="name">account_usability.supplier.invoice.form</field>
|
||||||
|
<field name="model">account.invoice</field>
|
||||||
|
<field name="inherit_id" ref="account.invoice_supplier_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="fiscal_position_id" position="attributes">
|
||||||
|
<attribute name="widget">selection</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="invoice_line_ids" position="before">
|
||||||
|
<button name="delete_lines_qty_zero" states="draft" string="⇒ Delete lines qty=0" type="object" class="oe_link oe_right" groups="account.group_account_invoice"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="invoice_form" model="ir.ui.view">
|
||||||
|
<field name="name">account_usability.invoice.form</field>
|
||||||
|
<field name="model">account.invoice</field>
|
||||||
|
<field name="inherit_id" ref="account.invoice_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="fiscal_position_id" position="attributes">
|
||||||
|
<attribute name="widget">selection</attribute>
|
||||||
|
</field>
|
||||||
|
<!-- move sent field and make it visible -->
|
||||||
|
<field name="sent" position="replace"/>
|
||||||
|
<field name="move_id" position="before">
|
||||||
|
<field name="sent"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="invoice_tree" model="ir.ui.view">
|
||||||
|
<field name="name">account_usability.invoice_tree</field>
|
||||||
|
<field name="model">account.invoice</field>
|
||||||
|
<field name="inherit_id" ref="account.invoice_tree"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="reference" position="attributes">
|
||||||
|
<attribute name="invisible">not context.get('type') in ('in_invoice', 'in_refund')</attribute>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_account_invoice_filter" model="ir.ui.view">
|
||||||
|
<field name="name">account_usability.invoice.search</field>
|
||||||
|
<field name="model">account.invoice</field>
|
||||||
|
<field name="inherit_id" ref="account.view_account_invoice_filter"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<filter name="late" position="after">
|
||||||
|
<separator/>
|
||||||
|
<filter name="to_send" string="To Send" domain="[('sent', '=', False), ('state', 'in', ('open', 'paid'))]"/>
|
||||||
|
<filter name="sent" string="Sent" domain="[('sent', '=', True)]"/>
|
||||||
|
<separator/>
|
||||||
|
<filter name="no_attachment" string="Missing Attachment" domain="[('has_attachment', '=', False)]"/>
|
||||||
|
</filter>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- Having a menu entry on invoice lines is often very usefull for odoo user:
|
||||||
|
they can search in their lines, etc...
|
||||||
|
So I enhance the generic views and add actions, but I don't add menu entries here ;
|
||||||
|
the creation of the corresponding menu entry should be done in the customer-specifc
|
||||||
|
module -->
|
||||||
|
<record id="view_invoice_line_tree" model="ir.ui.view">
|
||||||
|
<field name="name">account_usability.invoice_line_tree</field>
|
||||||
|
<field name="model">account.invoice.line</field>
|
||||||
|
<field name="inherit_id" ref="account.view_invoice_line_tree"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="name" position="before">
|
||||||
|
<field name="partner_id" invisible="not context.get('show_invoice_fields')"/>
|
||||||
|
<field name="date_invoice" invisible="not context.get('show_invoice_fields')"/>
|
||||||
|
<field name="invoice_number" invisible="not context.get('show_invoice_fields')"/>
|
||||||
|
</field>
|
||||||
|
<field name="currency_id" position="after">
|
||||||
|
<field name="state" invisible="not context.get('show_invoice_fields')"/>
|
||||||
|
<field name="invoice_type" invisible="1"/>
|
||||||
|
</field>
|
||||||
|
<field name="quantity" position="attributes">
|
||||||
|
<attribute name="sum">1</attribute>
|
||||||
|
</field>
|
||||||
|
<xpath expr="/tree" position="attributes">
|
||||||
|
<attribute name="decoration-info">state == 'draft'</attribute>
|
||||||
|
<attribute name="decoration-muted">state == 'cancel'</attribute>
|
||||||
|
<attribute name="edit">0</attribute>
|
||||||
|
<attribute name="create">0</attribute>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="account_invoice_line_search" model="ir.ui.view">
|
||||||
|
<field name="name">account_usability.invoice_line_search</field>
|
||||||
|
<field name="model">account.invoice.line</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<search string="Search Invoice Lines">
|
||||||
|
<field name="partner_id"/>
|
||||||
|
<field name="product_id"/>
|
||||||
|
<field name="account_id"/>
|
||||||
|
<field name="invoice_number"/>
|
||||||
|
<field name="name"/>
|
||||||
|
<filter name="out_invoice" string="Customer Invoices"
|
||||||
|
domain="[('invoice_type', '=', 'out_invoice')]"/>
|
||||||
|
<filter name="out_refund" string="Customer Refunds"
|
||||||
|
domain="[('invoice_type', '=', 'out_refund')]"/>
|
||||||
|
<filter name="in_invoice" string="Supplier Invoices"
|
||||||
|
domain="[('invoice_type', '=', 'in_invoice')]"/>
|
||||||
|
<filter name="in_refund" string="Supplier Refunds"
|
||||||
|
domain="[('invoice_type', '=', 'in_refund')]"/>
|
||||||
|
<separator/>
|
||||||
|
<filter name="draft" string="Draft" domain="[('state', '=', 'draft')]"/>
|
||||||
|
<filter name="unpaid" string="Not Paid" domain="[('state', '=', 'open')]"/>
|
||||||
|
<filter name="paid" string="Paid" domain="[('state', '=', 'paid')]"/>
|
||||||
|
|
||||||
|
<group string="Group By" name="groupby">
|
||||||
|
<filter name="partner_groupby" string="Partner"
|
||||||
|
context="{'group_by': 'partner_id'}"/>
|
||||||
|
<filter name="date_groupby" string="Invoice Date"
|
||||||
|
context="{'group_by': 'date_invoice'}"/>
|
||||||
|
<filter name="product_groupby" string="Product"
|
||||||
|
context="{'group_by': 'product_id'}"/>
|
||||||
|
<filter name="account_groupby" string="Account"
|
||||||
|
context="{'group_by': 'account_id'}"/>
|
||||||
|
</group>
|
||||||
|
</search>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="out_invoice_line_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Customer Invoice Lines</field>
|
||||||
|
<field name="res_model">account.invoice.line</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
<field name="domain">[('invoice_type', '=', 'out_invoice')]</field>
|
||||||
|
<field name="context">{'show_invoice_fields': True}</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="out_refund_line_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Customer Refund Lines</field>
|
||||||
|
<field name="res_model">account.invoice.line</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
<field name="domain">[('invoice_type', '=', 'out_refund')]</field>
|
||||||
|
<field name="context">{'show_invoice_fields': True}</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="out_invoice_refund_line_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Customer Invoice Lines</field>
|
||||||
|
<field name="res_model">account.invoice.line</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
<field name="domain">[('invoice_type', 'in', ('out_invoice', 'out_refund'))]</field>
|
||||||
|
<field name="context">{'show_invoice_fields': True}</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="in_invoice_line_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Supplier Invoice Lines</field>
|
||||||
|
<field name="res_model">account.invoice.line</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
<field name="domain">[('invoice_type', '=', 'in_invoice')]</field>
|
||||||
|
<field name="context">{'show_invoice_fields': True}</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="in_refund_line_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Supplier Refund Lines</field>
|
||||||
|
<field name="res_model">account.invoice.line</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
<field name="domain">[('invoice_type', '=', 'in_refund')]</field>
|
||||||
|
<field name="context">{'show_invoice_fields': True}</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="in_invoice_refund_line_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Supplier Invoice Lines</field>
|
||||||
|
<field name="res_model">account.invoice.line</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
<field name="domain">[('invoice_type', 'in', ('in_invoice', 'in_refund'))]</field>
|
||||||
|
<field name="context">{'show_invoice_fields': True}</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_account_invoice_report_search" model="ir.ui.view">
|
||||||
|
<field name="name">usability.account.invoice.report.search</field>
|
||||||
|
<field name="model">account.invoice.report</field>
|
||||||
|
<field name="inherit_id" ref="account.view_account_invoice_report_search"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="categ_id" position="after">
|
||||||
|
<field name="product_id"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="account_invoice_report_tree" model="ir.ui.view">
|
||||||
|
<field name="name">usability.account.invoice.report.tree</field>
|
||||||
|
<field name="model">account.invoice.report</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree string="Invoices Analysis">
|
||||||
|
<field name="date"/>
|
||||||
|
<field name="commercial_partner_id"/>
|
||||||
|
<field name="type"/>
|
||||||
|
<field name="product_id"/>
|
||||||
|
<field name="product_qty" sum="1"/>
|
||||||
|
<field name="price_total" sum="1"/>
|
||||||
|
<field name="state"/>
|
||||||
|
<field name="currency_id" invisible="1"/>
|
||||||
|
<field name="company_id" groups="base.group_multi_company"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="account.action_account_invoice_report_all_supp" model="ir.actions.act_window">
|
||||||
|
<field name="view_mode">pivot,graph,tree</field>
|
||||||
|
<field name="context">{'search_default_current':1, 'search_default_supplier':1, 'search_default_year': 1}</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="account.action_account_invoice_report_all" model="ir.actions.act_window">
|
||||||
|
<field name="view_mode">pivot,graph,tree</field>
|
||||||
|
<field name="context">{'search_default_current':1, 'search_default_customer':1, 'search_default_year': 1}</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_account_invoice_report_pivot" model="ir.ui.view">
|
||||||
|
<field name="name">usability.account.invoice.report.pivot</field>
|
||||||
|
<field name="model">account.invoice.report</field>
|
||||||
|
<field name="inherit_id" ref="account.view_account_invoice_report_pivot"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="/pivot" position="attributes">
|
||||||
|
<attribute name="disable_linking"></attribute>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_invoice_tax_form" model="ir.ui.view">
|
||||||
|
<field name="name">usability.account.invoice.tax.form</field>
|
||||||
|
<field name="model">account.invoice.tax</field>
|
||||||
|
<field name="inherit_id" ref="account.view_invoice_tax_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="name" position="after">
|
||||||
|
<field name="tax_id"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- model account.move.line / Journal Items -->
|
||||||
|
<record id="account.action_account_moves_all_a" model="ir.actions.act_window">
|
||||||
|
<field name="limit">200</field>
|
||||||
|
<!-- Win space, because there are already many columns -->
|
||||||
|
<field name="context">{'journal_show_code_only': True}</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- remove base.group_no_one on Journal Items-->
|
||||||
|
<record id="account.menu_action_account_moves_all" model="ir.ui.menu">
|
||||||
|
<field name="groups_id" eval="[(6, 0, [ref('account.group_account_user')])]"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- accountant must be able to access the Adviser section ! -->
|
||||||
|
<record id="account.menu_finance_entries" model="ir.ui.menu">
|
||||||
|
<field name="groups_id" eval="[(4, ref('account.group_account_user'))]"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- model account.move / Journal Entries -->
|
||||||
|
<record id="account.action_move_journal_line" model="ir.actions.act_window">
|
||||||
|
<field name="limit">200</field>
|
||||||
|
<field name="context">{}</field> <!-- Don't filter by default on misc journal -->
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_move_form" model="ir.ui.view">
|
||||||
|
<field name="name">account_usability.account_move_form</field>
|
||||||
|
<field name="model">account.move</field>
|
||||||
|
<field name="inherit_id" ref="account.view_move_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="ref" position="after">
|
||||||
|
<field name="default_move_line_name"/>
|
||||||
|
</field>
|
||||||
|
<xpath expr="//field[@name='line_ids']" position="attributes">
|
||||||
|
<attribute name="context">{'line_ids': line_ids, 'journal_id': journal_id, 'default_name': default_move_line_name}</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='line_ids']/tree/field[@name='date_maturity']" position="after">
|
||||||
|
<field name="full_reconcile_id"/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_account_move_line_filter" model="ir.ui.view">
|
||||||
|
<field name="name">account_usability.account_move_line_search</field>
|
||||||
|
<field name="model">account.move.line</field>
|
||||||
|
<field name="inherit_id" ref="account.view_account_move_line_filter"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="partner_id" position="after">
|
||||||
|
<field name="full_reconcile_id" />
|
||||||
|
</field>
|
||||||
|
<filter name="unreconciled" position="before">
|
||||||
|
<filter name="reconciled" string="Fully Reconciled" domain="[('full_reconcile_id', '!=', False)]"/>
|
||||||
|
<!-- <filter name="partial_reconciled" string="Partially Reconciled" domain="[('reconcile_partial_id', '!=', False)]"/> -->
|
||||||
|
</filter>
|
||||||
|
<filter name="unreconciled" position="attributes">
|
||||||
|
<attribute name="string">Unreconciled or Partially Reconciled</attribute>
|
||||||
|
</filter>
|
||||||
|
<field name="name" position="attributes">
|
||||||
|
<attribute name="string">Name or Reference</attribute>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_move_line_form" model="ir.ui.view">
|
||||||
|
<field name="name">account_usability.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">
|
||||||
|
<field name="quantity" position="after">
|
||||||
|
<field name="product_id" />
|
||||||
|
</field>
|
||||||
|
<field name="move_id" position="after">
|
||||||
|
<field name="invoice_id"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_move_line_tree" model="ir.ui.view">
|
||||||
|
<field name="name">account_usability.account_move_line_tree</field>
|
||||||
|
<field name="model">account.move.line</field>
|
||||||
|
<field name="inherit_id" ref="account.view_move_line_tree"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<!-- Move reconcile_id to a better position -->
|
||||||
|
<field name="full_reconcile_id" position="replace"/>
|
||||||
|
<field name="credit" position="after">
|
||||||
|
<field name="full_reconcile_id"/>
|
||||||
|
</field>
|
||||||
|
<field name="date_maturity" position="after">
|
||||||
|
<button name="show_account_move_form" type="object" icon="fa-arrows-h" string="Show Journal Entry"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_account_search" model="ir.ui.view">
|
||||||
|
<field name="name">account.account.search</field>
|
||||||
|
<field name="model">account.account</field>
|
||||||
|
<field name="inherit_id" ref="account.view_account_search"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<!-- The native "name" filter uses a domain ['|', ('name','ilike',self), ('code','=like',str(self)+'%')]
|
||||||
|
This is good because it uses '=like' on 'code', but sometimes there are digits in account names,
|
||||||
|
so you get additionnal unexpected accounts in the result of the search -->
|
||||||
|
<field name="name" position="after">
|
||||||
|
<field name="code" filter_domain="[('code', '=like', str(self)+'%')]" string="Code"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_account_type_tree" model="ir.ui.view">
|
||||||
|
<field name="name">account_usability.account_type_tree</field>
|
||||||
|
<field name="model">account.account.type</field>
|
||||||
|
<field name="inherit_id" ref="account.view_account_type_tree" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="type" position="after">
|
||||||
|
<field name="include_initial_balance" />
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_account_journal_search" model="ir.ui.view">
|
||||||
|
<field name="name">usability.account.journal.search</field>
|
||||||
|
<field name="model">account.journal</field>
|
||||||
|
<field name="inherit_id" ref="account.view_account_journal_search"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<filter name="dashboard" position="after">
|
||||||
|
<group name="groupby" string="Group By">
|
||||||
|
<filter name="type_groupby" string="Type" context="{'group_by': 'type'}"/>
|
||||||
|
</group>
|
||||||
|
</filter>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_bank_statement_form" model="ir.ui.view">
|
||||||
|
<field name="name">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">
|
||||||
|
<xpath expr="//field[@name='line_ids']/tree/field[@name='bank_account_id']" position="after">
|
||||||
|
<!-- The cancel button is provided by the account_cancel module, but we don't want to depend on it -->
|
||||||
|
<button name="show_account_move" type="object"
|
||||||
|
string="View Account Move" icon="fa fa-arrow-right"
|
||||||
|
attrs="{'invisible': [('journal_entry_ids', '=', [])]}"/>
|
||||||
|
</xpath>
|
||||||
|
<field name="date" position="after">
|
||||||
|
<field name="start_date"/>
|
||||||
|
<field name="end_date"/>
|
||||||
|
</field>
|
||||||
|
<field name="date" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_bank_statement_tree" model="ir.ui.view">
|
||||||
|
<field name="name">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="date" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="journal_id" position="after">
|
||||||
|
<field name="start_date"/>
|
||||||
|
<field name="end_date"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="view_bank_statement_search" model="ir.ui.view">
|
||||||
|
<field name="name">usability.account.bank.statement.search</field>
|
||||||
|
<field name="model">account.bank.statement</field>
|
||||||
|
<field name="inherit_id" ref="account.view_bank_statement_search"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="date" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</field>
|
||||||
|
<field name="date" position="after">
|
||||||
|
<field name="start_date"/>
|
||||||
|
<field name="end_date"/>
|
||||||
|
</field>
|
||||||
|
<filter context="{'group_by': 'date'}" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</filter>
|
||||||
|
<filter context="{'group_by': 'date'}" position="after">
|
||||||
|
<filter name="start_date_groupby" string="Start Date"
|
||||||
|
context="{'group_by': 'start_date'}"/>
|
||||||
|
<filter name="end_date_groupby" string="End Date"
|
||||||
|
context="{'group_by': 'end_date'}"/>
|
||||||
|
</filter>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- ACCOUNT TAX GROUP -->
|
||||||
|
<!-- in the account module, there is nothing for account.tax.group : no form/tree view, no menu... -->
|
||||||
|
<record id="account_tax_group_form" model="ir.ui.view">
|
||||||
|
<field name="name">usability.account.tax.group.form</field>
|
||||||
|
<field name="model">account.tax.group</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form string="Tax Group">
|
||||||
|
<group name="main">
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="sequence" invisible="1"/>
|
||||||
|
</group>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="account_tax_group_tree" model="ir.ui.view">
|
||||||
|
<field name="name">usability.account.tax.group.tree</field>
|
||||||
|
<field name="model">account.tax.group</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree string="Tax Groups">
|
||||||
|
<field name="sequence" widget="handle"/>
|
||||||
|
<field name="name"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="account_tax_group_action" model="ir.actions.act_window">
|
||||||
|
<field name="name">Tax Groups</field>
|
||||||
|
<field name="res_model">account.tax.group</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<menuitem id="account_tax_group_menu" action="account_tax_group_action" parent="account.account_account_menu" sequence="2"/>
|
||||||
|
|
||||||
|
<!-- Remove menu entry "Accounting > Configuration > Accounting > Bank Accounts"
|
||||||
|
(account.journal filtered on type = 'bank' with special tree and form view)
|
||||||
|
because it is useless and confusing -->
|
||||||
|
<record id="account.menu_action_account_bank_journal_form" model="ir.ui.menu">
|
||||||
|
<field name="groups_id" eval="[(6, 0, [ref('base_usability.group_nobody')])]"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- Duplicate the menu "Sales > Configuration > Contacts > Bank Accounts"
|
||||||
|
under "Accounting > Configuration", because most users will try to find it there -->
|
||||||
|
<menuitem id="bank_account_account_config_menu" name="Bank Accounts" parent="account.menu_finance_configuration" sequence="9"/>
|
||||||
|
|
||||||
|
<menuitem id="res_bank_account_config_menu" action="base.action_res_bank_form" parent="bank_account_account_config_menu" sequence="10"/>
|
||||||
|
|
||||||
|
<menuitem id="res_partner_bank_account_config_menu" action="base.action_res_partner_bank_account_form" parent="bank_account_account_config_menu" sequence="20"/>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py
|
|
||||||
index 2dd1f9cef83..62275fca65e 100644
|
|
||||||
--- a/addons/account/models/account_payment.py
|
|
||||||
+++ b/addons/account/models/account_payment.py
|
|
||||||
@@ -262,6 +262,7 @@ class AccountPayment(models.Model):
|
|
||||||
'credit': write_off_balance > 0.0 and write_off_balance or 0.0,
|
|
||||||
'partner_id': self.partner_id.id,
|
|
||||||
'account_id': write_off_line_vals.get('account_id'),
|
|
||||||
+ 'analytic_account_id': write_off_line_vals.get('analytic_account_id'),
|
|
||||||
})
|
|
||||||
return line_vals_list
|
|
||||||
|
|
||||||
@@ -699,6 +700,7 @@ class AccountPayment(models.Model):
|
|
||||||
'name': writeoff_lines[0].name,
|
|
||||||
'amount': writeoff_amount * sign,
|
|
||||||
'account_id': writeoff_lines[0].account_id.id,
|
|
||||||
+ 'analytic_account_id': writeoff_lines[0].analytic_account_id.id,
|
|
||||||
}
|
|
||||||
else:
|
|
||||||
write_off_line_vals = {}
|
|
||||||
diff --git a/addons/account/wizard/account_payment_register.py b/addons/account/wizard/account_payment_register.py
|
|
||||||
index 3fc91f716ad..35636774c7e 100644
|
|
||||||
--- a/addons/account/wizard/account_payment_register.py
|
|
||||||
+++ b/addons/account/wizard/account_payment_register.py
|
|
||||||
@@ -93,6 +93,7 @@ class AccountPaymentRegister(models.TransientModel):
|
|
||||||
], default='open', string="Payment Difference Handling")
|
|
||||||
writeoff_account_id = fields.Many2one('account.account', string="Difference Account", copy=False,
|
|
||||||
domain="[('deprecated', '=', False), ('company_id', '=', company_id)]")
|
|
||||||
+ writeoff_analytic_account_id = fields.Many2one('account.analytic.account', string="Difference Analytic Account", copy=False, domain="[('company_id', '=', company_id)]")
|
|
||||||
writeoff_label = fields.Char(string='Journal Item Label', default='Write-Off',
|
|
||||||
help='Change label of the counterpart that will hold the payment difference')
|
|
||||||
|
|
||||||
@@ -422,6 +423,7 @@ class AccountPaymentRegister(models.TransientModel):
|
|
||||||
'name': self.writeoff_label,
|
|
||||||
'amount': self.payment_difference,
|
|
||||||
'account_id': self.writeoff_account_id.id,
|
|
||||||
+ 'analytic_account_id': self.writeoff_analytic_account_id.id or False,
|
|
||||||
}
|
|
||||||
return payment_vals
|
|
||||||
|
|
||||||
diff --git a/addons/account/wizard/account_payment_register_views.xml b/addons/account/wizard/account_payment_register_views.xml
|
|
||||||
index 16eec30e265..b9386567baa 100644
|
|
||||||
--- a/addons/account/wizard/account_payment_register_views.xml
|
|
||||||
+++ b/addons/account/wizard/account_payment_register_views.xml
|
|
||||||
@@ -65,6 +65,10 @@
|
|
||||||
string="Post Difference In"
|
|
||||||
options="{'no_create': True}"
|
|
||||||
attrs="{'required': [('payment_difference_handling', '=', 'reconcile')]}"/>
|
|
||||||
+ <label for="writeoff_analytic_account_id" class="oe_edit_only" string="Analytic Account" groups="analytic.group_analytic_accounting"/>
|
|
||||||
+ <field name="writeoff_analytic_account_id"
|
|
||||||
+ groups="analytic.group_analytic_accounting"
|
|
||||||
+ options="{'no_create': True}" />
|
|
||||||
<label for="writeoff_label" class="oe_edit_only" string="Label"/>
|
|
||||||
<field name="writeoff_label" attrs="{'required': [('payment_difference_handling', '=', 'reconcile')]}"/>
|
|
||||||
</div>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
from . import account_account
|
|
||||||
from . import account_analytic_account
|
|
||||||
from . import account_bank_statement
|
|
||||||
from . import account_incoterms
|
|
||||||
from . import account_journal
|
|
||||||
from . import account_move
|
|
||||||
from . import account_partial_reconcile
|
|
||||||
from . import res_partner
|
|
||||||
from . import product
|
|
||||||
@@ -1,66 +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).
|
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from odoo import api, models
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
class AccountAccount(models.Model):
|
|
||||||
_inherit = "account.account"
|
|
||||||
|
|
||||||
@api.depends("name", "code")
|
|
||||||
def name_get(self):
|
|
||||||
if self._context.get("account_account_show_code_only"):
|
|
||||||
res = []
|
|
||||||
for record in self:
|
|
||||||
res.append((record.id, record.code))
|
|
||||||
return res
|
|
||||||
else:
|
|
||||||
return super().name_get()
|
|
||||||
|
|
||||||
# https://github.com/odoo/odoo/issues/23040
|
|
||||||
# TODO mig to v14 ?
|
|
||||||
def fix_bank_account_types(self):
|
|
||||||
aao = self.env["account.account"]
|
|
||||||
companies = self.env["res.company"].search([])
|
|
||||||
if len(companies) > 1:
|
|
||||||
self = self.sudo()
|
|
||||||
logger.info("START the script 'fix bank and cash account types'")
|
|
||||||
bank_type = self.env.ref("account.data_account_type_liquidity")
|
|
||||||
asset_type = self.env.ref("account.data_account_type_current_assets")
|
|
||||||
journals = self.env["account.journal"].search(
|
|
||||||
[("type", "in", ("bank", "cash"))], order="company_id"
|
|
||||||
)
|
|
||||||
journal_accounts_bank_type = aao
|
|
||||||
for journal in journals:
|
|
||||||
for account in [
|
|
||||||
journal.default_credit_account_id,
|
|
||||||
journal.default_debit_account_id,
|
|
||||||
]:
|
|
||||||
if account:
|
|
||||||
if account.user_type_id != bank_type:
|
|
||||||
account.user_type_id = bank_type.id
|
|
||||||
logger.info(
|
|
||||||
"Company %s: Account %s updated to Bank " "and Cash type",
|
|
||||||
account.company_id.display_name,
|
|
||||||
account.code,
|
|
||||||
)
|
|
||||||
if account not in journal_accounts_bank_type:
|
|
||||||
journal_accounts_bank_type += account
|
|
||||||
accounts = aao.search(
|
|
||||||
[("user_type_id", "=", bank_type.id)], order="company_id, code"
|
|
||||||
)
|
|
||||||
for account in accounts:
|
|
||||||
if account not in journal_accounts_bank_type:
|
|
||||||
account.user_type_id = asset_type.id
|
|
||||||
logger.info(
|
|
||||||
"Company %s: Account %s updated to Current Asset type",
|
|
||||||
account.company_id.display_name,
|
|
||||||
account.code,
|
|
||||||
)
|
|
||||||
logger.info("END of the script 'fix bank and cash account types'")
|
|
||||||
return True
|
|
||||||
@@ -1,27 +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).
|
|
||||||
|
|
||||||
from odoo import models
|
|
||||||
|
|
||||||
|
|
||||||
class AccountAnalyticAccount(models.Model):
|
|
||||||
_inherit = "account.analytic.account"
|
|
||||||
|
|
||||||
def name_get(self):
|
|
||||||
if self._context.get("analytic_account_show_code_only"):
|
|
||||||
res = []
|
|
||||||
for record in self:
|
|
||||||
res.append((record.id, record.code or record.name))
|
|
||||||
return res
|
|
||||||
else:
|
|
||||||
return super().name_get()
|
|
||||||
|
|
||||||
_sql_constraints = [
|
|
||||||
(
|
|
||||||
"code_company_unique",
|
|
||||||
"unique(code, company_id)",
|
|
||||||
"An analytic account with the same code already "
|
|
||||||
"exists in the same company!",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user