Compare commits
1035 Commits
10-account
...
18.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1fc0f77dcb | ||
|
|
705331f674 | ||
|
|
54025fe620 | ||
|
|
929a9418a7 | ||
|
|
cddecdf569 | ||
|
|
17541b3369 | ||
|
|
a0710bc3ad | ||
|
|
ecb7262e5c | ||
|
|
8cd07c93e9 | ||
|
|
e01d2440ac | ||
|
|
940c13b449 | ||
|
|
1cea91eeaa | ||
|
|
2a008a303c | ||
|
|
743c2dad84 | ||
|
|
d47c62dbed | ||
|
|
c5c3319963 | ||
|
|
8df73ed96a | ||
|
|
e89c1a0f9c | ||
|
|
29678e2de3 | ||
|
|
54c6eac6fd | ||
|
|
32814194df | ||
|
|
7126cfee72 | ||
|
|
a78cf95b43 | ||
|
|
cefcb1b5c2 | ||
|
|
36b35f1b87 | ||
|
|
f1f808d977 | ||
|
|
11f3d393b5 | ||
|
|
ca5730c701 | ||
|
|
76a1bbd9f4 | ||
|
|
48d5a3b327 | ||
|
|
836a88dfeb | ||
|
|
8182b839d4 | ||
|
|
6cd86f8820 | ||
|
|
76e93f0379 | ||
|
|
d9f65b96fc | ||
|
|
a729762b4a | ||
|
|
18551f9b0d | ||
|
|
05b2d14cd2 | ||
|
|
1d57615b97 | ||
|
|
545cd797e3 | ||
|
|
70b66681d6 | ||
|
|
2e93aaa55b | ||
|
|
5b6a166ed6 | ||
|
|
a76cb62bea | ||
|
|
03c3f8c15d | ||
|
|
6d855f4397 | ||
|
|
9fc47065ff | ||
|
|
89f9a2afa3 | ||
|
|
6ff99bd91f | ||
|
|
66f72145d5 | ||
|
|
a6f1d4a230 | ||
|
|
4abcac94d5 | ||
|
|
30d16837ed | ||
|
|
9068bf1d97 | ||
|
|
d0f9ce3d62 | ||
|
|
b0961e4f8d | ||
|
|
ea4b698590 | ||
|
|
a0aec274a5 | ||
|
|
65458407b7 | ||
|
|
62ca33ed4b | ||
|
|
dbc2b3ddcc | ||
|
|
8d5a23b478 | ||
|
|
fae6bf361a | ||
|
|
b51c1ff7d9 | ||
|
|
bdf4a527de | ||
|
|
8e5d3b8a74 | ||
|
|
b9d313fa8c | ||
|
|
37fb616524 | ||
|
|
88f6521964 | ||
|
|
ab7ec7829d | ||
|
|
f9f06d83e2 | ||
|
|
47cf7389cc | ||
|
|
29a2739c18 | ||
|
|
13744fc404 | ||
|
|
9913924202 | ||
|
|
cc29d1d29f | ||
|
|
7b55172537 | ||
|
|
5f227f9b72 | ||
|
|
c6fb47c1e2 | ||
|
|
c0edd6fa57 | ||
|
|
9ea7a79d21 | ||
|
|
d9b43df0f1 | ||
|
|
ba7406290b | ||
|
|
5af6c895d0 | ||
|
|
7bdd579b1c | ||
|
|
c9f0569516 | ||
|
|
c37b607f97 | ||
|
|
5f4929f819 | ||
|
|
59c7084159 | ||
|
|
a2952ca6b2 | ||
|
|
f5b8f1674a | ||
|
|
e22badc605 | ||
|
|
f93f17b27b | ||
|
|
74586cff13 | ||
|
|
48c0e02e94 | ||
|
|
a035748c2d | ||
|
|
594c3fb0ed | ||
|
|
02c082f966 | ||
|
|
97cf376e90 | ||
|
|
c3f007e716 | ||
|
|
a333bc4e84 | ||
|
|
9e5670934e | ||
|
|
c74a647945 | ||
|
|
fca7209056 | ||
|
|
6d9b4c92eb | ||
|
|
68327c28b6 | ||
|
|
592e40637a | ||
|
|
b6624f2491 | ||
|
|
3a11c99ccb | ||
|
|
36f277940c | ||
|
|
c09e3a1108 | ||
|
|
3b5b64349b | ||
|
|
efddeb3a3c | ||
|
|
c126a286c4 | ||
|
|
670ba212d9 | ||
|
|
c26ed6cdfb | ||
|
|
dd0841385f | ||
|
|
b91abe54a5 | ||
|
|
210af49098 | ||
|
|
19158d9309 | ||
|
|
4577524f0e | ||
|
|
8fd0cb5601 | ||
|
|
8d584871d6 | ||
|
|
a7fd6a1361 | ||
|
|
2b2293593c | ||
|
|
f1614afda2 | ||
|
|
227a7ec18d | ||
|
|
827557689f | ||
|
|
67ff087f6e | ||
|
|
9507be2943 | ||
|
|
740d167331 | ||
|
|
d07e38e1f3 | ||
|
|
55b84a170e | ||
|
|
252da11a30 | ||
|
|
4ee69f3bff | ||
|
|
46fcf5c0ef | ||
|
|
2c794033b0 | ||
|
|
2f784eb1a0 | ||
|
|
b019baed6e | ||
|
|
5532a8e165 | ||
|
|
a4c2a43cf7 | ||
|
|
f9246c6988 | ||
|
|
8364b42930 | ||
|
|
df370f4948 | ||
|
|
282f48db3e | ||
|
|
73c3c1a664 | ||
|
|
ac0afd6e2b | ||
|
|
a61d1458d8 | ||
|
|
0756beb8f5 | ||
|
|
0656d319ce | ||
|
|
a517fe67a8 | ||
|
|
2953baba22 | ||
|
|
5ea3f5adfd | ||
|
|
92a1b511c1 | ||
|
|
5ad925cee1 | ||
|
|
b8e335fb10 | ||
|
|
c693ccc62c | ||
|
|
983a25367f | ||
|
|
e36f88e23a | ||
|
|
18e9ed99ff | ||
|
|
dea732e270 | ||
|
|
150916200d | ||
|
|
48247b6d06 | ||
|
|
1971808c7d | ||
|
|
5724d31ac1 | ||
|
|
3ecfde15f0 | ||
|
|
44fedbf72e | ||
|
|
5f731d18f1 | ||
|
|
7477deeae3 | ||
|
|
2905b5f426 | ||
|
|
42287c674a | ||
|
|
01eff33bcb | ||
|
|
14bb6c5834 | ||
|
|
695eaed6b9 | ||
|
|
2a862a96d5 | ||
|
|
e435a250f3 | ||
|
|
facd3adf74 | ||
|
|
e5393eb88d | ||
|
|
2764390d40 | ||
|
|
d87ff61f2f | ||
|
|
a1f8185549 | ||
|
|
2997154c49 | ||
|
|
db24e73175 | ||
|
|
1e19fc906c | ||
|
|
b954772126 | ||
|
|
3f16203ffc | ||
|
|
21f5b53f8b | ||
|
|
02970847f4 | ||
|
|
16f5c9e955 | ||
|
|
875eadc516 | ||
|
|
f9f5d2e1b9 | ||
|
|
795e9a1737 | ||
|
|
492a7275c2 | ||
|
|
16c4b1cebe | ||
|
|
aad5fa4ff0 | ||
|
|
a0c1d5f55f | ||
|
|
a63c35fcbf | ||
|
|
03d045be1c | ||
|
|
a86f90b382 | ||
|
|
4aaee98c43 | ||
|
|
62627a63a6 | ||
|
|
6d69bc659e | ||
|
|
767c6a7fd9 | ||
|
|
fbdf814cb0 | ||
|
|
5c14e3199e | ||
|
|
70957e8404 | ||
|
|
6025575ae4 | ||
|
|
8486c75f90 | ||
|
|
a7a1eefb15 | ||
|
|
fe6a332ba9 | ||
|
|
bbb0cb17f7 | ||
|
|
71ebe2adea | ||
|
|
367cb1af93 | ||
|
|
a9292506ae | ||
|
|
15c77b3e8a | ||
|
|
4f13432bdc | ||
|
|
9aac933dcb | ||
|
|
deb37a1688 | ||
|
|
6d3e4d83c7 | ||
|
|
58afed17e5 | ||
|
|
b1b4620cdc | ||
|
|
164397fbac | ||
|
|
3ae427c5de | ||
|
|
db2cd72d04 | ||
|
|
44a92bde2d | ||
|
|
da8849e745 | ||
|
|
23222e997b | ||
|
|
3259a667eb | ||
|
|
9aa65925a9 | ||
|
|
f23aa52b08 | ||
|
|
f4687b886c | ||
|
|
daddd6c17c | ||
|
|
b790aac9d8 | ||
|
|
ca61dbce3f | ||
|
|
6242dec047 | ||
|
|
7b0e4bcb55 | ||
|
|
6c04b2dd5a | ||
|
|
01e209ed43 | ||
|
|
a69556bad0 | ||
|
|
82da5e1afb | ||
|
|
fd5e620373 | ||
|
|
9589db3abe | ||
|
|
c51a847f80 | ||
|
|
a800657f54 | ||
|
|
5fbe6d340a | ||
|
|
f3874a5903 | ||
|
|
f0faa58830 | ||
|
|
b38fc99978 | ||
|
|
372a18365c | ||
|
|
27d86cf151 | ||
|
|
d67141e128 | ||
|
|
02450832cb | ||
|
|
627c5980c9 | ||
|
|
6f27b13bf9 | ||
|
|
1de8676d4e | ||
|
|
9139955fac | ||
|
|
a5b5dd83a2 | ||
|
|
5f704d34a7 | ||
|
|
9087296a54 | ||
|
|
4ac5c23b30 | ||
|
|
403b24ffc1 | ||
|
|
85f8fe5b30 | ||
|
|
fde3dfae10 | ||
|
|
4f90a7fd91 | ||
|
|
1fd25be02f | ||
|
|
174fac6d88 | ||
|
|
9507d1fbd8 | ||
|
|
a89f1a9ae7 | ||
|
|
abb36545d9 | ||
|
|
296746ce6e | ||
|
|
d0a9ec27ef | ||
|
|
d3989e96d7 | ||
|
|
f1a0aa6253 | ||
|
|
c7bd3319a9 | ||
|
|
fe96425d84 | ||
|
|
a59c2e774a | ||
|
|
cad0654983 | ||
|
|
55622ec6a9 | ||
|
|
f166fe93be | ||
|
|
b8a6cbcfea | ||
|
|
f6b10a7caa | ||
|
|
371229e9e5 | ||
|
|
1dbfd23524 | ||
|
|
9a9459f013 | ||
|
|
5a58ae0d9a | ||
|
|
b162227645 | ||
|
|
3c24e94122 | ||
|
|
400f316c7f | ||
|
|
86af01667a | ||
|
|
8967bf289a | ||
|
|
1fdaf52787 | ||
|
|
6907302f8e | ||
|
|
a3e23ab5e7 | ||
|
|
686c6f3900 | ||
|
|
a850586716 | ||
|
|
fdef51ea57 | ||
|
|
806389e04b | ||
|
|
c12b496004 | ||
|
|
447b0107be | ||
|
|
f9a7983d71 | ||
|
|
870746b965 | ||
|
|
f22c6522d5 | ||
|
|
1ef97629b7 | ||
|
|
77a372b3ca | ||
|
|
221b090cc8 | ||
|
|
e4a2ff5bd4 | ||
|
|
c1d334b109 | ||
|
|
c7c9b2d341 | ||
|
|
eddab6020a | ||
|
|
d1181ca91d | ||
|
|
df673718e5 | ||
|
|
bb83765ee2 | ||
|
|
88615a0774 | ||
|
|
05e649fa86 | ||
|
|
08118ec4f5 | ||
|
|
6d496ba302 | ||
|
|
40b79890fe | ||
|
|
58b8d300b8 | ||
|
|
cdcf4eb406 | ||
|
|
a22f79ef44 | ||
|
|
99dd4de4f7 | ||
|
|
f3d6b67043 | ||
|
|
1963af114b | ||
|
|
1da4c40927 | ||
|
|
edc9db5839 | ||
|
|
882d068f1a | ||
|
|
878db1d0a1 | ||
|
|
600acd2f26 | ||
|
|
059c3b4a09 | ||
|
|
895e1d9dd0 | ||
|
|
0b3ffc804f | ||
|
|
c0a03dbb0e | ||
|
|
6e5f263283 | ||
|
|
d4ebbb28d9 | ||
|
|
7dd204e57e | ||
|
|
e1a84973da | ||
|
|
13e68ac0f5 | ||
|
|
3b17c2e5fb | ||
|
|
0be112dc84 | ||
|
|
ce2255623d | ||
|
|
2854d4fdda | ||
|
|
6c51a92acc | ||
|
|
f3910ab528 | ||
|
|
05374c4b4a | ||
|
|
279dc7c6c0 | ||
|
|
f6ddbb48ac | ||
|
|
d3bddf5fda | ||
|
|
6f3a468a7c | ||
|
|
0bfa960153 | ||
|
|
a520ccff51 | ||
|
|
fa7611eb08 | ||
|
|
b2eda2a23b | ||
|
|
74ff1b5cb5 | ||
|
|
a7b4ed65eb | ||
|
|
7dfb32c2d6 | ||
|
|
d081bb0fd2 | ||
|
|
f3fdbec140 | ||
|
|
ac54c5cc75 | ||
|
|
78c11411c3 | ||
|
|
28ce11b216 | ||
|
|
00e034dacf | ||
|
|
8510b9518a | ||
|
|
15ef5df155 | ||
|
|
45500f5bd8 | ||
|
|
a28a853f45 | ||
|
|
82b9a1e502 | ||
|
|
b05abba064 | ||
|
|
75e3463a76 | ||
|
|
3066c0545d | ||
|
|
62a84469c8 | ||
|
|
00339e44b6 | ||
|
|
d1ae620079 | ||
|
|
3db9f0f096 | ||
|
|
732ee2c55b | ||
|
|
e08d658b25 | ||
|
|
2a7ec92a37 | ||
|
|
dc30ce4e69 | ||
|
|
32d45d228b | ||
|
|
939de0c9bd | ||
|
|
48a19b8f97 | ||
|
|
8a2e662d43 | ||
|
|
de2e5f2121 | ||
|
|
42e014bcb1 | ||
|
|
e70e3b23cf | ||
|
|
50b4944c8b | ||
|
|
96bfda6e1b | ||
|
|
cfb58ed80f | ||
|
|
91e9c1fe33 | ||
|
|
dff4e47cf5 | ||
|
|
452cc399c5 | ||
|
|
f4c22501a7 | ||
|
|
9e8874eb4b | ||
|
|
fc6c0384ed | ||
|
|
96bd915c4f | ||
|
|
f61296cafc | ||
|
|
b585d06489 | ||
|
|
cef81ad749 | ||
|
|
7c1a2fabd3 | ||
|
|
c3f72a9b68 | ||
|
|
a0d73834ad | ||
|
|
66ebc5c6ad | ||
|
|
5c06d79b69 | ||
|
|
034c89b399 | ||
|
|
6356171619 | ||
|
|
771001ca2e | ||
|
|
45d734badf | ||
|
|
0d4ff37786 | ||
|
|
9c30d4ef53 | ||
|
|
b2ce8f0aca | ||
|
|
183bba3752 | ||
|
|
92742dfc9d | ||
|
|
f30bf4791a | ||
|
|
ca6de3adf6 | ||
|
|
5e2d25f7c4 | ||
|
|
d64262099b | ||
|
|
6ad589d4bd | ||
|
|
5496aa38f8 | ||
|
|
b7c0b4720c | ||
|
|
bd25fe4866 | ||
|
|
c3da933e62 | ||
|
|
1d8a72828c | ||
|
|
20af679569 | ||
|
|
48dc98d08b | ||
|
|
835a7e3c35 | ||
|
|
a3cac9e82d | ||
|
|
a90965109d | ||
|
|
6682c9e048 | ||
|
|
5a9476422c | ||
|
|
bf27beadae | ||
|
|
3b67f46b4c | ||
|
|
dd00d34d43 | ||
|
|
94ca97d3f0 | ||
|
|
3d4354cd67 | ||
|
|
cb625d4e1a | ||
|
|
ee0dfb29d6 | ||
|
|
78ef2a0ebe | ||
|
|
977dae3eae | ||
|
|
210ac987a0 | ||
|
|
ad362a11ce | ||
|
|
c268e28b3d | ||
|
|
9aa4613dd7 | ||
|
|
4d177801c5 | ||
|
|
937a4e612f | ||
|
|
7e461670dd | ||
|
|
87341b2cf3 | ||
|
|
dc45655441 | ||
|
|
25df0f8837 | ||
|
|
0acc4a3439 | ||
|
|
dbc0f07caa | ||
|
|
aeaa699638 | ||
|
|
40dc5485a9 | ||
|
|
eb91ae6a48 | ||
|
|
82f5f56438 | ||
|
|
e8e2ccd1c2 | ||
|
|
6711001019 | ||
|
|
acb0c88ce1 | ||
|
|
444786c971 | ||
|
|
1783ceb26a | ||
|
|
4feb258814 | ||
|
|
75b8bef3c4 | ||
|
|
17549ca457 | ||
|
|
d72872eb90 | ||
|
|
86ec56b610 | ||
|
|
7110f5afcc | ||
|
|
92cf447add | ||
|
|
e060de7efc | ||
|
|
f818bb5895 | ||
|
|
44a4f795d0 | ||
|
|
e505e7e07f | ||
|
|
f3782cfa2b | ||
|
|
9592097487 | ||
|
|
03a57798b6 | ||
|
|
22e9234d23 | ||
|
|
ac89271d5b | ||
|
|
261442d903 | ||
|
|
d63c4b2433 | ||
|
|
4dadc8047e | ||
|
|
34ec0dfa27 | ||
|
|
7a6600431c | ||
|
|
341717b75d | ||
|
|
1061111f9b | ||
|
|
d28a40e035 | ||
|
|
3f06231c22 | ||
|
|
67d31f9658 | ||
|
|
1b931d066b | ||
|
|
f605b56a5e | ||
|
|
58f01d9673 | ||
|
|
8878ab5bd1 | ||
|
|
80f5341da0 | ||
|
|
a4ca584e90 | ||
|
|
4d81dee7b4 | ||
|
|
140217da6e | ||
|
|
a9a0a2a999 | ||
|
|
d7f3a70d48 | ||
|
|
1074fcba21 | ||
|
|
0ae76be885 | ||
|
|
59cdcbd173 | ||
|
|
7cf224cf23 | ||
|
|
d0d65ebbca | ||
|
|
ca10381be8 | ||
|
|
44b19dfe60 | ||
|
|
c082baa340 | ||
|
|
15ee1b2f59 | ||
|
|
b080dd11ab | ||
|
|
568e6b41ac | ||
|
|
0dee23aeba | ||
|
|
c7d1e13d0d | ||
|
|
e7fae291ee | ||
|
|
bdfe0ce20a | ||
|
|
32eafedf04 | ||
|
|
ba78791ab1 | ||
|
|
946d169665 | ||
|
|
cd51a6784f | ||
|
|
c01942b1a8 | ||
|
|
e11b29deab | ||
|
|
28be3e4e6a | ||
|
|
5c7985a15c | ||
|
|
9b6c34a860 | ||
|
|
f735f8a34d | ||
|
|
74665bb2e8 | ||
|
|
d1deeeac31 | ||
|
|
e96c3d72eb | ||
|
|
a545c8dbb6 | ||
|
|
07824a0570 | ||
|
|
12bd157ad4 | ||
|
|
53f6ab5d0f | ||
|
|
cc88dd994b | ||
|
|
b99659dcc9 | ||
|
|
581bfe78d8 | ||
|
|
9a174c257d | ||
|
|
941c610c96 | ||
|
|
34a4c573b1 | ||
|
|
f64d190ac3 | ||
|
|
c633660e73 | ||
|
|
0dfe8df8e4 | ||
|
|
0e4a562263 | ||
|
|
253a5ebebe | ||
|
|
73c622956f | ||
|
|
38db0da20a | ||
|
|
361f5d3aae | ||
|
|
499d363daf | ||
|
|
035a3dfd1e | ||
|
|
83fec9264f | ||
|
|
9762b5392b | ||
|
|
fc4ea217e0 | ||
|
|
1812c7f5af | ||
|
|
92a4b0d6ac | ||
|
|
33f67279fb | ||
|
|
66c845f3cf | ||
|
|
8a9c75790a | ||
|
|
0de8425cfa | ||
|
|
f8563c1667 | ||
|
|
60cda426a9 | ||
|
|
fe7f2c00c5 | ||
|
|
76b113ed28 | ||
|
|
5140094633 | ||
|
|
e220da006f | ||
|
|
c5ffe375a5 | ||
|
|
dd8487bf0f | ||
|
|
a62d1e01f4 | ||
|
|
e397f3908e | ||
|
|
7b51c993ec | ||
|
|
f480332d3a | ||
|
|
2f875867c5 | ||
|
|
e9049570ee | ||
|
|
52eff801b6 | ||
|
|
d84ef2e8c5 | ||
|
|
9298378e62 | ||
|
|
a7f5e10be4 | ||
|
|
ea5f679a59 | ||
|
|
d63706f764 | ||
|
|
d9b8da5799 | ||
|
|
4896075c7d | ||
|
|
78b0e416fa | ||
|
|
beb0a27ad6 | ||
|
|
5b620a6c5f | ||
|
|
8c1089e138 | ||
|
|
765be077cd | ||
|
|
4f6dc99319 | ||
|
|
59b0a5ac10 | ||
|
|
2d755be1d7 | ||
|
|
61768a34e9 | ||
|
|
140f2d54ee | ||
|
|
e4d4bcd7ca | ||
|
|
e193df7def | ||
|
|
cadbd840d9 | ||
|
|
3052d7c905 | ||
|
|
f59f2ad8ec | ||
|
|
fa22c63176 | ||
|
|
4437afb7d5 | ||
|
|
b762af222d | ||
|
|
f258bf6fdb | ||
|
|
43c60dcb30 | ||
|
|
f4f99647d2 | ||
|
|
a75e14dc8d | ||
|
|
dbd600bcd9 | ||
|
|
4b442bd11b | ||
|
|
d2978475b8 | ||
|
|
c57d2a0564 | ||
|
|
7e0c438ae8 | ||
|
|
7d7a42ba8e | ||
|
|
a21ec776c1 | ||
|
|
62d0af15ac | ||
|
|
24c4dd0225 | ||
|
|
16c2833252 | ||
|
|
f9552e7271 | ||
|
|
19ad0eff78 | ||
|
|
9f28bc6703 | ||
|
|
11ae6e1297 | ||
|
|
b2bf902a78 | ||
|
|
790c55e607 | ||
|
|
694a0d4d29 | ||
|
|
c2ed859534 | ||
|
|
a4765c6cb2 | ||
|
|
9cb99db2b3 | ||
|
|
8b0e59b22f | ||
|
|
dccfead879 | ||
|
|
9cae5e00b6 | ||
|
|
620b459415 | ||
|
|
2062a1f307 | ||
|
|
79172fcc45 | ||
|
|
d937d954ab | ||
|
|
3bb11966dd | ||
|
|
0bd3b0412c | ||
|
|
5a72d2b1b9 | ||
|
|
682f85b2d7 | ||
|
|
087e4d6333 | ||
|
|
d5bf1f1a24 | ||
|
|
317d4fdd42 | ||
|
|
9657f1bcfd | ||
|
|
dc95c30f60 | ||
|
|
2fb715905a | ||
|
|
60a5fa7a33 | ||
|
|
06e0617026 | ||
|
|
fa3e483026 | ||
|
|
1957018a14 | ||
|
|
cfebb6c99c | ||
|
|
cd745c74a9 | ||
|
|
e1f9f2ea92 | ||
|
|
ce08af35bf | ||
|
|
475993422e | ||
|
|
ce4fac8a10 | ||
|
|
a848181bee | ||
|
|
13b9109fc0 | ||
|
|
ec0e3c1868 | ||
|
|
b42474a3c2 | ||
|
|
e5323fb968 | ||
|
|
d806fa48f4 | ||
|
|
c38d533557 | ||
|
|
4c145c12af | ||
|
|
0a2f129ed8 | ||
|
|
4d75ef9fb5 | ||
|
|
bebc328a7b | ||
|
|
08fde42217 | ||
|
|
a3f4f94109 | ||
|
|
4e1b285204 | ||
|
|
71e30f2872 | ||
|
|
8e4798dbfc | ||
|
|
0ffa8b19ea | ||
|
|
0422c16c97 | ||
|
|
67f0690659 | ||
|
|
2e2aff229e | ||
|
|
8aa2f60763 | ||
|
|
55b9b1a619 | ||
|
|
7165d113b6 | ||
|
|
ea471c2e01 | ||
|
|
7997f267b7 | ||
|
|
8dc9fdcfa0 | ||
|
|
3bd50e49eb | ||
|
|
4733b6b903 | ||
|
|
c0ca9eeab0 | ||
|
|
8e29f5a396 | ||
|
|
29c41d9dea | ||
|
|
953ca6d01e | ||
|
|
e57122de31 | ||
|
|
82bc47905b | ||
|
|
730a3e99bf | ||
|
|
e5072cbb63 | ||
|
|
5378ad8ee6 | ||
|
|
66174e1cb0 | ||
|
|
2db41cfd6f | ||
|
|
5d440b3c61 | ||
|
|
41882b3529 | ||
|
|
eab4cdf17f | ||
|
|
120a1b8c16 | ||
|
|
ba19c3c76f | ||
|
|
3e26d60503 | ||
|
|
92ef5170e0 | ||
|
|
8eb0f8b6a2 | ||
|
|
b29c938044 | ||
|
|
7f0ff6e36e | ||
|
|
119bb936fa | ||
|
|
31c67cb923 | ||
|
|
e7638c239f | ||
|
|
528438586c | ||
|
|
f07d416034 | ||
|
|
905437e026 | ||
|
|
9f1cf7af1e | ||
|
|
1a193dcbec | ||
|
|
92a175ea97 | ||
|
|
80843719a6 | ||
|
|
ee3b872e66 | ||
|
|
c199853d4e | ||
|
|
1491cbd2d0 | ||
|
|
f8c1ba6c28 | ||
|
|
51b49249f0 | ||
|
|
66532aec75 | ||
|
|
813c123517 | ||
|
|
90271a7ffe | ||
|
|
5ad4c6fb4a | ||
|
|
12d9393279 | ||
|
|
30e62353e6 | ||
|
|
1070c68c55 | ||
|
|
49e9cd0d06 | ||
|
|
441df56422 | ||
|
|
94959f459a | ||
|
|
ec40108896 | ||
|
|
f651126f25 | ||
|
|
edf701d79c | ||
|
|
b31082377d | ||
|
|
6e0907dabe | ||
|
|
ab7c61b796 | ||
|
|
400a633753 | ||
|
|
2a97ffb6d9 | ||
|
|
c5548caee4 | ||
|
|
f880c02038 | ||
|
|
af4c5a20cc | ||
|
|
d722727918 | ||
|
|
51eb9c4a58 | ||
|
|
fbb05fe4c6 | ||
|
|
0767469cd6 | ||
|
|
924f332702 | ||
|
|
02c0fbdf4e | ||
|
|
6100e65a8a | ||
|
|
0dd436a2c8 | ||
|
|
faabfe2659 | ||
|
|
76538eecd5 | ||
|
|
9a48f7d3b8 | ||
|
|
1e5024d02e | ||
|
|
ae632f3cf9 | ||
|
|
55929f4b26 | ||
|
|
fbbd1beb08 | ||
|
|
400a084d9b | ||
|
|
532e2637dc | ||
|
|
dd8bae81be | ||
|
|
30d92b40f2 | ||
|
|
fcf5081531 | ||
|
|
6f75c06889 | ||
|
|
ec9b7ee02d | ||
|
|
d9df99789d | ||
|
|
5fd36697c4 | ||
|
|
224fb7c189 | ||
|
|
2e601e75fd | ||
|
|
19f7f8c74a | ||
|
|
5955d15934 | ||
|
|
5ca272565e | ||
|
|
6f702d8b70 | ||
|
|
4b0d3f9796 | ||
|
|
d30c0f9b37 | ||
|
|
fe727a92bc | ||
|
|
034f01287b | ||
|
|
54bd62d2d9 | ||
|
|
0ca880add4 | ||
|
|
618ced700a | ||
|
|
7b6fae6247 | ||
|
|
760ba7877e | ||
|
|
17d8964db8 | ||
|
|
2107b52fe6 | ||
|
|
ecf4634601 | ||
|
|
e0f627c48b | ||
|
|
d850162da8 | ||
|
|
bda4fccb32 | ||
|
|
29741ebd68 | ||
|
|
6eeaffa8c4 | ||
|
|
7fd2d26336 | ||
|
|
fe21c5f8af | ||
|
|
f3172cd715 | ||
|
|
07d2f238d1 | ||
|
|
90f439e045 | ||
|
|
0a8e3c4452 | ||
|
|
91d4a8c767 | ||
|
|
67bbee61a0 | ||
|
|
1748663a42 | ||
|
|
ba821dbd06 | ||
|
|
a5bd385e45 | ||
|
|
b6accd6edd | ||
|
|
b0be02ea48 | ||
|
|
274bca281a | ||
|
|
9aa723bf06 | ||
|
|
dc90787030 | ||
|
|
a138418518 | ||
|
|
354c8d7b34 | ||
|
|
c831a25c92 | ||
|
|
68f4c183e2 | ||
|
|
414b939623 | ||
|
|
1c523cfdcb | ||
|
|
da93011a07 | ||
|
|
4cb0c3e77c | ||
|
|
b656c9b930 | ||
|
|
37252b1e6a | ||
|
|
6d62bcce06 | ||
|
|
990855baaa | ||
|
|
e0df8d1763 | ||
|
|
e3ed65d296 | ||
|
|
eaa64ce5f2 | ||
|
|
c64f09f830 | ||
|
|
54c762ebaf | ||
|
|
b7b42f12fe | ||
|
|
83acc2822d | ||
|
|
fdce87925b | ||
|
|
0d54c5c91f | ||
|
|
4d892552b0 | ||
|
|
36716f063f | ||
|
|
2eda6328c9 | ||
|
|
582b1c4275 | ||
|
|
27e876e0c8 | ||
|
|
4c12fd0b29 | ||
|
|
91320397e3 | ||
|
|
7cb3b37766 | ||
|
|
21fce89b15 | ||
|
|
6b01a881b0 | ||
|
|
64b340e585 | ||
|
|
a7bcc3eaf5 | ||
|
|
ef5779cedb | ||
|
|
74c399009a | ||
|
|
8c19bd1b25 | ||
|
|
e786204d06 | ||
|
|
0e60089010 | ||
|
|
f69c634c71 | ||
|
|
17948ce2ef | ||
|
|
b90bda2aab | ||
|
|
e98249f016 | ||
|
|
29d84c5e2b | ||
|
|
af4a7798b2 | ||
|
|
4f7abe3354 | ||
|
|
5707feeb42 | ||
|
|
a3475adc83 | ||
|
|
3bc744f143 | ||
|
|
f1ad1dd547 | ||
|
|
7f239bdc87 | ||
|
|
53da0d37a2 | ||
|
|
da85c222e9 | ||
|
|
53a1f50f10 | ||
|
|
d7085dad70 | ||
|
|
8b361d54e1 | ||
|
|
0bf83bab19 | ||
|
|
7d51c25430 | ||
|
|
786f005b65 | ||
|
|
458bb3f5a3 | ||
|
|
5f6a0a1bdf | ||
|
|
324580ec79 | ||
|
|
21ab3fb466 | ||
|
|
9b4566a9ec | ||
|
|
f585405498 | ||
|
|
ca34cd2f09 | ||
|
|
17ba157e67 | ||
|
|
7bb0a8649f | ||
|
|
402b503a4e | ||
|
|
dde9b5b767 | ||
|
|
41c31f9207 | ||
|
|
23c9b085e6 | ||
|
|
631ea737b0 | ||
|
|
ceb8adafc3 | ||
|
|
fa68b2b22a | ||
|
|
b098150580 | ||
|
|
d699052b6a | ||
|
|
ccd7df2f3b | ||
|
|
7a3f9f8a3b | ||
|
|
20c43fbb49 | ||
|
|
c1d3ccc2cb | ||
|
|
db75a2529f | ||
|
|
9035ebc5a3 | ||
|
|
b6fb8bb2e4 | ||
|
|
a34d47a13b | ||
|
|
72b1333bb2 | ||
|
|
5e28829325 | ||
|
|
d20c3bebed | ||
|
|
6bcd620f0e | ||
|
|
02e5a23fec | ||
|
|
d0c50c7319 | ||
|
|
d34adc04ae | ||
|
|
d48af14e10 | ||
|
|
91dad14704 | ||
|
|
3d56951504 | ||
|
|
bfaf7658df | ||
|
|
da36d22946 | ||
|
|
5415322302 | ||
|
|
fa30eefc4e | ||
|
|
6ec6b8ae38 | ||
|
|
288749e585 | ||
|
|
929021b0c0 | ||
|
|
2a3d944078 | ||
|
|
71aa26efcf | ||
|
|
025ed0860e | ||
|
|
56a01d3056 | ||
|
|
92f68df6c9 | ||
|
|
c15be9ebb9 | ||
|
|
1c2865f34c | ||
|
|
c5a0aa82ad | ||
|
|
97ddaeedd8 | ||
|
|
79826ab525 | ||
|
|
e4fb2c8363 | ||
|
|
1dbc339176 | ||
|
|
e4dae53dba | ||
|
|
ae17f5752e | ||
|
|
3cdc1c1dd4 | ||
|
|
c2fe917ad0 | ||
|
|
ac84bf6468 | ||
|
|
fdde407c9d | ||
|
|
72e355e17c | ||
|
|
1e4d119076 | ||
|
|
d71b1fe7b8 | ||
|
|
8abc01fac6 | ||
|
|
c54da74e1f | ||
|
|
54db503a65 | ||
|
|
bb7ecae874 | ||
|
|
241041f863 | ||
|
|
21b6b7c694 | ||
|
|
dfc3457358 | ||
|
|
e3c0050755 | ||
|
|
00160a48d6 | ||
|
|
5e854b1b1f | ||
|
|
6dab81a65b | ||
|
|
155b5c205c | ||
|
|
21a32bf6c6 | ||
|
|
b9e0e55764 | ||
|
|
783a979232 | ||
|
|
74cad7f48e | ||
|
|
9fe71ae92e | ||
|
|
981f2ad858 | ||
|
|
94f2858c68 | ||
|
|
7a1528d93d | ||
|
|
2df224cb0a | ||
|
|
bf6123e10f | ||
|
|
b0086cf8e0 | ||
|
|
f50a10c637 | ||
|
|
79a093e250 | ||
|
|
3cc1104b27 | ||
|
|
b1bb108585 | ||
|
|
7c7ea430cb | ||
|
|
e79dd8323e | ||
|
|
3337b344ce | ||
|
|
4ad2ede42b | ||
|
|
686dca00d8 | ||
|
|
c9cd2f2726 | ||
|
|
e2b86ff11c | ||
|
|
d3c5d59bf0 | ||
|
|
8a34472576 | ||
|
|
f2f3a11e1e | ||
|
|
aa7ce9cd59 | ||
|
|
4c678fd3a6 | ||
|
|
2ee7de451d | ||
|
|
d59c38e42f | ||
|
|
4611a8b215 | ||
|
|
cd0c760086 | ||
|
|
ae9a73488e | ||
|
|
fc29b2b480 | ||
|
|
41bfd4fc6c | ||
|
|
8b8dc00512 | ||
|
|
a2690bb146 | ||
|
|
5919d9b3c3 | ||
|
|
2c53f60000 | ||
|
|
8598673530 | ||
|
|
1bd86ce02a | ||
|
|
8cc2fe66f4 | ||
|
|
4be79484b0 | ||
|
|
ac90fe57ae | ||
|
|
e1c35e0455 | ||
|
|
0869d2d1d9 | ||
|
|
929cce16bf | ||
|
|
d7ddbf7cd7 | ||
|
|
333afdff00 | ||
|
|
405c8508e9 | ||
|
|
0119e40a76 | ||
|
|
7ef94252a7 | ||
|
|
d85a0cfc10 | ||
|
|
683e698db7 | ||
|
|
0ea0110fea | ||
|
|
11d113449a | ||
|
|
b78e1f50dc | ||
|
|
04b91380a4 | ||
|
|
851193eb5a | ||
|
|
da7c38701c | ||
|
|
7532676cf9 | ||
|
|
e34323ec99 | ||
|
|
7d51bdbcd3 | ||
|
|
6b16063692 | ||
|
|
78915ccf95 | ||
|
|
dc287c243b | ||
|
|
bd9979a87d | ||
|
|
5e907bf979 | ||
|
|
9bbb908761 | ||
|
|
3479535356 | ||
|
|
f91738176a | ||
|
|
d0b02c6ae2 | ||
|
|
c1d1260542 | ||
|
|
b50c167b40 | ||
|
|
b5d7f5e5f7 | ||
|
|
d1813a0f42 | ||
|
|
2db13433c3 | ||
|
|
f62f7121db | ||
|
|
b8d98a80ad | ||
|
|
187a531fce | ||
|
|
58b83c2844 | ||
|
|
0bd84171e2 | ||
|
|
88fd24faa9 | ||
|
|
f36904552d | ||
|
|
19d2dba6cb | ||
|
|
54059a3918 | ||
|
|
250b749b23 | ||
|
|
6d887f79cf | ||
|
|
3bde97db3f | ||
|
|
d0204a6a30 | ||
|
|
b559f2258e | ||
|
|
7206f30c57 | ||
|
|
b1f978408e | ||
|
|
3401f972ad | ||
|
|
aeb987eca7 | ||
|
|
c74f82d232 | ||
|
|
8bf7cf0218 | ||
|
|
cb2dc352af | ||
|
|
5416fc1219 | ||
|
|
9a42d93013 | ||
|
|
43a1f7e027 | ||
|
|
70f393822d | ||
|
|
121261630d | ||
|
|
a5420e85c4 | ||
|
|
8d3097de2a | ||
|
|
0c6e8ac3d8 | ||
|
|
fa5c5fc511 | ||
|
|
f8ae3c9bf0 | ||
|
|
c3919e438a | ||
|
|
1607dd6597 | ||
|
|
fe06c37cd5 | ||
|
|
79d8f6edc5 |
@@ -1,3 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import partner
|
||||
@@ -1,25 +0,0 @@
|
||||
# -*- 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,
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
# -*- 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
|
||||
@@ -1,31 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,35 +0,0 @@
|
||||
.. 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>
|
||||
@@ -1,3 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import wizard
|
||||
@@ -1,16 +0,0 @@
|
||||
# -*- 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,
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
# 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."
|
||||
@@ -1,22 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,3 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_bank_statement_import
|
||||
@@ -1,105 +0,0 @@
|
||||
# -*- 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]
|
||||
@@ -1,3 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_bank_statement_import
|
||||
@@ -1,29 +0,0 @@
|
||||
# -*- 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,
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
# -*- 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
|
||||
@@ -1,48 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,3 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account
|
||||
@@ -1,33 +0,0 @@
|
||||
# -*- 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,
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
# -*- 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']
|
||||
@@ -1,3 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_credit_control
|
||||
@@ -1,46 +0,0 @@
|
||||
# -*- 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,
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
# -*- 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)
|
||||
@@ -1,127 +0,0 @@
|
||||
<?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 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
@@ -1,24 +0,0 @@
|
||||
# -*- 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,
|
||||
}
|
||||
Binary file not shown.
@@ -1,27 +0,0 @@
|
||||
<?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 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
@@ -1,43 +0,0 @@
|
||||
# -*- 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,
|
||||
}
|
||||
Binary file not shown.
@@ -1,27 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,24 +0,0 @@
|
||||
# -*- 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
|
||||
@@ -1,47 +0,0 @@
|
||||
# -*- 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,
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
# -*- 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,3 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_fiscal_position
|
||||
@@ -1,26 +0,0 @@
|
||||
# -*- 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).
|
||||
|
||||
{
|
||||
'name': 'Account Fiscal Position Payable Receivable',
|
||||
'version': '10.0.1.0.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Configure payable/receivable accounts on fiscal positions',
|
||||
'description': """
|
||||
Account Fiscal Position Payable Receivable
|
||||
==========================================
|
||||
|
||||
This module allows to configure a special *Partner Receivable Account* and a special *Partner Payable Account* on fiscal positions. This is used in the onchange of the fiscal position of partners.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': "Akretion",
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account'],
|
||||
'data': [
|
||||
'account_fiscal_position_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
# -*- 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,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="view_account_position_form" model="ir.ui.view">
|
||||
<field name="name">receivable_payable.fiscal_position_form</field>
|
||||
<field name="model">account.fiscal.position</field>
|
||||
<field name="inherit_id" ref="account.view_account_position_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="company_id" position="after">
|
||||
<field name="receivable_account_id"/>
|
||||
<field name="payable_account_id"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
@@ -1,4 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_invoice
|
||||
from . import account_invoice_report
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2015-2017 Akretion (http://www.akretion.com)
|
||||
# Copyright 2015-2019 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Account Invoice Margin',
|
||||
'version': '10.0.1.0.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Invoicing Management',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Copy standard price on invoice line and compute margins',
|
||||
'description': """
|
||||
@@ -20,5 +20,5 @@ This module has been written by Alexis de Lattre from Akretion
|
||||
'data': [
|
||||
'account_invoice_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'installable': False,
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2015-2017 Akretion (http://www.akretion.com)
|
||||
# Copyright 2015-2019 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields, api
|
||||
from odoo import api, fields, models
|
||||
import odoo.addons.decimal_precision as dp
|
||||
|
||||
|
||||
@@ -48,16 +47,18 @@ class AccountInvoiceLine(models.Model):
|
||||
# it works in _get_current_rate
|
||||
# even if we set date = False in context
|
||||
# standard_price_inv_cur is in the UoM of the invoice line
|
||||
date = inv._get_currency_rate_date() or\
|
||||
fields.Date.context_today(self)
|
||||
company = inv.company_id
|
||||
company_currency = company.currency_id
|
||||
standard_price_inv_cur =\
|
||||
inv.company_id.currency_id.with_context(
|
||||
date=inv.date_invoice).compute(
|
||||
il.standard_price_company_currency,
|
||||
inv.currency_id)
|
||||
company_currency._convert(
|
||||
il.standard_price_company_currency,
|
||||
inv.currency_id, company, date)
|
||||
margin_inv_cur =\
|
||||
il.price_subtotal - il.quantity * standard_price_inv_cur
|
||||
margin_comp_cur = inv.currency_id.with_context(
|
||||
date=inv.date_invoice).compute(
|
||||
margin_inv_cur, inv.company_id.currency_id)
|
||||
margin_comp_cur = inv.currency_id._convert(
|
||||
margin_inv_cur, company_currency, company, date)
|
||||
if il.price_subtotal:
|
||||
margin_rate = 100 * margin_inv_cur / il.price_subtotal
|
||||
# for a refund, margin should be negative
|
||||
@@ -83,12 +84,12 @@ class AccountInvoiceLine(models.Model):
|
||||
std_price = pp.standard_price
|
||||
inv_uom_id = vals.get('uom_id')
|
||||
if inv_uom_id and inv_uom_id != pp.uom_id.id:
|
||||
std_price = self.env['product.uom']._compute_price(
|
||||
pp.uom_id.id, std_price, inv_uom_id)
|
||||
inv_uom = self.env['uom.uom'].browse(inv_uom_id)
|
||||
std_price = pp.uom_id._compute_price(
|
||||
std_price, inv_uom)
|
||||
vals['standard_price_company_currency'] = std_price
|
||||
return super(AccountInvoiceLine, self).create(vals)
|
||||
|
||||
@api.multi
|
||||
def write(self, vals):
|
||||
if not vals:
|
||||
vals = {}
|
||||
@@ -105,7 +106,7 @@ class AccountInvoiceLine(models.Model):
|
||||
# uom_id is NOT a required field
|
||||
if 'uom_id' in vals:
|
||||
if vals.get('uom_id'):
|
||||
inv_uom = self.env['product.uom'].browse(
|
||||
inv_uom = self.env['uom.uom'].browse(
|
||||
vals['uom_id'])
|
||||
else:
|
||||
inv_uom = False
|
||||
@@ -126,11 +127,11 @@ class AccountInvoice(models.Model):
|
||||
|
||||
margin_invoice_currency = fields.Monetary(
|
||||
string='Margin in Invoice Currency',
|
||||
readonly=True, compute='_compute_margin', store=True,
|
||||
compute='_compute_margin', store=True, readonly=True,
|
||||
currency_field='currency_id')
|
||||
margin_company_currency = fields.Monetary(
|
||||
string='Margin in Company Currency',
|
||||
readonly=True, compute='_compute_margin', store=True,
|
||||
compute='_compute_margin', store=True, readonly=True,
|
||||
currency_field='company_currency_id')
|
||||
|
||||
@api.depends(
|
||||
@@ -138,12 +139,14 @@ class AccountInvoice(models.Model):
|
||||
'invoice_line_ids.margin_invoice_currency',
|
||||
'invoice_line_ids.margin_company_currency')
|
||||
def _compute_margin(self):
|
||||
for inv in self:
|
||||
margin_inv_cur = 0.0
|
||||
margin_comp_cur = 0.0
|
||||
if inv.type in ('out_invoice', 'out_refund'):
|
||||
for il in inv.invoice_line_ids:
|
||||
margin_inv_cur += il.margin_invoice_currency
|
||||
margin_comp_cur += il.margin_company_currency
|
||||
inv.margin_invoice_currency = margin_inv_cur
|
||||
inv.margin_company_currency = margin_comp_cur
|
||||
res = self.env['account.invoice.line'].read_group(
|
||||
[('invoice_id', 'in', self.ids)],
|
||||
['invoice_id', 'margin_invoice_currency',
|
||||
'margin_company_currency'],
|
||||
['invoice_id'])
|
||||
for re in res:
|
||||
if re['invoice_id']:
|
||||
inv = self.browse(re['invoice_id'][0])
|
||||
if inv.type in ('out_invoice', 'out_refund'):
|
||||
inv.margin_invoice_currency = re['margin_invoice_currency']
|
||||
inv.margin_company_currency = re['margin_company_currency']
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2018 Akretion (http://www.akretion.com)
|
||||
# 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 models, fields, api
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountInvoiceReport(models.Model):
|
||||
@@ -19,8 +18,8 @@ class AccountInvoiceReport(models.Model):
|
||||
'account_id', 'amount_total_company_signed',
|
||||
'commercial_partner_id', 'company_id',
|
||||
'currency_id', 'date_due', 'date_invoice', 'fiscal_position_id',
|
||||
'journal_id', 'partner_bank_id', 'partner_id', 'payment_term_id',
|
||||
'residual', 'state', 'type', 'user_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',
|
||||
@@ -29,26 +28,25 @@ class AccountInvoiceReport(models.Model):
|
||||
],
|
||||
'product.product': ['product_tmpl_id'],
|
||||
'product.template': ['categ_id'],
|
||||
'product.uom': ['category_id', 'factor', 'name', 'uom_type'],
|
||||
'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):
|
||||
context = dict(self._context or {})
|
||||
user_currency_id = self.env.user.company_id.currency_id
|
||||
currency_rate_id = self.env['res.currency.rate'].search([
|
||||
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_id = currency_rate_id.currency_id
|
||||
ctx = context.copy()
|
||||
base_currency = currency_rate.currency_id
|
||||
for record in self:
|
||||
ctx['date'] = record.date
|
||||
record.user_currency_margin = base_currency_id.with_context(
|
||||
ctx).compute(record.margin, user_currency_id)
|
||||
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):
|
||||
|
||||
@@ -12,22 +12,24 @@
|
||||
<field name="model">account.invoice.line</field>
|
||||
<field name="inherit_id" ref="account.view_invoice_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="company_id" position="after">
|
||||
<xpath expr="//field[@name='analytic_tag_ids']/.." position="inside">
|
||||
<field name="standard_price_company_currency"
|
||||
string="Cost Price in Comp. Cur."
|
||||
groups="base.group_no_one"/>
|
||||
<field name="standard_price_invoice_currency"
|
||||
widget="monetary"
|
||||
options="{'currency_field': 'currency_id'}"
|
||||
string="Cost Price in Inv. Cur."
|
||||
groups="base.group_no_one"/>
|
||||
<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>
|
||||
</field>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -38,9 +40,9 @@
|
||||
<field name="arch" type="xml">
|
||||
<field name="move_id" position="after">
|
||||
<field name="margin_invoice_currency"
|
||||
string="Margin" groups="base.group_no_one"/>
|
||||
string="Margin in Inv. Cur." groups="base.group_no_one"/>
|
||||
<field name="margin_company_currency"
|
||||
groups="base.group_no_one"/>
|
||||
string="Margin in Comp. Cur." groups="base.group_no_one"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
@@ -1,26 +0,0 @@
|
||||
# -*- 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,
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
<?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>
|
||||
39
account_invoice_update_wizard/README.rst
Normal file
39
account_invoice_update_wizard/README.rst
Normal file
@@ -0,0 +1,39 @@
|
||||
.. 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 +1,2 @@
|
||||
from . import models
|
||||
from . import wizard
|
||||
|
||||
@@ -1,37 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# Copyright 2018 Camptocamp
|
||||
# Copyright 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# Copyright 2018-2019 Camptocamp
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Account Invoice Update Wizard',
|
||||
'version': '8.0.1.0.0',
|
||||
'version': '18.0.1.0.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Wizard to update non-legal fields of an open/paid invoice',
|
||||
'description': """
|
||||
Account Invoice Update Wizard
|
||||
=============================
|
||||
|
||||
This module adds a button *Update Invoice* on Customer and Supplier invoices in Open or Paid state. This button starts a wizard which allows the user to update non-legal fields of the invoice:
|
||||
|
||||
* Source Document
|
||||
* Reference/Description
|
||||
* Payment terms (update allowed only to a payment term with same number of terms of the same amount and on invoices without any payment)
|
||||
* Bank Account
|
||||
* Salesman
|
||||
* Notes
|
||||
* Description of invoice lines
|
||||
* Analytic account
|
||||
* Analytic tags
|
||||
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account'],
|
||||
'website': 'https://github.com/akretion/odoo-usability',
|
||||
'depends': [
|
||||
'account',
|
||||
],
|
||||
'data': [
|
||||
'wizard/account_invoice_update_view.xml',
|
||||
'views/account_invoice.xml',
|
||||
],
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/account_move_update_view.xml',
|
||||
'views/account_move.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,243 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_invoice_update_wizard
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__price_subtotal
|
||||
msgid "Amount"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__analytic_account_id
|
||||
msgid "Analytic Account"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__analytic_tag_ids
|
||||
msgid "Analytic Tags"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__partner_bank_id
|
||||
msgid "Bank Account"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Bill Reference"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__company_id
|
||||
msgid "Company"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__create_uid
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__create_date
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__currency_id
|
||||
msgid "Currency"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Customer Reference"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__name
|
||||
msgid "Description"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move__display_name
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__display_name
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__display_type
|
||||
msgid "Display Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move__id
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__id
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_id
|
||||
msgid "Invoice"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__invoice_line_id
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__line_ids
|
||||
msgid "Invoice Lines"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.actions.act_window,name:account_invoice_update_wizard.account_invoice_update_action
|
||||
msgid "Invoice Update Wizard"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model,name:account_invoice_update_wizard.model_account_move
|
||||
msgid "Journal Entry"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move____last_update
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update____last_update
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__write_uid
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__write_date
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
|
||||
#, python-format
|
||||
msgid "Non-legal fields of invoice updated via the Invoice Update wizard."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields.selection,name:account_invoice_update_wizard.selection__account_move_line_update__display_type__line_note
|
||||
msgid "Note"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__partner_id
|
||||
msgid "Partner"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_payment_term_id
|
||||
msgid "Payment Term"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__quantity
|
||||
msgid "Quantity"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__ref
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__user_id
|
||||
msgid "Salesperson"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields.selection,name:account_invoice_update_wizard.selection__account_move_line_update__display_type__line_section
|
||||
msgid "Section"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__sequence
|
||||
msgid "Sequence"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_origin
|
||||
msgid "Source Document"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,help:account_invoice_update_wizard.field_account_move_line_update__display_type
|
||||
msgid "Technical field for UX purpose."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"The original payment term '%s' doesn't have the same terms (number of terms "
|
||||
"and/or amount) as the new payment term '%s'. You can only switch to a "
|
||||
"payment term that has the same number of terms with the same amount."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"This wizard doesn't support the update of payment terms on an invoice which "
|
||||
"is partially or fully paid."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__move_type
|
||||
msgid "Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Update"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.view_move_form_inherit
|
||||
msgid "Update Invoice"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Update Invoice Wizard"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model,name:account_invoice_update_wizard.model_account_move_line_update
|
||||
msgid "Update non-legal fields of invoice lines"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__parent_id
|
||||
msgid "Wizard"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model,name:account_invoice_update_wizard.model_account_move_update
|
||||
msgid "Wizard to update non-legal fields of invoice"
|
||||
msgstr ""
|
||||
250
account_invoice_update_wizard/i18n/fr.po
Normal file
250
account_invoice_update_wizard/i18n/fr.po
Normal file
@@ -0,0 +1,250 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_invoice_update_wizard
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__price_subtotal
|
||||
msgid "Amount"
|
||||
msgstr "Montant"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__analytic_account_id
|
||||
msgid "Analytic Account"
|
||||
msgstr "Compte Analytique"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__analytic_tag_ids
|
||||
msgid "Analytic Tags"
|
||||
msgstr "Tag Analytique"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__partner_bank_id
|
||||
msgid "Bank Account"
|
||||
msgstr "Compte Bancaire"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
#, fuzzy
|
||||
msgid "Bill Reference"
|
||||
msgstr "Reference Client"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Cancel"
|
||||
msgstr "Annuler"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__company_id
|
||||
msgid "Company"
|
||||
msgstr "Société"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__create_uid
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Créé par"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__create_date
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__create_date
|
||||
msgid "Created on"
|
||||
msgstr "Créé le"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__currency_id
|
||||
msgid "Currency"
|
||||
msgstr "Devise"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
#, fuzzy
|
||||
msgid "Customer Reference"
|
||||
msgstr "Reference Client"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__name
|
||||
msgid "Description"
|
||||
msgstr "Description"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move__display_name
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__display_name
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nom"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__display_type
|
||||
msgid "Display Type"
|
||||
msgstr "Type Affichage"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move__id
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__id
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_id
|
||||
msgid "Invoice"
|
||||
msgstr "Facture"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__invoice_line_id
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__line_ids
|
||||
msgid "Invoice Lines"
|
||||
msgstr "Ligne de factures"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.actions.act_window,name:account_invoice_update_wizard.account_invoice_update_action
|
||||
msgid "Invoice Update Wizard"
|
||||
msgstr "Assistance de mise à jour de la facture"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model,name:account_invoice_update_wizard.model_account_move
|
||||
msgid "Journal Entry"
|
||||
msgstr "Entrée comptable"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move____last_update
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update____last_update
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__write_uid
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__write_date
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
|
||||
#, python-format
|
||||
msgid "Non-legal fields of invoice updated via the Invoice Update wizard."
|
||||
msgstr "Champs non légaux mis à jour via l'assistant"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields.selection,name:account_invoice_update_wizard.selection__account_move_line_update__display_type__line_note
|
||||
msgid "Note"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__partner_id
|
||||
msgid "Partner"
|
||||
msgstr "Client"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_payment_term_id
|
||||
msgid "Payment Term"
|
||||
msgstr "Condition de paiement"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__quantity
|
||||
msgid "Quantity"
|
||||
msgstr "Quantité"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__ref
|
||||
#, fuzzy
|
||||
msgid "Reference"
|
||||
msgstr "Reference Client"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__user_id
|
||||
msgid "Salesperson"
|
||||
msgstr "Vendeur"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields.selection,name:account_invoice_update_wizard.selection__account_move_line_update__display_type__line_section
|
||||
msgid "Section"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__sequence
|
||||
msgid "Sequence"
|
||||
msgstr "Sequence"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__invoice_origin
|
||||
msgid "Source Document"
|
||||
msgstr "Origine du document"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,help:account_invoice_update_wizard.field_account_move_line_update__display_type
|
||||
msgid "Technical field for UX purpose."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"The original payment term '%s' doesn't have the same terms (number of terms "
|
||||
"and/or amount) as the new payment term '%s'. You can only switch to a "
|
||||
"payment term that has the same number of terms with the same amount."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: code:addons/account_invoice_update_wizard/wizard/account_move_update.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"This wizard doesn't support the update of payment terms on an invoice which "
|
||||
"is partially or fully paid."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_update__move_type
|
||||
msgid "Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Update"
|
||||
msgstr "Mettre à jour"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.view_move_form_inherit
|
||||
msgid "Update Invoice"
|
||||
msgstr "Mettre à jour"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model_terms:ir.ui.view,arch_db:account_invoice_update_wizard.account_invoice_update_form
|
||||
msgid "Update Invoice Wizard"
|
||||
msgstr "Assistant de mise à jour"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model,name:account_invoice_update_wizard.model_account_move_line_update
|
||||
msgid "Update non-legal fields of invoice lines"
|
||||
msgstr "Mettre à jour les champs non légaux des lignes de facture"
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model.fields,field_description:account_invoice_update_wizard.field_account_move_line_update__parent_id
|
||||
msgid "Wizard"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_invoice_update_wizard
|
||||
#: model:ir.model,name:account_invoice_update_wizard.model_account_move_update
|
||||
msgid "Wizard to update non-legal fields of invoice"
|
||||
msgstr "Assistant pour mettre à jours les champs non légaux"
|
||||
|
||||
#~ msgid "Account"
|
||||
#~ msgstr "Compte"
|
||||
1
account_invoice_update_wizard/models/__init__.py
Normal file
1
account_invoice_update_wizard/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import account_move
|
||||
18
account_invoice_update_wizard/models/account_move.py
Normal file
18
account_invoice_update_wizard/models/account_move.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Copyright 2019-2022 Camptocamp
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = 'account.move'
|
||||
|
||||
def prepare_update_wizard(self):
|
||||
self.ensure_one()
|
||||
wizard = self.env['account.move.update']
|
||||
res = wizard._prepare_default_get(self)
|
||||
action = self.env["ir.actions.actions"]._for_xml_id(
|
||||
'account_invoice_update_wizard.account_invoice_update_action')
|
||||
action['name'] = "Update Wizard"
|
||||
action['res_id'] = wizard.create(res).id
|
||||
return action
|
||||
3
account_invoice_update_wizard/pyproject.toml
Normal file
3
account_invoice_update_wizard/pyproject.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
[build-system]
|
||||
requires = ["whool"]
|
||||
build-backend = "whool.buildapi"
|
||||
@@ -0,0 +1,3 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_account_move_update,account.move.update.user,model_account_move_update,account.group_account_invoice,1,1,1,1
|
||||
access_account_move_line_update,account.move.line.update.user,model_account_move_line_update,account.group_account_invoice,1,1,1,1
|
||||
|
BIN
account_invoice_update_wizard/static/description/icon.png
Normal file
BIN
account_invoice_update_wizard/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
@@ -1 +1 @@
|
||||
from . import test_account_invoice_update_wizard
|
||||
from . import test_account_move_update_wizard
|
||||
|
||||
@@ -1,198 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2018 Camptocamp
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo.tests.common import TransactionCase
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class TestAccountInvoiceUpdateWizard(TransactionCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestAccountInvoiceUpdateWizard, self).setUp()
|
||||
self.customer12 = self.env.ref('base.res_partner_12')
|
||||
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')
|
||||
|
||||
self.invoice1 = self.env['account.invoice'].create({
|
||||
'name': 'Test invoice',
|
||||
'partner_id': self.customer12.id,
|
||||
})
|
||||
self.inv_line1 = self.env['account.invoice.line'].create({
|
||||
'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,
|
||||
})
|
||||
|
||||
self.aa1 = self.env.ref('analytic.analytic_partners_camp_to_camp')
|
||||
self.aa2 = self.env.ref('analytic.analytic_nebula')
|
||||
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):
|
||||
""" Add analytic account on an invoice line
|
||||
after the invoice has been approved.
|
||||
|
||||
This will:
|
||||
- update the move line
|
||||
- create a new analytic line.
|
||||
"""
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard()
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.account_analytic_id = self.aa1
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_account_id, self.aa1)
|
||||
self.assertEqual(related_ml.analytic_line_ids.account_id, self.aa1)
|
||||
|
||||
def test_change_analytic_account_line1(self):
|
||||
""" Change analytic account on an invoice line
|
||||
after the invoice has been approved.
|
||||
|
||||
This will:
|
||||
- update the move line
|
||||
- update the existing analytic line."""
|
||||
self.inv_line1.account_analytic_id = self.aa2
|
||||
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard()
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.account_analytic_id = self.aa1
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_account_id, self.aa1)
|
||||
self.assertEqual(related_ml.analytic_line_ids.account_id, self.aa1)
|
||||
|
||||
def test_error_grouped_move_lines(self):
|
||||
""" Change analytic account on an invoice line
|
||||
after the invoice has been approved where both
|
||||
lines were grouped in the same move line.
|
||||
|
||||
This will raise an error.
|
||||
"""
|
||||
self.invoice1.journal_id.group_invoice_lines = True
|
||||
|
||||
self.inv_line2.product_id = self.product16
|
||||
self.inv_line2.unit_price = 42.0
|
||||
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard()
|
||||
|
||||
line1 = self.wiz.line_ids[0]
|
||||
line1.account_analytic_id = self.aa1
|
||||
with self.assertRaises(UserError):
|
||||
self.wiz.run()
|
||||
|
||||
def test_add_analytic_tags_line1(self):
|
||||
""" Add analytic tags on an invoice line
|
||||
after the invoice has been approved.
|
||||
|
||||
This will update move line.
|
||||
"""
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard()
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.analytic_tag_ids = self.atag2
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_tag_ids, self.atag2)
|
||||
self.assertFalse(related_ml.analytic_line_ids)
|
||||
|
||||
def test_change_analytic_tags_line1(self):
|
||||
""" Change analytic tags on an invoice line
|
||||
after the invoice has been approved.
|
||||
|
||||
It will update move line and analytic line
|
||||
"""
|
||||
self.inv_line1.account_analytic_id = self.aa2
|
||||
self.inv_line1.analytic_tag_ids = self.atag1
|
||||
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard()
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.analytic_tag_ids = self.atag2
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_tag_ids, self.atag2)
|
||||
self.assertEqual(related_ml.analytic_line_ids.tag_ids, self.atag2)
|
||||
|
||||
def test_add_analytic_info_line1(self):
|
||||
""" Add analytic account and tags on an invoice line
|
||||
after the invoice has been approved.
|
||||
|
||||
This will:
|
||||
- update move line
|
||||
- create an analytic line
|
||||
"""
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard()
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.account_analytic_id = self.aa1
|
||||
wiz_line.analytic_tag_ids = self.atag2
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_account_id, self.aa1)
|
||||
self.assertEqual(related_ml.analytic_tag_ids, self.atag2)
|
||||
self.assertEqual(related_ml.analytic_line_ids.account_id, self.aa1)
|
||||
self.assertEqual(related_ml.analytic_line_ids.tag_ids, self.atag2)
|
||||
|
||||
def test_empty_analytic_account_line1(self):
|
||||
""" Remove analytic account
|
||||
after the invoice has been approved.
|
||||
|
||||
This will raise an error as it is not implemented.
|
||||
"""
|
||||
self.inv_line1.account_analytic_id = self.aa2
|
||||
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard()
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.account_analytic_id = False
|
||||
self.wiz.run()
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertFalse(related_ml.analytic_account_id)
|
||||
self.assertFalse(related_ml.analytic_line_ids)
|
||||
@@ -0,0 +1,113 @@
|
||||
# Copyright 2018-2022 Camptocamp
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
|
||||
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')
|
||||
uom_unit = cls.env.ref('uom.product_uom_categ_unit')
|
||||
|
||||
cls.plan = cls.env['account.analytic.plan'].create({'name': 'Test Plan'})
|
||||
cls.analytic_account_1 = cls.env['account.analytic.account'].create({
|
||||
'name': 'analytic 1 test plan',
|
||||
'plan_id': cls.plan.id,
|
||||
'company_id': False,
|
||||
})
|
||||
cls.analytic_account_2 = cls.env['account.analytic.account'].create({
|
||||
'name': 'analytic 2 test plan',
|
||||
'plan_id': cls.plan.id,
|
||||
'company_id': False,
|
||||
})
|
||||
cls.move1 = cls.env['account.move'].create({
|
||||
'name': 'Test invoice',
|
||||
'partner_id': cls.customer12.id,
|
||||
'move_type': 'out_invoice',
|
||||
'invoice_line_ids': [
|
||||
[0, None, {
|
||||
'name': 'Line1',
|
||||
'product_id': cls.product16.id,
|
||||
'product_uom_id': uom_unit.id,
|
||||
'quantity': 1,
|
||||
'price_unit': 42.0,
|
||||
'credit': 42.0,
|
||||
'debit': 0
|
||||
}],
|
||||
],
|
||||
})
|
||||
|
||||
def create_wizard(self, move):
|
||||
res = move.prepare_update_wizard()
|
||||
self.wiz = self.env['account.move.update'].browse(res['res_id'])
|
||||
|
||||
def test_add_analytic_account_line1(self):
|
||||
""" Add analytic account on a move line
|
||||
after the move has been approved.
|
||||
|
||||
This will:
|
||||
- update the move line
|
||||
- create a new analytic line.
|
||||
"""
|
||||
self.move1._post()
|
||||
self.create_wizard(self.move1)
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id.product_id.id == self.product16.id)
|
||||
wiz_line.analytic_distribution = {self.analytic_account_1.id: 50, self.analytic_account_2.id: 50}
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.move1.invoice_line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_distribution, {str(self.analytic_account_1.id): 50.0, str(self.analytic_account_2.id): 50.0})
|
||||
self.assertEqual(len(related_ml.analytic_line_ids), 2)
|
||||
self.assertEqual(related_ml.analytic_line_ids[0].amount, 21.0)
|
||||
|
||||
def test_change_analytic_account_line1(self):
|
||||
""" Change analytic account on a move line
|
||||
after the move has been approved.
|
||||
|
||||
This will:
|
||||
- update the move line
|
||||
- update the existing analytic line."""
|
||||
move_line1 = self.move1.invoice_line_ids.filtered(lambda rec: rec.product_id == self.product16)
|
||||
move_line1.analytic_distribution = {self.analytic_account_1.id: 100}
|
||||
|
||||
self.move1._post()
|
||||
self.create_wizard(self.move1)
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id.product_id.id == self.product16.id)
|
||||
wiz_line.analytic_distribution = {self.analytic_account_1.id: 50, self.analytic_account_2.id: 50}
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.move1.invoice_line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_distribution, {str(self.analytic_account_1.id): 50.0, str(self.analytic_account_2.id): 50.0})
|
||||
self.assertEqual(len(related_ml.analytic_line_ids), 2)
|
||||
self.assertEqual(related_ml.analytic_line_ids[0].amount, 21.0)
|
||||
|
||||
def test_empty_analytic_account_line1(self):
|
||||
""" Remove analytic account
|
||||
after the move has been approved.
|
||||
|
||||
This will raise an error as it is not implemented.
|
||||
"""
|
||||
move_line1 = self.move1.invoice_line_ids.filtered(lambda rec: rec.product_id == self.product16)
|
||||
move_line1.analytic_distribution = {self.analytic_account_1.id: 100}
|
||||
|
||||
self.move1._post()
|
||||
self.create_wizard(self.move1)
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id.product_id.id == self.product16.id)
|
||||
wiz_line.analytic_distribution = False
|
||||
self.wiz.run()
|
||||
related_ml = self.move1.invoice_line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertFalse(related_ml.analytic_distribution)
|
||||
self.assertFalse(related_ml.analytic_line_ids)
|
||||
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
© 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="invoice_supplier_form" model="ir.ui.view">
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="inherit_id" ref="account.invoice_supplier_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_invoice_cancel" position="before">
|
||||
<button name="%(account_invoice_update_action)d" type="action" string="Update Invoice" states="open,paid" groups="account.group_account_invoice"/>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="invoice_form" model="ir.ui.view">
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="inherit_id" ref="account.invoice_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_invoice_cancel" position="before">
|
||||
<button name="%(account_invoice_update_action)d" type="action" string="Update Invoice" states="open,paid" groups="account.group_account_invoice"/>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
20
account_invoice_update_wizard/views/account_move.xml
Normal file
20
account_invoice_update_wizard/views/account_move.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_move_form_inherit" model="ir.ui.view">
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="button_draft" position="before">
|
||||
<button name="prepare_update_wizard" type="object" string="Update Invoice" invisible="state != 'posted' or move_type == 'entry'" groups="account.group_account_invoice"/>
|
||||
<button name="prepare_update_wizard" type="object" string="Update Entry" invisible="state != 'posted' or move_type != 'entry'" groups="account.group_account_invoice"/>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -1 +1 @@
|
||||
from . import account_invoice_update
|
||||
from . import account_move_update
|
||||
|
||||
@@ -1,308 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# Copyright 2018 Camptocamp
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import UserError
|
||||
import odoo.addons.decimal_precision as dp
|
||||
|
||||
|
||||
class AccountInvoiceUpdate(models.TransientModel):
|
||||
_name = 'account.invoice.update'
|
||||
_description = 'Wizard to update non-legal fields of invoice'
|
||||
|
||||
invoice_id = fields.Many2one(
|
||||
'account.invoice', string='Invoice', required=True,
|
||||
readonly=True)
|
||||
type = fields.Selection(related='invoice_id.type', readonly=True)
|
||||
company_id = fields.Many2one(
|
||||
related='invoice_id.company_id', readonly=True)
|
||||
partner_id = fields.Many2one(
|
||||
related='invoice_id.partner_id', readonly=True)
|
||||
user_id = fields.Many2one('res.users', string='Salesperson')
|
||||
payment_term_id = fields.Many2one(
|
||||
'account.payment.term', string='Payment Term')
|
||||
reference = fields.Char(string='Invoice Reference')
|
||||
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(
|
||||
'account.invoice.line.update', 'parent_id', string='Invoice Lines')
|
||||
|
||||
@api.model
|
||||
def _simple_fields2update(self):
|
||||
'''List boolean, date, datetime, char, text fields'''
|
||||
return ['reference', 'name', 'origin', 'comment']
|
||||
|
||||
@api.model
|
||||
def _m2o_fields2update(self):
|
||||
return ['payment_term_id', 'user_id', 'partner_bank_id']
|
||||
|
||||
@api.model
|
||||
def _prepare_default_get(self, invoice):
|
||||
res = {'invoice_id': invoice.id, 'line_ids': []}
|
||||
for sfield in self._simple_fields2update():
|
||||
res[sfield] = invoice[sfield]
|
||||
for m2ofield in self._m2o_fields2update():
|
||||
res[m2ofield] = invoice[m2ofield].id or False
|
||||
for line in invoice.invoice_line_ids:
|
||||
aa_tags = line.analytic_tag_ids
|
||||
aa_tags = [(6, 0, aa_tags.ids)] if aa_tags else False
|
||||
res['line_ids'].append([0, 0, {
|
||||
'invoice_line_id': line.id,
|
||||
'name': line.name,
|
||||
'quantity': line.quantity,
|
||||
'price_subtotal': line.price_subtotal,
|
||||
'account_analytic_id': line.account_analytic_id.id,
|
||||
'analytic_tag_ids': aa_tags,
|
||||
}])
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def default_get(self, fields_list):
|
||||
res = super(AccountInvoiceUpdate, self).default_get(fields_list)
|
||||
assert self._context.get('active_model') == 'account.invoice',\
|
||||
'active_model should be account.invoice'
|
||||
inv = self.env['account.invoice'].browse(self._context['active_id'])
|
||||
res = self._prepare_default_get(inv)
|
||||
return res
|
||||
|
||||
@api.onchange('type')
|
||||
def type_on_change(self):
|
||||
res = {'domain': {}}
|
||||
if self.type in ('out_invoice', 'out_refund'):
|
||||
res['domain']['partner_bank_id'] =\
|
||||
"[('partner_id.ref_company_ids', 'in', [company_id])]"
|
||||
else:
|
||||
res['domain']['partner_bank_id'] =\
|
||||
"[('partner_id', '=', partner_id)]"
|
||||
return res
|
||||
|
||||
@api.multi
|
||||
def _prepare_invoice(self):
|
||||
vals = {}
|
||||
inv = self.invoice_id
|
||||
for sfield in self._simple_fields2update():
|
||||
if self[sfield] != inv[sfield]:
|
||||
vals[sfield] = self[sfield]
|
||||
for m2ofield in self._m2o_fields2update():
|
||||
if self[m2ofield] != inv[m2ofield]:
|
||||
vals[m2ofield] = self[m2ofield].id or False
|
||||
if 'payment_term_id' in vals:
|
||||
pterm_list = self.payment_term_id.compute(
|
||||
value=1, date_ref=inv.date_invoice)[0]
|
||||
if pterm_list:
|
||||
vals['date_due'] = max(line[0] for line in pterm_list)
|
||||
return vals
|
||||
|
||||
@api.model
|
||||
def _line_simple_fields2update(self):
|
||||
return ["name",]
|
||||
|
||||
@api.model
|
||||
def _line_m2o_fields2update(self):
|
||||
return ["account_analytic_id",]
|
||||
|
||||
@api.model
|
||||
def _line_m2m_fields2update(self):
|
||||
return ["analytic_tag_ids",]
|
||||
|
||||
@api.model
|
||||
def _prepare_invoice_line(self, line):
|
||||
vals = {}
|
||||
for field in self._line_simple_fields2update():
|
||||
if line[field] != line.invoice_line_id[field]:
|
||||
vals[field] = line[field]
|
||||
for field in self._line_m2o_fields2update():
|
||||
if line[field] != line.invoice_line_id[field]:
|
||||
vals[field] = line[field].id
|
||||
for field in self._line_m2m_fields2update():
|
||||
if line[field] != line.invoice_line_id[field]:
|
||||
vals[field] = [(6, 0, line[field].ids)]
|
||||
return vals
|
||||
|
||||
@api.multi
|
||||
def _prepare_move(self):
|
||||
mvals = {}
|
||||
inv = self.invoice_id
|
||||
ini_ref = inv.move_id.ref
|
||||
ref = inv.reference or inv.name
|
||||
if ini_ref != ref:
|
||||
mvals['ref'] = ref
|
||||
return mvals
|
||||
|
||||
@api.multi
|
||||
def _get_matching_inv_line(self, move_line):
|
||||
""" Find matching invoice line by product """
|
||||
# TODO make it accept more case as lines won't
|
||||
# be grouped unless journal.group_invoice_line is True
|
||||
inv_line = self.invoice_id.invoice_line_ids.filtered(
|
||||
lambda rec: rec.product_id == move_line.product_id)
|
||||
if len(inv_line) <> 1:
|
||||
raise UserError(
|
||||
"Cannot match a single invoice line to move line %s" %
|
||||
move_line.name)
|
||||
return inv_line
|
||||
|
||||
@api.multi
|
||||
def _prepare_move_line(self, inv_line):
|
||||
mlvals = {}
|
||||
inv_line_upd = self.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == inv_line)
|
||||
|
||||
ini_aa = inv_line.account_analytic_id
|
||||
new_aa = inv_line_upd.account_analytic_id
|
||||
|
||||
if ini_aa != new_aa:
|
||||
mlvals['analytic_account_id'] = new_aa.id
|
||||
|
||||
ini_aa_tags = inv_line.analytic_tag_ids
|
||||
new_aa_tags = inv_line_upd.analytic_tag_ids
|
||||
|
||||
if ini_aa_tags != new_aa_tags:
|
||||
mlvals['analytic_tag_ids'] = [(6, None, new_aa_tags.ids)]
|
||||
return mlvals
|
||||
|
||||
@api.multi
|
||||
def _prepare_analytic_line(self, inv_line):
|
||||
alvals = {}
|
||||
inv_line_upd = self.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == inv_line)
|
||||
|
||||
ini_aa = inv_line.account_analytic_id
|
||||
new_aa = inv_line_upd.account_analytic_id
|
||||
|
||||
if ini_aa != new_aa:
|
||||
alvals['account_id'] = new_aa.id
|
||||
|
||||
ini_aa_tags = inv_line.analytic_tag_ids
|
||||
new_aa_tags = inv_line_upd.analytic_tag_ids
|
||||
|
||||
if ini_aa_tags != new_aa_tags:
|
||||
alvals['tag_ids'] = [(6, None, new_aa_tags.ids)]
|
||||
return alvals
|
||||
|
||||
@api.multi
|
||||
def _update_payment_term_move(self):
|
||||
self.ensure_one()
|
||||
inv = self.invoice_id
|
||||
if (
|
||||
self.payment_term_id and
|
||||
self.payment_term_id != inv.payment_term_id and
|
||||
inv.move_id):
|
||||
# I don't update pay term when the invoice is partially (or fully)
|
||||
# paid because if you have a payment term with several lines
|
||||
# of the same amount, you would also have to take into account
|
||||
# the reconcile marks to put the new maturity date on the right
|
||||
# lines
|
||||
if inv.payment_ids:
|
||||
raise UserError(_(
|
||||
"This wizard doesn't support the update of payment "
|
||||
"terms on an invoice which is partially or fully "
|
||||
"paid."))
|
||||
prec = self.env['decimal.precision'].precision_get('Account')
|
||||
term_res = self.payment_term_id.compute(
|
||||
inv.amount_total, inv.date_invoice)[0]
|
||||
new_pterm = {} # key = int(amount * 100), value = [date1, date2]
|
||||
for entry in term_res:
|
||||
amount = int(entry[1] * 10 * prec)
|
||||
if amount in new_pterm:
|
||||
new_pterm[amount].append(entry[0])
|
||||
else:
|
||||
new_pterm[amount] = [entry[0]]
|
||||
mlines = {} # key = int(amount * 100), value : [line1, line2]
|
||||
for line in inv.move_id.line_ids:
|
||||
if line.account_id == inv.account_id:
|
||||
amount = int(abs(line.credit - line.debit) * 10 * prec)
|
||||
if amount in mlines:
|
||||
mlines[amount].append(line)
|
||||
else:
|
||||
mlines[amount] = [line]
|
||||
for iamount, lines in mlines.iteritems():
|
||||
if len(lines) != len(new_pterm.get(iamount, [])):
|
||||
raise UserError(_(
|
||||
"The original payment term '%s' doesn't have the "
|
||||
"same terms (number of terms and/or amount) as the "
|
||||
"new payment term '%s'. You can only switch to a "
|
||||
"payment term that has the same number of terms "
|
||||
"with the same amount.") % (
|
||||
inv.payment_term_id.name, self.payment_term_id.name))
|
||||
for line in lines:
|
||||
line.date_maturity = new_pterm[iamount].pop()
|
||||
|
||||
@api.multi
|
||||
def run(self):
|
||||
self.ensure_one()
|
||||
inv = self.invoice_id
|
||||
updated = False
|
||||
# re-write date_maturity on move line
|
||||
self._update_payment_term_move()
|
||||
ivals = self._prepare_invoice()
|
||||
if ivals:
|
||||
updated = True
|
||||
inv.write(ivals)
|
||||
if inv.move_id:
|
||||
mvals = self._prepare_move()
|
||||
if mvals:
|
||||
inv.move_id.write(mvals)
|
||||
for ml in inv.move_id.line_ids.filtered(
|
||||
# we are only interested in invoice lines, not tax lines
|
||||
lambda rec: bool(rec.product_id)
|
||||
):
|
||||
if ml.credit == 0.0:
|
||||
continue
|
||||
inv_line = self._get_matching_inv_line(ml)
|
||||
mlvals = self._prepare_move_line(inv_line)
|
||||
if mlvals:
|
||||
updated = True
|
||||
ml.write(mlvals)
|
||||
aalines = ml.analytic_line_ids
|
||||
alvals = self._prepare_analytic_line(inv_line)
|
||||
if aalines and alvals:
|
||||
updated = True
|
||||
if ('account_id' in alvals and
|
||||
alvals['account_id'] is False):
|
||||
former_aa = inv_line.account_analytic_id
|
||||
to_remove_aalines = aalines.filtered(
|
||||
lambda rec: rec.account_id == former_aa)
|
||||
# remove existing analytic line
|
||||
to_remove_aalines.unlink()
|
||||
else:
|
||||
aalines.write(alvals)
|
||||
elif 'account_id' in alvals:
|
||||
# Create analytic lines if analytic account
|
||||
# is added later
|
||||
ml.create_analytic_lines()
|
||||
for line in self.line_ids:
|
||||
ilvals = self._prepare_invoice_line(line)
|
||||
if ilvals:
|
||||
updated = True
|
||||
line.invoice_line_id.write(ilvals)
|
||||
if updated:
|
||||
inv.message_post(_(
|
||||
'Non-legal fields of invoice updated via the Invoice Update '
|
||||
'wizard.'))
|
||||
return True
|
||||
|
||||
|
||||
class AccountInvoiceLineUpdate(models.TransientModel):
|
||||
_name = 'account.invoice.line.update'
|
||||
_description = 'Update non-legal fields of invoice lines'
|
||||
|
||||
parent_id = fields.Many2one(
|
||||
'account.invoice.update', string='Wizard', ondelete='cascade')
|
||||
invoice_line_id = fields.Many2one(
|
||||
'account.invoice.line', string='Invoice Line', readonly=True)
|
||||
name = fields.Text(string='Description', required=True)
|
||||
quantity = fields.Float(
|
||||
string='Quantity', digits=dp.get_precision('Product Unit of Measure'),
|
||||
readonly=True)
|
||||
price_subtotal = fields.Float(
|
||||
string='Amount', readonly=True, digits=dp.get_precision('Account'))
|
||||
account_analytic_id = fields.Many2one(
|
||||
'account.analytic.account', string='Analytic Account')
|
||||
analytic_tag_ids = fields.Many2many(
|
||||
'account.analytic.tag', string='Analytic Tags')
|
||||
@@ -1,53 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
© 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="account_invoice_update_form" model="ir.ui.view">
|
||||
<field name="model">account.invoice.update</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Update Invoice Wizard">
|
||||
<group name="main">
|
||||
<field name="invoice_id" invisible="1"/>
|
||||
<field name="type" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field name="reference" attrs="{'invisible': [('type', 'not in', ('in_invoice', 'in_refund'))]}"/>
|
||||
<field name="origin"/>
|
||||
<field name="name"/>
|
||||
<field name="payment_term_id" widget="selection"/>
|
||||
<field name="partner_bank_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="comment"/>
|
||||
</group>
|
||||
<group name="lines">
|
||||
<field name="line_ids" nolabel="1">
|
||||
<tree editable="bottom">
|
||||
<field name="invoice_line_id" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="quantity"/>
|
||||
<field name="price_subtotal"/>
|
||||
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="analytic_tag_ids" groups="analytic.group_analytic_accounting" widget="many2many_tags"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="run" type="object" class="oe_highlight" string="Update"/>
|
||||
<button special="cancel" string="Cancel" class="oe_link"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account_invoice_update_action" model="ir.actions.act_window">
|
||||
<field name="name">Invoice Update Wizard</field>
|
||||
<field name="res_model">account.invoice.update</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
219
account_invoice_update_wizard/wizard/account_move_update.py
Normal file
219
account_invoice_update_wizard/wizard/account_move_update.py
Normal file
@@ -0,0 +1,219 @@
|
||||
# Copyright 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# Copyright 2018-2022 Camptocamp
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import Command, models, fields, api
|
||||
from odoo.exceptions import UserError
|
||||
import odoo.addons.decimal_precision as dp
|
||||
|
||||
|
||||
class AccountMoveUpdate(models.TransientModel):
|
||||
_name = 'account.move.update'
|
||||
_description = 'Wizard to update non-legal fields of invoice'
|
||||
|
||||
invoice_id = fields.Many2one(
|
||||
'account.move', string='Invoice', required=True,
|
||||
readonly=True)
|
||||
move_type = fields.Selection(related='invoice_id.move_type')
|
||||
company_id = fields.Many2one(related='invoice_id.company_id')
|
||||
partner_id = fields.Many2one(related='invoice_id.partner_id')
|
||||
invoice_user_id = fields.Many2one('res.users', string='Salesperson')
|
||||
invoice_payment_term_id = fields.Many2one(
|
||||
'account.payment.term', string='Payment Term')
|
||||
ref = fields.Char(string='Reference') # field label is customized in the view
|
||||
invoice_date = fields.Date()
|
||||
invoice_origin = fields.Char(string='Source Document')
|
||||
partner_bank_id = fields.Many2one(
|
||||
'res.partner.bank', string='Bank Account')
|
||||
line_ids = fields.One2many(
|
||||
'account.move.line.update', 'parent_id', string='Invoice Lines')
|
||||
|
||||
@api.model
|
||||
def _simple_fields2update(self):
|
||||
'''List boolean, date, datetime, char, text fields'''
|
||||
return ['ref', 'invoice_origin', 'invoice_date']
|
||||
|
||||
@api.model
|
||||
def _m2o_fields2update(self):
|
||||
return ['invoice_payment_term_id', 'invoice_user_id', 'partner_bank_id']
|
||||
|
||||
@api.model
|
||||
def _prepare_default_get(self, invoice):
|
||||
res = {'invoice_id': invoice.id, 'line_ids': []}
|
||||
for sfield in self._simple_fields2update():
|
||||
res[sfield] = invoice[sfield]
|
||||
for m2ofield in self._m2o_fields2update():
|
||||
res[m2ofield] = invoice[m2ofield].id or False
|
||||
for line in invoice.invoice_line_ids:
|
||||
res['line_ids'].append([0, 0, {
|
||||
'invoice_line_id': line.id,
|
||||
'sequence': line.sequence,
|
||||
'name': line.name,
|
||||
'quantity': line.quantity,
|
||||
'price_subtotal': line.price_subtotal,
|
||||
'analytic_distribution': line.analytic_distribution,
|
||||
'currency_id': line.currency_id.id,
|
||||
}])
|
||||
return res
|
||||
|
||||
@api.onchange('move_type')
|
||||
def move_type_on_change(self):
|
||||
res = {'domain': {}}
|
||||
if self.move_type in ('out_invoice', 'out_refund'):
|
||||
res['domain']['partner_bank_id'] =\
|
||||
"[('partner_id.ref_company_ids', 'in', [company_id])]"
|
||||
else:
|
||||
res['domain']['partner_bank_id'] =\
|
||||
"[('partner_id', '=', partner_id)]"
|
||||
return res
|
||||
|
||||
def _prepare_invoice(self):
|
||||
vals = {}
|
||||
inv = self.invoice_id
|
||||
for sfield in self._simple_fields2update():
|
||||
if self[sfield] != inv[sfield]:
|
||||
vals[sfield] = self[sfield]
|
||||
for m2ofield in self._m2o_fields2update():
|
||||
if self[m2ofield] != inv[m2ofield]:
|
||||
vals[m2ofield] = self[m2ofield].id or False
|
||||
if 'invoice_payment_term_id' in vals:
|
||||
pterm_list = self.invoice_payment_term_id.compute(
|
||||
value=1, date_ref=inv.date_invoice)[0]
|
||||
if pterm_list:
|
||||
vals['date_due'] = max(line[0] for line in pterm_list)
|
||||
return vals
|
||||
|
||||
@api.model
|
||||
def _line_simple_fields2update(self):
|
||||
return ["name", "analytic_distribution"]
|
||||
|
||||
@api.model
|
||||
def _line_m2o_fields2update(self):
|
||||
return []
|
||||
|
||||
@api.model
|
||||
def _line_m2m_fields2update(self):
|
||||
return []
|
||||
|
||||
@api.model
|
||||
def _prepare_invoice_line(self, line):
|
||||
vals = {}
|
||||
for field in self._line_simple_fields2update():
|
||||
if line[field] != line.invoice_line_id[field]:
|
||||
vals[field] = line[field]
|
||||
for field in self._line_m2o_fields2update():
|
||||
if line[field] != line.invoice_line_id[field]:
|
||||
vals[field] = line[field].id
|
||||
for field in self._line_m2m_fields2update():
|
||||
if line[field] != line.invoice_line_id[field]:
|
||||
vals[field] = [Command.set(line[field].ids)]
|
||||
return vals
|
||||
|
||||
def _update_payment_term_move(self):
|
||||
self.ensure_one()
|
||||
inv = self.invoice_id
|
||||
if (
|
||||
self.invoice_payment_term_id and
|
||||
self.invoice_payment_term_id != inv.invoice_payment_term_id):
|
||||
# I don't update pay term when the invoice is partially (or fully)
|
||||
# paid because if you have a payment term with several lines
|
||||
# of the same amount, you would also have to take into account
|
||||
# the reconcile marks to put the new maturity date on the right
|
||||
# lines
|
||||
if inv.payment_id:
|
||||
raise UserError(self.env._(
|
||||
"This wizard doesn't support the update of payment "
|
||||
"terms on an invoice which is partially or fully "
|
||||
"paid."))
|
||||
prec = self.env['decimal.precision'].precision_get('Account')
|
||||
term_res = self.invoice_payment_term_id.compute(
|
||||
inv.amount_total, inv.date_invoice)[0]
|
||||
new_pterm = {} # key = int(amount * 100), value = [date1, date2]
|
||||
for entry in term_res:
|
||||
amount = int(entry[1] * 10 * prec)
|
||||
if amount in new_pterm:
|
||||
new_pterm[amount].append(entry[0])
|
||||
else:
|
||||
new_pterm[amount] = [entry[0]]
|
||||
mlines = {} # key = int(amount * 100), value : [line1, line2]
|
||||
for line in inv.move_id.line_ids:
|
||||
if line.account_id == inv.account_id:
|
||||
amount = int(abs(line.credit - line.debit) * 10 * prec)
|
||||
if amount in mlines:
|
||||
mlines[amount].append(line)
|
||||
else:
|
||||
mlines[amount] = [line]
|
||||
for iamount, lines in mlines.items():
|
||||
if len(lines) != len(new_pterm.get(iamount, [])):
|
||||
raise UserError(self.env._(
|
||||
"The original payment term '%s' doesn't have the "
|
||||
"same terms (number of terms and/or amount) as the "
|
||||
"new payment term '%s'. You can only switch to a "
|
||||
"payment term that has the same number of terms "
|
||||
"with the same amount.") % (
|
||||
inv.invoice_payment_term_id.name, self.invoice_payment_term_id.name))
|
||||
for line in lines:
|
||||
line.date_maturity = new_pterm[iamount].pop()
|
||||
|
||||
def run(self):
|
||||
self.ensure_one()
|
||||
inv = self.invoice_id
|
||||
updated = False
|
||||
# re-write date_maturity on move line
|
||||
self._update_payment_term_move()
|
||||
ivals = self._prepare_invoice()
|
||||
if ivals:
|
||||
updated = True
|
||||
inv.write(ivals)
|
||||
for line in self.line_ids:
|
||||
ilvals = self._prepare_invoice_line(line)
|
||||
if ilvals:
|
||||
updated = True
|
||||
# note that updating analytic_distribution will delete/re-create
|
||||
# the analytic line with inverse method, we do not need additional
|
||||
# logic about that.
|
||||
line.invoice_line_id.write(ilvals)
|
||||
if updated:
|
||||
inv.message_post(body=self.env._(
|
||||
'Non-legal fields of invoice updated via the Invoice Update '
|
||||
'wizard.'))
|
||||
# Purge existing PDF
|
||||
report = self.env.ref("account.account_invoices")
|
||||
attachment = report.retrieve_attachment(inv)
|
||||
# attachment may be None
|
||||
if attachment:
|
||||
attachment.unlink()
|
||||
return True
|
||||
|
||||
|
||||
class AccountMoveLineUpdate(models.TransientModel):
|
||||
_name = 'account.move.line.update'
|
||||
_description = 'Update non-legal fields of invoice lines'
|
||||
_order = "sequence, name"
|
||||
|
||||
sequence = fields.Integer()
|
||||
parent_id = fields.Many2one(
|
||||
'account.move.update', string='Wizard', ondelete='cascade')
|
||||
invoice_line_id = fields.Many2one(
|
||||
'account.move.line', string='Invoice Line', readonly=True)
|
||||
name = fields.Text(string='Description', required=True)
|
||||
display_type = fields.Selection(
|
||||
related="invoice_line_id.display_type",
|
||||
help="Technical field for UX purpose.")
|
||||
quantity = fields.Float(
|
||||
string='Quantity', digits='Product Unit of Measure', readonly=True)
|
||||
price_subtotal = fields.Monetary(
|
||||
string='Amount', readonly=True)
|
||||
currency_id = fields.Many2one('res.currency', readonly=True)
|
||||
analytic_distribution = fields.Json(
|
||||
string="Analytic",
|
||||
# compute="_compute_writeoff_analytic_distribution",
|
||||
# readonly=False,
|
||||
# store=True,
|
||||
# precompute=True,
|
||||
)
|
||||
analytic_precision = fields.Integer(
|
||||
default=lambda self: self.env["decimal.precision"].precision_get(
|
||||
"Percentage Analytic"
|
||||
),
|
||||
)
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
© 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="account_invoice_update_form" model="ir.ui.view">
|
||||
<field name="model">account.move.update</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Update Invoice Wizard">
|
||||
<group name="main">
|
||||
<field name="invoice_id" invisible="1"/>
|
||||
<field name="move_type" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="partner_id" invisible="1"/>
|
||||
<field string="Bill Date" invisible="move_type not in ('in_invoice', 'in_refund')" name="invoice_date"/>
|
||||
<field string="Bill Reference" invisible="move_type not in ('in_invoice', 'in_refund')" name="ref"/>
|
||||
<field string="Customer Reference" invisible="move_type not in ('out_invoice', 'out_refund')" name="ref"/>
|
||||
<field string="Ref" invisible="move_type != 'entry'" name="ref"/>
|
||||
<field name="invoice_origin" invisible="move_type == 'entry'"/>
|
||||
<!-- update of payment term is broken -->
|
||||
<!-- <field name="invoice_payment_term_id" widget="selection"/>-->
|
||||
<field name="partner_bank_id" invisible="move_type == 'entry'"/>
|
||||
<field name="invoice_user_id" options="{'no_open': True, 'no_create': True, 'no_create_edit': True}" invisible="move_type == 'entry'"/>
|
||||
</group>
|
||||
<group name="lines">
|
||||
<field name="line_ids" nolabel="1" widget="section_and_note_one2many">
|
||||
<list editable="bottom" create="false" delete="false" edit="true">
|
||||
<field name="invoice_line_id" column_invisible="1"/>
|
||||
<field name="display_type" column_invisible="1"/>
|
||||
<field name="currency_id" column_invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="quantity" invisible="display_type != 'product'" column_invisible="parent.move_type == 'entry'"/>
|
||||
<field name="price_subtotal" invisible="display_type != 'product'" column_invisible="parent.move_type == 'entry'"/>
|
||||
<field
|
||||
name="analytic_distribution"
|
||||
widget="analytic_distribution"
|
||||
groups="analytic.group_analytic_accounting"
|
||||
options="{'account_field': 'account_id', 'business_domain': 'general'}"
|
||||
invisible="display_type != 'product'"
|
||||
/>
|
||||
</list>
|
||||
</field>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="run" type="object" class="oe_highlight" string="Update"/>
|
||||
<button special="cancel" string="Cancel" class="oe_link"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account_invoice_update_action" model="ir.actions.act_window">
|
||||
<field name="name">Invoice Update Wizard</field>
|
||||
<field name="res_model">account.move.update</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
39
account_invoice_update_wizard_payment_mode/README.rst
Normal file
39
account_invoice_update_wizard_payment_mode/README.rst
Normal file
@@ -0,0 +1,39 @@
|
||||
.. 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
account_invoice_update_wizard_payment_mode/__init__.py
Normal file
1
account_invoice_update_wizard_payment_mode/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import wizard
|
||||
17
account_invoice_update_wizard_payment_mode/__manifest__.py
Normal file
17
account_invoice_update_wizard_payment_mode/__manifest__.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# Copyright 2022 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Account Invoice Update Wizard Payment Mode',
|
||||
'version': '14.0.1.0.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Add Payment Mode to Invoice Update Wizard',
|
||||
'author': 'Akretion',
|
||||
'website': 'https://github.com/akretion/odoo-usability',
|
||||
'depends': ['account_invoice_update_wizard', 'account_payment_partner'],
|
||||
'data': ['wizard/account_move_update_view.xml'],
|
||||
'installable': False,
|
||||
'auto_install': True,
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_move_form_inherit" model="ir.ui.view">
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="button_draft" position="before">
|
||||
<button name="prepare_update_wizard" type="object" string="Update Invoice" states="posted" groups="account.group_account_invoice"/>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -0,0 +1 @@
|
||||
from . import account_move_update
|
||||
@@ -0,0 +1,24 @@
|
||||
# Copyright 2022 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
|
||||
|
||||
class AccountMoveUpdate(models.TransientModel):
|
||||
_inherit = 'account.move.update'
|
||||
|
||||
payment_mode_filter_type_domain = fields.Char(
|
||||
related='invoice_id.payment_mode_filter_type_domain')
|
||||
partner_bank_filter_type_domain = fields.Many2one(
|
||||
related='invoice_id.partner_bank_filter_type_domain')
|
||||
bank_account_required = fields.Boolean(
|
||||
related='invoice_id.bank_account_required')
|
||||
payment_mode_id = fields.Many2one("account.payment.mode")
|
||||
|
||||
@api.model
|
||||
def _m2o_fields2update(self):
|
||||
m2o_list = super()._m2o_fields2update()
|
||||
m2o_list.append('payment_mode_id')
|
||||
return m2o_list
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2022 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="account_invoice_update_form" model="ir.ui.view">
|
||||
<field name="model">account.move.update</field>
|
||||
<field name="inherit_id" ref="account_invoice_update_wizard.account_invoice_update_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="invoice_payment_term_id" position="after">
|
||||
<field name="payment_mode_filter_type_domain" invisible="1"/>
|
||||
<field name="partner_bank_filter_type_domain" invisible="1"/>
|
||||
<field name="bank_account_required" invisible="1"/>
|
||||
<field name="payment_mode_id" domain="[('payment_type', '=', payment_mode_filter_type_domain), ('company_id', '=', company_id)]"/>
|
||||
</field>
|
||||
<field name="partner_bank_id" position="attributes">
|
||||
<attribute name="domain">
|
||||
[('partner_id', '=', partner_bank_filter_type_domain),
|
||||
'|',('company_id', '=', company_id),('company_id', '=', False)]
|
||||
</attribute>
|
||||
<attribute name="attrs">{'required': [('bank_account_required', '=', True),('move_type', 'in', ('in_invoice', 'in_refund'))]}</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
1
account_move_label_copy/__init__.py
Normal file
1
account_move_label_copy/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
||||
29
account_move_label_copy/__manifest__.py
Normal file
29
account_move_label_copy/__manifest__.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# Copyright 2022 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 Label Copy',
|
||||
'version': '14.0.1.0.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'When creating a Journal Entry manually, copy label from line to line',
|
||||
'description': """
|
||||
Account Move Label Copy
|
||||
=======================
|
||||
|
||||
This module is ONLY for users who don't accept to use the 'Reference' (ref) to store the description of the journal entry (the recommended method), but want to use the label on the lines for that purpose (name field of account.move.line). With this module, the label of the first line will be copied by default to the other lines upon creation of each line.
|
||||
|
||||
I don't recommend the use of this module.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': [
|
||||
'account',
|
||||
'base_view_inheritance_extension',
|
||||
],
|
||||
'data': [
|
||||
'views/account_move.xml',
|
||||
],
|
||||
'installable': False,
|
||||
}
|
||||
1
account_move_label_copy/models/__init__.py
Normal file
1
account_move_label_copy/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import account_move
|
||||
13
account_move_label_copy/models/account_move.py
Normal file
13
account_move_label_copy/models/account_move.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Copyright 2022 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = "account.move"
|
||||
|
||||
default_move_line_name = fields.Char(
|
||||
related='line_ids.name',
|
||||
string='Default Journal Item Label')
|
||||
23
account_move_label_copy/views/account_move.xml
Normal file
23
account_move_label_copy/views/account_move.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2022 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).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_move_form" model="ir.ui.view">
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="narration" position="after">
|
||||
<field name="default_move_line_name" invisible="1"/>
|
||||
</field>
|
||||
<xpath expr="//page[@id='aml_tab']/field[@name='line_ids']" position="attributes">
|
||||
<attribute name="context" operation="python_dict" key="default_name">default_move_line_name</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -1,3 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import wizard
|
||||
@@ -1,25 +0,0 @@
|
||||
# -*- 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,
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_move_line_filter
|
||||
@@ -1,46 +0,0 @@
|
||||
# -*- 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 or Partially Reconciled'),
|
||||
('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
|
||||
@@ -1,44 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,3 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_move_line
|
||||
@@ -1,44 +0,0 @@
|
||||
# -*- 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,
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
# -*- 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.
|
Before Width: | Height: | Size: 15 KiB |
@@ -1 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
@@ -1,25 +0,0 @@
|
||||
# -*- 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', 'base_usability'],
|
||||
'data': ['account_view.xml'],
|
||||
'installable': True,
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
<?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>
|
||||
|
||||
<!-- ANALYTIC ACCOUNT -->
|
||||
<record id="view_account_analytic_account_form" model="ir.ui.view">
|
||||
<field name="name">account_no_analytic_tags.analytic.account.form</field>
|
||||
<field name="model">account.analytic.account</field>
|
||||
<field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="tag_ids" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account.account_analytic_tag_menu" model="ir.ui.menu">
|
||||
<field name="groups_id" eval="[(6, 0, [ref('base_usability.group_nobody')])]"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -0,0 +1 @@
|
||||
from . import report
|
||||
@@ -0,0 +1,33 @@
|
||||
# Copyright 2023 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Account Product Fiscal Classification - Sale',
|
||||
'version': '16.0.1.0.0',
|
||||
'category': 'Sales',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Glue module between account_product_fiscal_classification and sale',
|
||||
'description': """
|
||||
This module adds a **Start Date** and **End Date** field on invoice
|
||||
lines. For example, if you have an insurance contrat for your company
|
||||
that run from April 1st 2013 to March 31st 2014, you will enter these
|
||||
dates as start and end dates on the supplier invoice line. If your
|
||||
fiscal year ends on December 31st 2013, 3 months of expenses are part of
|
||||
the 2014 fiscal year and should not be part of the 2013 fiscal year. So,
|
||||
thanks to this module, you will create a *Prepaid Expense* on December
|
||||
31st 2013 and OpenERP will identify this expense with the 3 months that
|
||||
are after the cut-off date and propose to generate the appropriate
|
||||
cut-off journal entry.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion
|
||||
<alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'maintainers': ['alexis-via'],
|
||||
'website': 'https://github.com/akretion/odoo-usability',
|
||||
'depends': ['pos_sale', 'account_product_fiscal_classification'],
|
||||
"data": ['report/sale_report_view.xml'],
|
||||
'auto_install': True,
|
||||
'installable': False,
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
from . import sale_report
|
||||
@@ -0,0 +1,35 @@
|
||||
# Copyright 2023 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class SaleReport(models.Model):
|
||||
_inherit = "sale.report"
|
||||
|
||||
fiscal_classification_id = fields.Many2one(
|
||||
"account.product.fiscal.classification",
|
||||
string="Product Fiscal Classification",
|
||||
readonly=True,
|
||||
)
|
||||
|
||||
def _select_additional_fields(self):
|
||||
res = super()._select_additional_fields()
|
||||
res["fiscal_classification_id"] = "t.fiscal_classification_id"
|
||||
return res
|
||||
|
||||
def _group_by_sale(self):
|
||||
res = super()._group_by_sale()
|
||||
res += ", t.fiscal_classification_id"
|
||||
return res
|
||||
|
||||
def _fill_pos_fields(self, additional_fields):
|
||||
res = super()._fill_pos_fields(additional_fields)
|
||||
res['fiscal_classification_id'] = "t.fiscal_classification_id"
|
||||
return res
|
||||
|
||||
def _group_by_pos(self):
|
||||
res = super()._group_by_pos()
|
||||
res += ", t.fiscal_classification_id"
|
||||
return res
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2023 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).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_order_product_search" model="ir.ui.view">
|
||||
<field name="model">sale.report</field>
|
||||
<field name="inherit_id" ref="sale.view_order_product_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter name="Category" position="after">
|
||||
<filter name="fiscal_classification_groupby" string="Product Fiscal Classification" context="{'group_by': 'fiscal_classification_id'}"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -1,6 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account
|
||||
from . import account_invoice_report
|
||||
from . import partner
|
||||
from . import wizard
|
||||
@@ -1,47 +0,0 @@
|
||||
# -*- 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 Usability',
|
||||
'version': '10.0.1.0.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Small usability enhancements in account module',
|
||||
'description': """
|
||||
Account Usability
|
||||
=================
|
||||
|
||||
The usability enhancements include:
|
||||
* show the supplier invoice number in the tree view of supplier invoices
|
||||
* add an *Overdue* filter on invoice search view (this feature was previously located in te module *account_invoice_overdue_filter*)
|
||||
* Increase the default limit of 80 lines in account move and account move line view.
|
||||
* Fast search on *Reconcile Ref* for account move line.
|
||||
* disable reconciliation "guessing"
|
||||
|
||||
Together with this module, I recommend the use of the following modules:
|
||||
* account_invoice_supplier_ref_unique (OCA project account-invoicing)
|
||||
* account_move_line_no_default_search (OCA project account-financial-tools)
|
||||
* invoice_fiscal_position_update (OCA project account-invoicing)
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': [
|
||||
'account',
|
||||
'base_view_inheritance_extension',
|
||||
'base_usability', # needed only to access base_usability.group_nobody
|
||||
# in v12, I may create a module only for group_nobody
|
||||
],
|
||||
'data': [
|
||||
'account_view.xml',
|
||||
'account_report.xml',
|
||||
'account_invoice_report_view.xml',
|
||||
'partner_view.xml',
|
||||
'product_view.xml',
|
||||
'wizard/account_invoice_mark_sent_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
@@ -1,618 +0,0 @@
|
||||
# -*- 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.tools.misc import formatLang
|
||||
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)
|
||||
|
||||
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
|
||||
|
||||
# when you have an invoice created from a lot of sale orders, the 'name'
|
||||
# field is very large, which makes the name_get() of that invoice very big
|
||||
# which screws-up the form view of that invoice because of the link at the
|
||||
# top of the screen
|
||||
# That's why we have to cut the name_get() when it's too long
|
||||
def name_get(self):
|
||||
old_res = super(AccountInvoice, self).name_get()
|
||||
res = []
|
||||
for old_re in old_res:
|
||||
name = old_re[1]
|
||||
if name and len(name) > 100:
|
||||
# nice cut
|
||||
name = u'%s ...' % ', '.join(name.split(', ')[:3])
|
||||
# if not enough, hard cut
|
||||
if len(name) > 120:
|
||||
name = u'%s ...' % old_re[1][:120]
|
||||
res.append((old_re[0], name))
|
||||
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
|
||||
|
||||
def fix_invoice_attachment_filename(self):
|
||||
# This script is designed to fix attachment of invoices
|
||||
# badly generated by Odoo v8. I found this problem in Nov 2018 at
|
||||
# Encres Dubuit when investigating a bug where Odoo would create a
|
||||
# new attachment when printing an old invoice that already had the
|
||||
# PDF of the invoice as attachment
|
||||
logger.info('START fix customer invoice attachment filename')
|
||||
# Run this script as admin to fix problem in all companies
|
||||
self = self.sudo()
|
||||
attachs = self.env['ir.attachment'].search([
|
||||
('res_model', '=', 'account.invoice'),
|
||||
('res_id', '!=', False),
|
||||
('type', '=', 'binary'),
|
||||
('name', '=like', 'INV%.pdf'),
|
||||
('datas_fname', '=like', 'INV%.pdf.pdf')])
|
||||
for attach in attachs:
|
||||
inv = self.browse(attach.res_id)
|
||||
if inv.type in ('out_invoice', 'out_refund'):
|
||||
attach.datas_fname = attach.name
|
||||
logger.info(
|
||||
'Fixed field datas_fname of attachment ID %s name %s',
|
||||
attach.id, attach.name)
|
||||
logger.info('END fix customer invoice attachment filename')
|
||||
|
||||
|
||||
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, compute_sudo=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 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
|
||||
|
||||
@api.model
|
||||
def create_account_groups(self, level=2, name_prefix=u'Comptes '):
|
||||
'''Should be launched by a script. Make sure the account_group module is installed
|
||||
(the account_usability module doesn't depend on it currently'''
|
||||
assert level >= 1
|
||||
assert isinstance(level, int)
|
||||
companies = self.env['res.company'].search([])
|
||||
if len(companies) > 1:
|
||||
logger.info(
|
||||
'Multi-company detected: running script create_account_groups '
|
||||
'as admin')
|
||||
self = self.sudo()
|
||||
ago = self.env['account.group']
|
||||
groups = ago.search([])
|
||||
if groups:
|
||||
raise UserError(_("Some account groups already exists"))
|
||||
accounts = self.search([])
|
||||
struct = {'childs': {}}
|
||||
for account in accounts:
|
||||
assert len(account.code) > level
|
||||
n = 1
|
||||
parent = struct
|
||||
gparent = False
|
||||
while n <= level:
|
||||
group_code = account.code[:n]
|
||||
if group_code not in parent['childs']:
|
||||
new_group = ago.create({
|
||||
'name': u'%s%s' % (name_prefix or '', group_code),
|
||||
'code_prefix': group_code,
|
||||
'parent_id': gparent and gparent.id or False,
|
||||
})
|
||||
parent['childs'][group_code] = {'obj': new_group, 'childs': {}}
|
||||
parent = parent['childs'][group_code]
|
||||
gparent = parent['obj']
|
||||
n += 1
|
||||
account.group_id = gparent.id
|
||||
|
||||
|
||||
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.name))
|
||||
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)]})
|
||||
date = fields.Date(copy=False)
|
||||
default_account_id = fields.Many2one(
|
||||
related='journal_id.default_debit_account_id', readonly=True)
|
||||
default_credit = fields.Float(
|
||||
compute='_compute_default_credit_debit', readonly=True)
|
||||
default_debit = fields.Float(
|
||||
compute='_compute_default_credit_debit', readonly=True)
|
||||
|
||||
@api.depends('line_ids.credit', 'line_ids.debit')
|
||||
def _compute_default_credit_debit(self):
|
||||
for move in self:
|
||||
total_debit = total_credit = default_debit = default_credit = 0.0
|
||||
for l in move.line_ids:
|
||||
total_debit += l.debit
|
||||
total_credit += l.credit
|
||||
# I could use float_compare, but I don't think it's really needed
|
||||
# in this context
|
||||
if total_debit > total_credit:
|
||||
default_credit = total_debit - total_credit
|
||||
else:
|
||||
default_debit = total_credit - total_debit
|
||||
move.default_credit = default_credit
|
||||
move.default_debit = default_debit
|
||||
|
||||
|
||||
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')
|
||||
date_maturity = fields.Date(copy=False)
|
||||
account_reconcile = fields.Boolean(
|
||||
related='account_id.reconcile', readonly=True)
|
||||
full_reconcile_id = fields.Many2one(string='Full Reconcile')
|
||||
matched_debit_ids = fields.One2many(string='Partial Reconcile Debit')
|
||||
matched_credit_ids = fields.One2many(string='Partial Reconcile Credit')
|
||||
reconcile_string = fields.Char(
|
||||
compute='_compute_reconcile_string', string='Reconcile', store=True)
|
||||
|
||||
@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
|
||||
|
||||
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
|
||||
|
||||
@api.depends(
|
||||
'full_reconcile_id', 'matched_debit_ids', 'matched_credit_ids')
|
||||
def _compute_reconcile_string(self):
|
||||
for line in self:
|
||||
rec_str = False
|
||||
if line.full_reconcile_id:
|
||||
rec_str = line.full_reconcile_id.name
|
||||
else:
|
||||
rec_str = ', '.join([
|
||||
'a%d' % pr.id for pr in line.matched_debit_ids + line.matched_credit_ids])
|
||||
line.reconcile_string = rec_str
|
||||
|
||||
|
||||
class AccountPartialReconcile(models.Model):
|
||||
_inherit = "account.partial.reconcile"
|
||||
_rec_name = "id"
|
||||
|
||||
def name_get(self):
|
||||
res = []
|
||||
for rec in self:
|
||||
# There is no seq for partial rec, so I simulate one with the ID
|
||||
# Prefix for full rec: 'A' (upper case)
|
||||
# Prefix for partial rec: 'a' (lower case)
|
||||
amount_fmt = formatLang(self.env, rec.amount, currency_obj=rec.company_currency_id)
|
||||
name = 'a%d (%s)' % (rec.id, amount_fmt)
|
||||
res.append((rec.id, name))
|
||||
return res
|
||||
|
||||
|
||||
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
|
||||
|
||||
@api.multi
|
||||
@api.depends('name', 'start_date', 'end_date')
|
||||
def name_get(self):
|
||||
res = []
|
||||
for statement in self:
|
||||
name = "%s (%s => %s)" % (
|
||||
statement.name, statement.start_date, statement.end_date)
|
||||
res.append((statement.id, name))
|
||||
return res
|
||||
|
||||
|
||||
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...
|
||||
@@ -1,27 +0,0 @@
|
||||
# -*- 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).
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class AccountInvoiceReport(models.Model):
|
||||
_inherit = 'account.invoice.report'
|
||||
|
||||
number = fields.Char(string="Number", readonly=True)
|
||||
|
||||
def _sub_select(self):
|
||||
select_str = super(AccountInvoiceReport, self)._sub_select()
|
||||
select_str += ", ai.number"
|
||||
return select_str
|
||||
|
||||
def _select(self):
|
||||
select_str = super(AccountInvoiceReport, self)._select()
|
||||
select_str += ", sub.number"
|
||||
return select_str
|
||||
|
||||
def _group_by(self):
|
||||
group_by_str = super(AccountInvoiceReport, self)._group_by()
|
||||
group_by_str += ", ai.number"
|
||||
return group_by_str
|
||||
@@ -1,51 +0,0 @@
|
||||
<?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_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="number"/>
|
||||
<field name="date"/>
|
||||
<field name="date_due"/>
|
||||
<field name="type"/>
|
||||
<field name="commercial_partner_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="product_id"/>
|
||||
<field name="product_qty" sum="1"/>
|
||||
<field name="uom_name" groups="product.group_uom"/>
|
||||
<field name="price_total" sum="1"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account.action_account_invoice_report_all_supp" model="ir.actions.act_window">
|
||||
<field name="context">{'search_default_current': 1, 'search_default_supplier': 1, 'search_default_year': 1}</field> <!-- Remove group_by_no_leaf, which breaks tree view -->
|
||||
</record>
|
||||
|
||||
<record id="account.action_account_invoice_report_all" model="ir.actions.act_window">
|
||||
<field name="context">{'search_default_current': 1, 'search_default_customer': 1, 'search_default_year': 1}</field> <!-- Remove group_by_no_leaf, which breaks tree view -->
|
||||
</record>
|
||||
|
||||
<record id="view_account_invoice_report_pivot" model="ir.ui.view">
|
||||
<field name="name">usability.account.invoice.report</field>
|
||||
<field name="model">account.invoice.report</field>
|
||||
<field name="inherit_id" ref="account.view_account_invoice_report_pivot"/>
|
||||
<field name="arch" type="xml">
|
||||
<pivot position="attributes">
|
||||
<attribute name="disable_linking"></attribute>
|
||||
</pivot>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
@@ -1,15 +0,0 @@
|
||||
<?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>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user