Compare commits
655 Commits
8.0-improv
...
14.0-remov
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80a8f674a7 | ||
|
|
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 |
56
.gitignore
vendored
Normal file
56
.gitignore
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
env/
|
||||
bin/
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.coverage
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
|
||||
# Pycharm
|
||||
.idea
|
||||
|
||||
# Mr Developer
|
||||
.mr.developer.cfg
|
||||
.project
|
||||
.pydevproject
|
||||
|
||||
# Rope
|
||||
.ropeproject
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# Backup files
|
||||
*~
|
||||
*.swp
|
||||
1
account_fiscal_position_payable_receivable/__init__.py
Normal file
1
account_fiscal_position_payable_receivable/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
||||
23
account_fiscal_position_payable_receivable/__manifest__.py
Normal file
23
account_fiscal_position_payable_receivable/__manifest__.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# © 2016-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "Account Fiscal Position Payable Receivable",
|
||||
"version": "12.0.1.0.0",
|
||||
"category": "Accounting & Finance",
|
||||
"license": "AGPL-3",
|
||||
"summary": "Configure payable/receivable accounts on fiscal positions",
|
||||
"description": """
|
||||
Account Fiscal Position Payable Receivable
|
||||
==========================================
|
||||
|
||||
This module allows to configure a special *Partner Receivable Account* and a special *Partner Payable Account* on fiscal positions. This is used in the onchange of the fiscal position of partners.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||
""",
|
||||
"author": "Akretion",
|
||||
"website": "http://www.akretion.com",
|
||||
"depends": ["account"],
|
||||
"data": ["views/account_fiscal_position_view.xml"],
|
||||
"installable": False,
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
from . import account_fiscal_position
|
||||
from . import res_partner
|
||||
@@ -0,0 +1,21 @@
|
||||
# © 2016-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class AccountFiscalPosition(models.Model):
|
||||
_inherit = "account.fiscal.position"
|
||||
|
||||
receivable_account_id = fields.Many2one(
|
||||
"account.account",
|
||||
string="Partner Receivable Account",
|
||||
company_dependent=True,
|
||||
domain=[("internal_type", "=", "receivable")],
|
||||
)
|
||||
payable_account_id = fields.Many2one(
|
||||
"account.account",
|
||||
string="Partner Payable Account",
|
||||
company_dependent=True,
|
||||
domain=[("internal_type", "=", "payable")],
|
||||
)
|
||||
@@ -0,0 +1,25 @@
|
||||
# © 2016-2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, api
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = "res.partner"
|
||||
|
||||
@api.onchange("property_account_position_id")
|
||||
def fiscal_position_receivable_payable_change(self):
|
||||
fp = self.property_account_position_id
|
||||
ipo = self.env["ir.property"]
|
||||
if fp.receivable_account_id:
|
||||
self.property_account_receivable_id = fp.receivable_account_id
|
||||
else:
|
||||
self.property_account_receivable_id = ipo.get(
|
||||
"property_account_receivable_id", "res.partner"
|
||||
)
|
||||
if fp.payable_account_id:
|
||||
self.property_account_payable_id = fp.payable_account_id
|
||||
else:
|
||||
self.property_account_payable_id = ipo.get(
|
||||
"property_account_payable_id", "res.partner"
|
||||
)
|
||||
@@ -0,0 +1,23 @@
|
||||
<?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>
|
||||
2
account_invoice_margin/__init__.py
Normal file
2
account_invoice_margin/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import account_invoice
|
||||
from . import account_invoice_report
|
||||
24
account_invoice_margin/__manifest__.py
Normal file
24
account_invoice_margin/__manifest__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# Copyright 2015-2019 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Account Invoice Margin',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Invoicing Management',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Copy standard price on invoice line and compute margins',
|
||||
'description': """
|
||||
This module copies the field *standard_price* of the product on the invoice line when the invoice line is created. The allows the computation of the margin of the invoice.
|
||||
|
||||
This module has been written by Alexis de Lattre from Akretion
|
||||
<alexis.delattre@akretion.com>.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account'],
|
||||
'data': [
|
||||
'account_invoice_view.xml',
|
||||
],
|
||||
'installable': False,
|
||||
}
|
||||
152
account_invoice_margin/account_invoice.py
Normal file
152
account_invoice_margin/account_invoice.py
Normal file
@@ -0,0 +1,152 @@
|
||||
# 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 api, fields, models
|
||||
import odoo.addons.decimal_precision as dp
|
||||
|
||||
|
||||
class AccountInvoiceLine(models.Model):
|
||||
_inherit = 'account.invoice.line'
|
||||
|
||||
standard_price_company_currency = fields.Float(
|
||||
string='Cost Price in Company Currency', readonly=True,
|
||||
digits=dp.get_precision('Product Price'),
|
||||
help="Cost price in company currency in the unit of measure "
|
||||
"of the invoice line (which may be different from the unit "
|
||||
"of measure of the product).")
|
||||
standard_price_invoice_currency = fields.Float(
|
||||
string='Cost Price in Invoice Currency', readonly=True,
|
||||
compute='_compute_margin', store=True,
|
||||
digits=dp.get_precision('Product Price'),
|
||||
help="Cost price in invoice currency in the unit of measure "
|
||||
"of the invoice line")
|
||||
margin_invoice_currency = fields.Monetary(
|
||||
string='Margin in Invoice Currency', readonly=True, store=True,
|
||||
compute='_compute_margin', currency_field='currency_id')
|
||||
margin_company_currency = fields.Monetary(
|
||||
string='Margin in Company Currency', readonly=True, store=True,
|
||||
compute='_compute_margin', currency_field='company_currency_id')
|
||||
margin_rate = fields.Float(
|
||||
string="Margin Rate", readonly=True, store=True,
|
||||
compute='_compute_margin',
|
||||
digits=(16, 2), help="Margin rate in percentage of the sale price")
|
||||
|
||||
@api.depends(
|
||||
'standard_price_company_currency', 'invoice_id.currency_id',
|
||||
'invoice_id.type', 'invoice_id.company_id',
|
||||
'invoice_id.date_invoice', 'quantity', 'price_subtotal')
|
||||
def _compute_margin(self):
|
||||
for il in self:
|
||||
standard_price_inv_cur = 0.0
|
||||
margin_inv_cur = 0.0
|
||||
margin_comp_cur = 0.0
|
||||
margin_rate = 0.0
|
||||
inv = il.invoice_id
|
||||
if inv and inv.type in ('out_invoice', 'out_refund'):
|
||||
# it works in _get_current_rate
|
||||
# even if we set date = False in context
|
||||
# standard_price_inv_cur is in the UoM of the invoice line
|
||||
date = inv._get_currency_rate_date() or\
|
||||
fields.Date.context_today(self)
|
||||
company = inv.company_id
|
||||
company_currency = company.currency_id
|
||||
standard_price_inv_cur =\
|
||||
company_currency._convert(
|
||||
il.standard_price_company_currency,
|
||||
inv.currency_id, company, date)
|
||||
margin_inv_cur =\
|
||||
il.price_subtotal - il.quantity * standard_price_inv_cur
|
||||
margin_comp_cur = inv.currency_id._convert(
|
||||
margin_inv_cur, company_currency, company, date)
|
||||
if il.price_subtotal:
|
||||
margin_rate = 100 * margin_inv_cur / il.price_subtotal
|
||||
# for a refund, margin should be negative
|
||||
# but margin rate should stay positive
|
||||
if inv.type == 'out_refund':
|
||||
margin_inv_cur *= -1
|
||||
margin_comp_cur *= -1
|
||||
il.standard_price_invoice_currency = standard_price_inv_cur
|
||||
il.margin_invoice_currency = margin_inv_cur
|
||||
il.margin_company_currency = margin_comp_cur
|
||||
il.margin_rate = margin_rate
|
||||
|
||||
# We want to copy standard_price on invoice line for customer
|
||||
# invoice/refunds. We can't do that via on_change of product_id,
|
||||
# because it is not always played when invoice is created from code
|
||||
# => we inherit write/create
|
||||
# We write standard_price_company_currency even on supplier invoice/refunds
|
||||
# because we don't have access to the 'type' of the invoice
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
if vals.get('product_id'):
|
||||
pp = self.env['product.product'].browse(vals['product_id'])
|
||||
std_price = pp.standard_price
|
||||
inv_uom_id = vals.get('uom_id')
|
||||
if inv_uom_id and inv_uom_id != pp.uom_id.id:
|
||||
inv_uom = self.env['uom.uom'].browse(inv_uom_id)
|
||||
std_price = pp.uom_id._compute_price(
|
||||
std_price, inv_uom)
|
||||
vals['standard_price_company_currency'] = std_price
|
||||
return super(AccountInvoiceLine, self).create(vals)
|
||||
|
||||
def write(self, vals):
|
||||
if not vals:
|
||||
vals = {}
|
||||
if 'product_id' in vals or 'uom_id' in vals:
|
||||
for il in self:
|
||||
if 'product_id' in vals:
|
||||
if vals.get('product_id'):
|
||||
pp = self.env['product.product'].browse(
|
||||
vals['product_id'])
|
||||
else:
|
||||
pp = False
|
||||
else:
|
||||
pp = il.product_id or False
|
||||
# uom_id is NOT a required field
|
||||
if 'uom_id' in vals:
|
||||
if vals.get('uom_id'):
|
||||
inv_uom = self.env['uom.uom'].browse(
|
||||
vals['uom_id'])
|
||||
else:
|
||||
inv_uom = False
|
||||
else:
|
||||
inv_uom = il.uom_id or False
|
||||
std_price = 0.0
|
||||
if pp:
|
||||
std_price = pp.standard_price
|
||||
if inv_uom and inv_uom != pp.uom_id:
|
||||
std_price = pp.uom_id._compute_price(
|
||||
std_price, inv_uom)
|
||||
il.write({'standard_price_company_currency': std_price})
|
||||
return super(AccountInvoiceLine, self).write(vals)
|
||||
|
||||
|
||||
class AccountInvoice(models.Model):
|
||||
_inherit = 'account.invoice'
|
||||
|
||||
margin_invoice_currency = fields.Monetary(
|
||||
string='Margin in Invoice Currency',
|
||||
compute='_compute_margin', store=True, readonly=True,
|
||||
currency_field='currency_id')
|
||||
margin_company_currency = fields.Monetary(
|
||||
string='Margin in Company Currency',
|
||||
compute='_compute_margin', store=True, readonly=True,
|
||||
currency_field='company_currency_id')
|
||||
|
||||
@api.depends(
|
||||
'type',
|
||||
'invoice_line_ids.margin_invoice_currency',
|
||||
'invoice_line_ids.margin_company_currency')
|
||||
def _compute_margin(self):
|
||||
res = self.env['account.invoice.line'].read_group(
|
||||
[('invoice_id', 'in', self.ids)],
|
||||
['invoice_id', 'margin_invoice_currency',
|
||||
'margin_company_currency'],
|
||||
['invoice_id'])
|
||||
for re in res:
|
||||
if re['invoice_id']:
|
||||
inv = self.browse(re['invoice_id'][0])
|
||||
if inv.type in ('out_invoice', 'out_refund'):
|
||||
inv.margin_invoice_currency = re['margin_invoice_currency']
|
||||
inv.margin_company_currency = re['margin_company_currency']
|
||||
60
account_invoice_margin/account_invoice_report.py
Normal file
60
account_invoice_margin/account_invoice_report.py
Normal file
@@ -0,0 +1,60 @@
|
||||
# Copyright 2018-2019 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountInvoiceReport(models.Model):
|
||||
_inherit = 'account.invoice.report'
|
||||
|
||||
margin = fields.Float(string='Margin', readonly=True)
|
||||
# why digits=0 ??? Why is it like that in the native "account" module
|
||||
user_currency_margin = fields.Float(
|
||||
string="Margin", compute='_compute_user_currency_margin', digits=0)
|
||||
|
||||
_depends = {
|
||||
'account.invoice': [
|
||||
'account_id', 'amount_total_company_signed',
|
||||
'commercial_partner_id', 'company_id',
|
||||
'currency_id', 'date_due', 'date_invoice', 'fiscal_position_id',
|
||||
'journal_id', 'number', 'partner_bank_id', 'partner_id',
|
||||
'payment_term_id', 'residual', 'state', 'type', 'user_id',
|
||||
],
|
||||
'account.invoice.line': [
|
||||
'account_id', 'invoice_id', 'price_subtotal', 'product_id',
|
||||
'quantity', 'uom_id', 'account_analytic_id',
|
||||
'margin_company_currency',
|
||||
],
|
||||
'product.product': ['product_tmpl_id'],
|
||||
'product.template': ['categ_id'],
|
||||
'uom.uom': ['category_id', 'factor', 'name', 'uom_type'],
|
||||
'res.currency.rate': ['currency_id', 'name'],
|
||||
'res.partner': ['country_id'],
|
||||
}
|
||||
|
||||
@api.depends('currency_id', 'date', 'margin')
|
||||
def _compute_user_currency_margin(self):
|
||||
user_currency = self.env.user.company_id.currency_id
|
||||
currency_rate = self.env['res.currency.rate'].search([
|
||||
('rate', '=', 1),
|
||||
'|',
|
||||
('company_id', '=', self.env.user.company_id.id),
|
||||
('company_id', '=', False)], limit=1)
|
||||
base_currency = currency_rate.currency_id
|
||||
for record in self:
|
||||
date = record.date or fields.Date.today()
|
||||
company = record.company_id
|
||||
record.user_currency_margin = base_currency._convert(
|
||||
record.margin, user_currency, company, date)
|
||||
|
||||
# TODO check for refunds
|
||||
def _sub_select(self):
|
||||
select_str = super(AccountInvoiceReport, self)._sub_select()
|
||||
select_str += ", SUM(ail.margin_company_currency) AS margin"
|
||||
return select_str
|
||||
|
||||
def _select(self):
|
||||
select_str = super(AccountInvoiceReport, self)._select()
|
||||
select_str += ", sub.margin AS margin"
|
||||
return select_str
|
||||
51
account_invoice_margin/account_invoice_view.xml
Normal file
51
account_invoice_margin/account_invoice_view.xml
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
© 2015-2017 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_invoice_line_form" model="ir.ui.view">
|
||||
<field name="name">margin.account.invoice.line.form</field>
|
||||
<field name="model">account.invoice.line</field>
|
||||
<field name="inherit_id" ref="account.view_invoice_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='analytic_tag_ids']/.." position="inside">
|
||||
<field name="standard_price_company_currency"
|
||||
string="Cost Price in Comp. Cur."
|
||||
groups="base.group_no_one"/>
|
||||
<field name="standard_price_invoice_currency"
|
||||
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>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="invoice_form" model="ir.ui.view">
|
||||
<field name="name">margin.account.invoice.form</field>
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="inherit_id" ref="account.invoice_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="move_id" position="after">
|
||||
<field name="margin_invoice_currency"
|
||||
string="Margin in Inv. Cur." groups="base.group_no_one"/>
|
||||
<field name="margin_company_currency"
|
||||
string="Margin in Comp. Cur." groups="base.group_no_one"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
@@ -1,46 +0,0 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Invoice Partner Bank Usability module for OpenERP
|
||||
# Copyright (C) 2013 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp.osv import orm
|
||||
|
||||
|
||||
class account_invoice(orm.Model):
|
||||
_inherit = "account.invoice"
|
||||
|
||||
def invoice_out_get_first_partner_bank(self, cr, uid, context=None):
|
||||
'''Get the first bank account of your company on customer invoice
|
||||
if your company only has one bank account'''
|
||||
if context is None:
|
||||
context = {}
|
||||
res_partner_bank_id = False
|
||||
if context.get('type') == 'out_invoice' or \
|
||||
context.get('inv_type') == 'out_invoice':
|
||||
cur_user = self.pool['res.users'].browse(
|
||||
cr, uid, uid, context=context)
|
||||
partner_banks = cur_user.company_id.partner_id.bank_ids
|
||||
if partner_banks and len(partner_banks) == 1:
|
||||
res_partner_bank_id = partner_banks[0].id
|
||||
return res_partner_bank_id
|
||||
|
||||
_defaults = {
|
||||
'partner_bank_id': invoice_out_get_first_partner_bank,
|
||||
}
|
||||
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>
|
||||
2
account_invoice_update_wizard/__init__.py
Normal file
2
account_invoice_update_wizard/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import models
|
||||
from . import wizard
|
||||
21
account_invoice_update_wizard/__manifest__.py
Normal file
21
account_invoice_update_wizard/__manifest__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Copyright 2017 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
|
||||
# Copyright 2018-2019 Camptocamp
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Account Invoice Update Wizard',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Wizard to update non-legal fields of an open/paid invoice',
|
||||
'author': 'Akretion',
|
||||
'website': 'https://github.com/akretion/odoo-usability',
|
||||
'depends': [
|
||||
'account',
|
||||
],
|
||||
'data': [
|
||||
'wizard/account_invoice_update_view.xml',
|
||||
'views/account_invoice.xml',
|
||||
],
|
||||
'installable': False,
|
||||
}
|
||||
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_invoice
|
||||
22
account_invoice_update_wizard/models/account_invoice.py
Normal file
22
account_invoice_update_wizard/models/account_invoice.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Copyright 2019 Camptocamp
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import UserError
|
||||
import odoo.addons.decimal_precision as dp
|
||||
|
||||
|
||||
class AccountInvoice(models.Model):
|
||||
_inherit = 'account.invoice'
|
||||
|
||||
def prepare_update_wizard(self):
|
||||
self.ensure_one()
|
||||
wizard = self.env['account.invoice.update']
|
||||
res = wizard._prepare_default_get(self)
|
||||
action = self.env.ref(
|
||||
'account_invoice_update_wizard.account_invoice_update_action'
|
||||
).read()[0]
|
||||
action['name'] = "Update Wizard"
|
||||
action['res_id'] = wizard.create(res).id
|
||||
return action
|
||||
|
||||
1
account_invoice_update_wizard/tests/__init__.py
Normal file
1
account_invoice_update_wizard/tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import test_account_invoice_update_wizard
|
||||
@@ -0,0 +1,196 @@
|
||||
# Copyright 2018-2019 Camptocamp
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo.tests.common import SavepointCase
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class TestAccountInvoiceUpdateWizard(SavepointCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.customer12 = cls.env.ref('base.res_partner_12')
|
||||
cls.product16 = cls.env.ref('product.product_product_16')
|
||||
cls.product24 = cls.env.ref('product.product_product_24')
|
||||
uom_unit = cls.env.ref('uom.product_uom_categ_unit')
|
||||
|
||||
cls.invoice1 = cls.env['account.invoice'].create({
|
||||
'name': 'Test invoice',
|
||||
'partner_id': cls.customer12.id,
|
||||
})
|
||||
cls.inv_line1 = cls.env['account.invoice.line'].create({
|
||||
'invoice_id': cls.invoice1.id,
|
||||
'name': "Line1",
|
||||
'product_id': cls.product16.id,
|
||||
'product_uom_id': uom_unit.id,
|
||||
'account_id': cls.invoice1.account_id.id,
|
||||
'price_unit': 42.0,
|
||||
})
|
||||
cls.inv_line2 = cls.env['account.invoice.line'].create({
|
||||
'invoice_id': cls.invoice1.id,
|
||||
'name': "Line2",
|
||||
'product_id': cls.product24.id,
|
||||
'product_uom_id': uom_unit.id,
|
||||
'account_id': cls.invoice1.account_id.id,
|
||||
'price_unit': 1111.1,
|
||||
})
|
||||
|
||||
cls.aa1 = cls.env.ref('analytic.analytic_partners_camp_to_camp')
|
||||
cls.aa2 = cls.env.ref('analytic.analytic_nebula')
|
||||
cls.atag1 = cls.env.ref('analytic.tag_contract')
|
||||
cls.atag2 = cls.env['account.analytic.tag'].create({
|
||||
'name': 'の',
|
||||
})
|
||||
|
||||
def create_wizard(self, invoice):
|
||||
res = self.invoice1.prepare_update_wizard()
|
||||
self.wiz = self.env['account.invoice.update'].browse(res['res_id'])
|
||||
|
||||
def test_add_analytic_account_line1(self):
|
||||
""" Add analytic account on an invoice line
|
||||
after the invoice has been approved.
|
||||
|
||||
This will:
|
||||
- update the move line
|
||||
- create a new analytic line.
|
||||
"""
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard(self.invoice1)
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.account_analytic_id = self.aa1
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_account_id, self.aa1)
|
||||
self.assertEqual(related_ml.analytic_line_ids.account_id, self.aa1)
|
||||
|
||||
def test_change_analytic_account_line1(self):
|
||||
""" Change analytic account on an invoice line
|
||||
after the invoice has been approved.
|
||||
|
||||
This will:
|
||||
- update the move line
|
||||
- update the existing analytic line."""
|
||||
self.inv_line1.account_analytic_id = self.aa2
|
||||
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard(self.invoice1)
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.account_analytic_id = self.aa1
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_account_id, self.aa1)
|
||||
self.assertEqual(related_ml.analytic_line_ids.account_id, self.aa1)
|
||||
|
||||
def test_error_grouped_move_lines(self):
|
||||
""" Change analytic account on an invoice line
|
||||
after the invoice has been approved where both
|
||||
lines were grouped in the same move line.
|
||||
|
||||
This will raise an error.
|
||||
"""
|
||||
self.invoice1.journal_id.group_invoice_lines = True
|
||||
|
||||
self.inv_line2.product_id = self.product16
|
||||
self.inv_line2.unit_price = 42.0
|
||||
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard(self.invoice1)
|
||||
|
||||
line1 = self.wiz.line_ids[0]
|
||||
line1.account_analytic_id = self.aa1
|
||||
with self.assertRaises(UserError):
|
||||
self.wiz.run()
|
||||
|
||||
def test_add_analytic_tags_line1(self):
|
||||
""" Add analytic tags on an invoice line
|
||||
after the invoice has been approved.
|
||||
|
||||
This will update move line.
|
||||
"""
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard(self.invoice1)
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.analytic_tag_ids = self.atag2
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_tag_ids, self.atag2)
|
||||
self.assertFalse(related_ml.analytic_line_ids)
|
||||
|
||||
def test_change_analytic_tags_line1(self):
|
||||
""" Change analytic tags on an invoice line
|
||||
after the invoice has been approved.
|
||||
|
||||
It will update move line and analytic line
|
||||
"""
|
||||
self.inv_line1.account_analytic_id = self.aa2
|
||||
self.inv_line1.analytic_tag_ids = self.atag1
|
||||
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard(self.invoice1)
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.analytic_tag_ids = self.atag2
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_tag_ids, self.atag2)
|
||||
self.assertEqual(related_ml.analytic_line_ids.tag_ids, self.atag2)
|
||||
|
||||
def test_add_analytic_info_line1(self):
|
||||
""" Add analytic account and tags on an invoice line
|
||||
after the invoice has been approved.
|
||||
|
||||
This will:
|
||||
- update move line
|
||||
- create an analytic line
|
||||
"""
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard(self.invoice1)
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.account_analytic_id = self.aa1
|
||||
wiz_line.analytic_tag_ids = self.atag2
|
||||
self.wiz.run()
|
||||
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertEqual(related_ml.analytic_account_id, self.aa1)
|
||||
self.assertEqual(related_ml.analytic_tag_ids, self.atag2)
|
||||
self.assertEqual(related_ml.analytic_line_ids.account_id, self.aa1)
|
||||
self.assertEqual(related_ml.analytic_line_ids.tag_ids, self.atag2)
|
||||
|
||||
def test_empty_analytic_account_line1(self):
|
||||
""" Remove analytic account
|
||||
after the invoice has been approved.
|
||||
|
||||
This will raise an error as it is not implemented.
|
||||
"""
|
||||
self.inv_line1.account_analytic_id = self.aa2
|
||||
|
||||
self.invoice1.action_invoice_open()
|
||||
self.create_wizard(self.invoice1)
|
||||
|
||||
wiz_line = self.wiz.line_ids.filtered(
|
||||
lambda rec: rec.invoice_line_id == self.inv_line1)
|
||||
wiz_line.account_analytic_id = False
|
||||
self.wiz.run()
|
||||
related_ml = self.invoice1.move_id.line_ids.filtered(
|
||||
lambda rec: rec.product_id == self.product16)
|
||||
self.assertFalse(related_ml.analytic_account_id)
|
||||
self.assertFalse(related_ml.analytic_line_ids)
|
||||
29
account_invoice_update_wizard/views/account_invoice.xml
Normal file
29
account_invoice_update_wizard/views/account_invoice.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?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="invoice_supplier_form" model="ir.ui.view">
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="inherit_id" ref="account.invoice_supplier_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_invoice_draft" position="before">
|
||||
<button name="prepare_update_wizard" type="object" string="Update Invoice" states="open,paid" groups="account.group_account_invoice"/>
|
||||
</button>
|
||||
</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_draft" position="before">
|
||||
<button name="prepare_update_wizard" type="object" string="Update Invoice" states="open,paid" groups="account.group_account_invoice"/>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
1
account_invoice_update_wizard/wizard/__init__.py
Normal file
1
account_invoice_update_wizard/wizard/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import account_invoice_update
|
||||
302
account_invoice_update_wizard/wizard/account_invoice_update.py
Normal file
302
account_invoice_update_wizard/wizard/account_invoice_update.py
Normal file
@@ -0,0 +1,302 @@
|
||||
# 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).
|
||||
|
||||
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,
|
||||
'display_type': line.display_type,
|
||||
}])
|
||||
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.items():
|
||||
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(body=_(
|
||||
'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)
|
||||
display_type = fields.Selection([
|
||||
('line_section', "Section"),
|
||||
('line_note', "Note")], default=False, help="Technical field for UX purpose.")
|
||||
quantity = fields.Float(
|
||||
string='Quantity', digits=dp.get_precision('Product Unit of Measure'),
|
||||
readonly=True)
|
||||
price_subtotal = fields.Float(
|
||||
string='Amount', readonly=True, digits=dp.get_precision('Account'))
|
||||
account_analytic_id = fields.Many2one(
|
||||
'account.analytic.account', string='Analytic Account')
|
||||
analytic_tag_ids = fields.Many2many(
|
||||
'account.analytic.tag', string='Analytic Tags')
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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" create="false" delete="false" edit="true">
|
||||
<field name="invoice_line_id" invisible="1"/>
|
||||
<field name="display_type" invisible="1"/>
|
||||
<field name="name"/>
|
||||
<field name="quantity" attrs="{'invisible': [('display_type', '!=', False)]}"/>
|
||||
<field name="price_subtotal" attrs="{'invisible': [('display_type', '!=', False)]}"/>
|
||||
<field name="account_analytic_id" attrs="{'invisible': [('display_type', '!=', False)]}" groups="analytic.group_analytic_accounting"/>
|
||||
<field name="analytic_tag_ids" attrs="{'invisible': [('display_type', '!=', False)]}" groups="analytic.group_analytic_accounting" widget="many2many_tags"/>
|
||||
</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>
|
||||
96
account_usability/README.rst
Normal file
96
account_usability/README.rst
Normal file
@@ -0,0 +1,96 @@
|
||||
=================
|
||||
Account Usability
|
||||
=================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
:alt: Beta
|
||||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
|
||||
:target: https://github.com/akretion/odoo-usability/tree/12.0/account_usability
|
||||
:alt: akretion/odoo-usability
|
||||
|
||||
|badge1| |badge2| |badge3|
|
||||
|
||||
This modules adds the following functions:
|
||||
|
||||
* Add an *Overdue* filter on invoice search view (this feature was previously
|
||||
located in te module *account_invoice_overdue_filter*)
|
||||
* Increase the default limit of 80 lines in account move and account move line view.
|
||||
* disable reconciliation "guessing"
|
||||
* fast search on *Reconcile Ref* for account move line.
|
||||
* add sale dates to invoice report to be compliant with
|
||||
https://www.service-public.fr/professionnels-entreprises/vosdroits/F31808
|
||||
* Sale date on qweb invoices
|
||||
* A wizard to mark several invoices as sent at once (forward from v8)
|
||||
* Default date for Account Move Reversal is now D+1 instead of today
|
||||
* Track more fields on invoice (see details in account.py)
|
||||
* Add boolean fields `has_discount` and `has_attachment` on invoice
|
||||
* Add button "Delete line qty = 0" on supplier invoice
|
||||
* Cut name_get() of invoice if too long
|
||||
* A script for if Odoo screws up invoice attachment filename
|
||||
* help functions for py3o reports
|
||||
* Show code on name_get of journal
|
||||
* add direct search of journal using code
|
||||
* add copy=False on some fields
|
||||
* Add unicity constraint on analytic codes per company
|
||||
* Better default values on account move
|
||||
* Add link from account move line to invoice
|
||||
* Add start_date and end_date on bank statements
|
||||
* Add transfer_account_id to invoicing config page
|
||||
* Improve domain reconciliation widget
|
||||
* account.reconcile.model don't copy name to label via onchange
|
||||
* Add method to get fiscal position without partner_id
|
||||
* Restore drill-through on sale and invoice reports
|
||||
* don't attach PDF upon invoice report generation on supplier invoices/refunds
|
||||
* Add filter on debit and credit amount for Move Lines
|
||||
* Add supplier invoice number in invoice tree view
|
||||
|
||||
Together with this module, I recommend the use of the following modules:
|
||||
|
||||
* account_invoice_supplier_ref_unique (OCA project account-invoicing)
|
||||
* account_move_line_no_default_search (OCA project account-financial-tools)
|
||||
* invoice_fiscal_position_update (OCA project account-invoicing)
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20account_usability%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* Akretion
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* David Beal <david.beal@akretion.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/account_usability>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute.
|
||||
2
account_usability/__init__.py
Normal file
2
account_usability/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import models
|
||||
from . import wizard
|
||||
37
account_usability/__manifest__.py
Normal file
37
account_usability/__manifest__.py
Normal file
@@ -0,0 +1,37 @@
|
||||
# Copyright 2015-2020 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Account Usability',
|
||||
'version': '14.0.1.0.0',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Small usability enhancements in account module',
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': [
|
||||
'account',
|
||||
'base_view_inheritance_extension',
|
||||
'base_usability', # needed only to access base_usability.group_nobody
|
||||
# in v12, I may create a module only for group_nobody
|
||||
],
|
||||
'data': [
|
||||
'views/account_account_type.xml',
|
||||
'views/account_account.xml',
|
||||
'views/account_bank_statement.xml',
|
||||
'views/account_invoice_report.xml',
|
||||
'views/account_journal.xml',
|
||||
'views/account_move.xml',
|
||||
'views/account_menu.xml',
|
||||
'views/account_tax.xml',
|
||||
'views/product.xml',
|
||||
'views/res_config_settings.xml',
|
||||
'views/res_partner.xml',
|
||||
'views/account_report.xml',
|
||||
'wizard/account_invoice_mark_sent_view.xml',
|
||||
'wizard/account_group_generate_view.xml',
|
||||
'security/ir.model.access.csv',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
diff --git a/addons/account/models/account_payment.py b/addons/account/models/account_payment.py
|
||||
index 2dd1f9cef83..62275fca65e 100644
|
||||
--- a/addons/account/models/account_payment.py
|
||||
+++ b/addons/account/models/account_payment.py
|
||||
@@ -262,6 +262,7 @@ class AccountPayment(models.Model):
|
||||
'credit': write_off_balance > 0.0 and write_off_balance or 0.0,
|
||||
'partner_id': self.partner_id.id,
|
||||
'account_id': write_off_line_vals.get('account_id'),
|
||||
+ 'analytic_account_id': write_off_line_vals.get('analytic_account_id'),
|
||||
})
|
||||
return line_vals_list
|
||||
|
||||
@@ -699,6 +700,7 @@ class AccountPayment(models.Model):
|
||||
'name': writeoff_lines[0].name,
|
||||
'amount': writeoff_amount * sign,
|
||||
'account_id': writeoff_lines[0].account_id.id,
|
||||
+ 'analytic_account_id': writeoff_lines[0].analytic_account_id.id,
|
||||
}
|
||||
else:
|
||||
write_off_line_vals = {}
|
||||
diff --git a/addons/account/wizard/account_payment_register.py b/addons/account/wizard/account_payment_register.py
|
||||
index 3fc91f716ad..35636774c7e 100644
|
||||
--- a/addons/account/wizard/account_payment_register.py
|
||||
+++ b/addons/account/wizard/account_payment_register.py
|
||||
@@ -93,6 +93,7 @@ class AccountPaymentRegister(models.TransientModel):
|
||||
], default='open', string="Payment Difference Handling")
|
||||
writeoff_account_id = fields.Many2one('account.account', string="Difference Account", copy=False,
|
||||
domain="[('deprecated', '=', False), ('company_id', '=', company_id)]")
|
||||
+ writeoff_analytic_account_id = fields.Many2one('account.analytic.account', string="Difference Analytic Account", copy=False, domain="[('company_id', '=', company_id)]")
|
||||
writeoff_label = fields.Char(string='Journal Item Label', default='Write-Off',
|
||||
help='Change label of the counterpart that will hold the payment difference')
|
||||
|
||||
@@ -422,6 +423,7 @@ class AccountPaymentRegister(models.TransientModel):
|
||||
'name': self.writeoff_label,
|
||||
'amount': self.payment_difference,
|
||||
'account_id': self.writeoff_account_id.id,
|
||||
+ 'analytic_account_id': self.writeoff_analytic_account_id.id or False,
|
||||
}
|
||||
return payment_vals
|
||||
|
||||
diff --git a/addons/account/wizard/account_payment_register_views.xml b/addons/account/wizard/account_payment_register_views.xml
|
||||
index 16eec30e265..b9386567baa 100644
|
||||
--- a/addons/account/wizard/account_payment_register_views.xml
|
||||
+++ b/addons/account/wizard/account_payment_register_views.xml
|
||||
@@ -65,6 +65,10 @@
|
||||
string="Post Difference In"
|
||||
options="{'no_create': True}"
|
||||
attrs="{'required': [('payment_difference_handling', '=', 'reconcile')]}"/>
|
||||
+ <label for="writeoff_analytic_account_id" class="oe_edit_only" string="Analytic Account" groups="analytic.group_analytic_accounting"/>
|
||||
+ <field name="writeoff_analytic_account_id"
|
||||
+ groups="analytic.group_analytic_accounting"
|
||||
+ options="{'no_create': True}" />
|
||||
<label for="writeoff_label" class="oe_edit_only" string="Label"/>
|
||||
<field name="writeoff_label" attrs="{'required': [('payment_difference_handling', '=', 'reconcile')]}"/>
|
||||
</div>
|
||||
9
account_usability/models/__init__.py
Normal file
9
account_usability/models/__init__.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from . import account_account
|
||||
from . import account_analytic_account
|
||||
from . import account_bank_statement
|
||||
from . import account_incoterms
|
||||
from . import account_journal
|
||||
from . import account_move
|
||||
from . import account_partial_reconcile
|
||||
from . import res_partner
|
||||
from . import product
|
||||
59
account_usability/models/account_account.py
Normal file
59
account_usability/models/account_account.py
Normal file
@@ -0,0 +1,59 @@
|
||||
# Copyright 2015-2020 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, models
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class AccountAccount(models.Model):
|
||||
_inherit = 'account.account'
|
||||
|
||||
@api.depends('name', 'code')
|
||||
def name_get(self):
|
||||
if self._context.get('account_account_show_code_only'):
|
||||
res = []
|
||||
for record in self:
|
||||
res.append((record.id, record.code))
|
||||
return res
|
||||
else:
|
||||
return super().name_get()
|
||||
|
||||
# https://github.com/odoo/odoo/issues/23040
|
||||
# TODO mig to v14 ?
|
||||
def fix_bank_account_types(self):
|
||||
aao = self.env['account.account']
|
||||
companies = self.env['res.company'].search([])
|
||||
if len(companies) > 1:
|
||||
self = self.sudo()
|
||||
logger.info("START the script 'fix bank and cash account types'")
|
||||
bank_type = self.env.ref('account.data_account_type_liquidity')
|
||||
asset_type = self.env.ref('account.data_account_type_current_assets')
|
||||
journals = self.env['account.journal'].search(
|
||||
[('type', 'in', ('bank', 'cash'))], order='company_id')
|
||||
journal_accounts_bank_type = aao
|
||||
for journal in journals:
|
||||
for account in [
|
||||
journal.default_credit_account_id,
|
||||
journal.default_debit_account_id]:
|
||||
if account:
|
||||
if account.user_type_id != bank_type:
|
||||
account.user_type_id = bank_type.id
|
||||
logger.info(
|
||||
'Company %s: Account %s updated to Bank '
|
||||
'and Cash type',
|
||||
account.company_id.display_name, account.code)
|
||||
if account not in journal_accounts_bank_type:
|
||||
journal_accounts_bank_type += account
|
||||
accounts = aao.search([
|
||||
('user_type_id', '=', bank_type.id)], order='company_id, code')
|
||||
for account in accounts:
|
||||
if account not in journal_accounts_bank_type:
|
||||
account.user_type_id = asset_type.id
|
||||
logger.info(
|
||||
'Company %s: Account %s updated to Current Asset type',
|
||||
account.company_id.display_name, account.code)
|
||||
logger.info("END of the script 'fix bank and cash account types'")
|
||||
return True
|
||||
24
account_usability/models/account_analytic_account.py
Normal file
24
account_usability/models/account_analytic_account.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# Copyright 2015-2020 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountAnalyticAccount(models.Model):
|
||||
_inherit = 'account.analytic.account'
|
||||
|
||||
def name_get(self):
|
||||
if self._context.get('analytic_account_show_code_only'):
|
||||
res = []
|
||||
for record in self:
|
||||
res.append((record.id, record.code or record.name))
|
||||
return res
|
||||
else:
|
||||
return super().name_get()
|
||||
|
||||
_sql_constraints = [(
|
||||
'code_company_unique',
|
||||
'unique(code, company_id)',
|
||||
'An analytic account with the same code already '
|
||||
'exists in the same company!')]
|
||||
91
account_usability/models/account_bank_statement.py
Normal file
91
account_usability/models/account_bank_statement.py
Normal file
@@ -0,0 +1,91 @@
|
||||
# Copyright 2015-2020 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo.tools.misc import format_date
|
||||
|
||||
|
||||
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)
|
||||
hide_bank_statement_balance = fields.Boolean(
|
||||
related='journal_id.hide_bank_statement_balance', readonly=True)
|
||||
|
||||
@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
|
||||
|
||||
def _check_balance_end_real_same_as_computed(self):
|
||||
for stmt in self:
|
||||
if stmt.hide_bank_statement_balance:
|
||||
continue
|
||||
else:
|
||||
super(AccountBankStatement, stmt)._check_balance_end_real_same_as_computed()
|
||||
return True
|
||||
|
||||
@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 and format_date(self.env, statement.start_date) or '',
|
||||
statement.end_date and format_date(self.env, statement.end_date) or '')
|
||||
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().\
|
||||
# get_data_for_reconciliations(
|
||||
# cr, uid, ids, excluded_ids=excluded_ids,
|
||||
# search_reconciliation_proposition=search_rec_prop,
|
||||
# context=context)
|
||||
|
||||
def show_account_move(self):
|
||||
self.ensure_one()
|
||||
action = self.env.ref('account.action_move_line_form').read()[0]
|
||||
# Note: this action is on account.move, not account.move.line !
|
||||
action.update({
|
||||
'views': False,
|
||||
'view_id': False,
|
||||
'view_mode': 'form,tree',
|
||||
'res_id': self.move_id.id,
|
||||
})
|
||||
return action
|
||||
16
account_usability/models/account_incoterms.py
Normal file
16
account_usability/models/account_incoterms.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Copyright 2015-2020 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class AccountIncoterms(models.Model):
|
||||
_inherit = 'account.incoterms'
|
||||
|
||||
@api.depends('code', 'name')
|
||||
def name_get(self):
|
||||
res = []
|
||||
for rec in self:
|
||||
res.append((rec.id, '[%s] %s' % (rec.code, rec.name)))
|
||||
return res
|
||||
60
account_usability/models/account_journal.py
Normal file
60
account_usability/models/account_journal.py
Normal file
@@ -0,0 +1,60 @@
|
||||
# Copyright 2015-2020 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class AccountJournal(models.Model):
|
||||
_inherit = 'account.journal'
|
||||
|
||||
hide_bank_statement_balance = fields.Boolean(
|
||||
string='Hide Bank Statement Balance',
|
||||
help="You may want to enable this option when your bank "
|
||||
"journal is generated from a bank statement file that "
|
||||
"doesn't handle start/end balance (QIF for instance) and "
|
||||
"you don't want to enter the start/end balance manually: it "
|
||||
"will prevent the display of wrong information in the accounting "
|
||||
"dashboard and on bank statements.")
|
||||
|
||||
@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:
|
||||
name = "[%s] %s" % (journal.code, journal.name)
|
||||
if (
|
||||
journal.currency_id and
|
||||
journal.currency_id != journal.company_id.currency_id):
|
||||
name = "%s (%s)" % (name, journal.currency_id.name)
|
||||
res.append((journal.id, name))
|
||||
return res
|
||||
|
||||
# @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))
|
||||
222
account_usability/models/account_move.py
Normal file
222
account_usability/models/account_move.py
Normal file
@@ -0,0 +1,222 @@
|
||||
# Copyright 2015-2020 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo.tools import float_is_zero
|
||||
from odoo.tools.misc import format_date
|
||||
from odoo.osv import expression
|
||||
|
||||
|
||||
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(tracking=True)
|
||||
invoice_date_due = fields.Date(tracking=True)
|
||||
invoice_payment_term_id = fields.Many2one(tracking=True)
|
||||
journal_id = fields.Many2one(tracking=True)
|
||||
partner_bank_id = fields.Many2one(tracking=True)
|
||||
fiscal_position_id = fields.Many2one(tracking=True)
|
||||
amount_total = fields.Monetary(tracking=True)
|
||||
# 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)
|
||||
sale_dates = fields.Char(
|
||||
compute="_compute_sales_dates", readonly=True,
|
||||
help="This information appears on invoice qweb report "
|
||||
"(you may use it for your own report)")
|
||||
|
||||
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 line.display_type and 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 move in self:
|
||||
if iao.search_count([
|
||||
('res_model', '=', 'account.move'),
|
||||
('res_id', '=', move.id),
|
||||
('type', '=', 'binary'),
|
||||
('company_id', '=', move.company_id.id)]):
|
||||
move.has_attachment = True
|
||||
else:
|
||||
move.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.move'),
|
||||
('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', list(att_inv_ids))]
|
||||
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().name_get()
|
||||
res = []
|
||||
for old_re in old_res:
|
||||
name = old_re[1]
|
||||
if name and len(name) > 100:
|
||||
# nice cut
|
||||
name = '%s ...' % ', '.join(name.split(', ')[:3])
|
||||
# if not enough, hard cut
|
||||
if len(name) > 120:
|
||||
name = '%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 !
|
||||
# TODO mig to v12
|
||||
# def action_move_create(self):
|
||||
# res = super().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.move.line'].search([
|
||||
('display_type', '=', False),
|
||||
('move_id', 'in', self.ids),
|
||||
('quantity', '=', 0)])
|
||||
lines.unlink()
|
||||
return True
|
||||
|
||||
# for report
|
||||
def py3o_lines_layout(self):
|
||||
self.ensure_one()
|
||||
res = []
|
||||
has_sections = False
|
||||
subtotal = 0.0
|
||||
sign = self.move_type == 'out_refund' and -1 or 1
|
||||
for line in self.invoice_line_ids:
|
||||
if line.display_type == 'line_section':
|
||||
# insert line
|
||||
if has_sections:
|
||||
res.append({'subtotal': subtotal})
|
||||
subtotal = 0.0 # reset counter
|
||||
has_sections = True
|
||||
else:
|
||||
if not line.display_type:
|
||||
subtotal += line.price_subtotal * sign
|
||||
res.append({'line': line})
|
||||
if has_sections: # insert last subtotal line
|
||||
res.append({'subtotal': subtotal})
|
||||
# res:
|
||||
# [
|
||||
# {'line': account_invoice_line(1) with display_type=='line_section'},
|
||||
# {'line': account_invoice_line(2) without display_type},
|
||||
# {'line': account_invoice_line(3) without display_type},
|
||||
# {'line': account_invoice_line(4) with display_type=='line_note'},
|
||||
# {'subtotal': 8932.23},
|
||||
# ]
|
||||
return res
|
||||
|
||||
def _compute_sales_dates(self):
|
||||
""" French law requires to set sale order dates into invoice
|
||||
returned string: "sale1 (date1), sale2 (date2) ..."
|
||||
"""
|
||||
for inv in self:
|
||||
sales = inv.invoice_line_ids.mapped(
|
||||
'sale_line_ids').mapped('order_id')
|
||||
dates = ["%s (%s)" % (
|
||||
x.name, format_date(inv.env, self.date_order))
|
||||
for x in sales]
|
||||
inv.sale_dates = ", ".join(dates)
|
||||
|
||||
# allow to manually create moves not only in general journals,
|
||||
# but also in cash journal and check journals (= bank journals not linked to a bank account)
|
||||
@api.depends('company_id', 'invoice_filter_type_domain')
|
||||
def _compute_suitable_journal_ids(self):
|
||||
for move in self:
|
||||
if move.invoice_filter_type_domain:
|
||||
super(AccountMove, move)._compute_suitable_journal_ids()
|
||||
else:
|
||||
company_id = move.company_id.id or self.env.company.id
|
||||
domain = expression.AND([
|
||||
[('company_id', '=', company_id)],
|
||||
expression.OR([
|
||||
[('type', 'in', ('general', 'cash'))],
|
||||
[('type', '=', 'bank'), ('bank_account_id', '=', False)]
|
||||
])
|
||||
])
|
||||
move.suitable_journal_ids = self.env['account.journal'].search(domain)
|
||||
|
||||
|
||||
class AccountMoveLine(models.Model):
|
||||
_inherit = 'account.move.line'
|
||||
# Native order:
|
||||
# _order = "date desc, move_name desc, id"
|
||||
# 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"
|
||||
|
||||
# In the 'account' module, we have related stored field for:
|
||||
# name (move_name), date, ref, state (parent_state),
|
||||
# journal_id, company_id, payment_id, statement_line_id,
|
||||
account_reconcile = fields.Boolean(related='account_id.reconcile')
|
||||
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)
|
||||
# for optional display in tree view
|
||||
product_barcode = fields.Char(related='product_id.barcode', string="Product Barcode")
|
||||
|
||||
def show_account_move_form(self):
|
||||
self.ensure_one()
|
||||
action = self.env.ref('account.action_move_line_form').read()[0]
|
||||
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
|
||||
23
account_usability/models/account_partial_reconcile.py
Normal file
23
account_usability/models/account_partial_reconcile.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# Copyright 2015-2020 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
from odoo.tools.misc import formatLang
|
||||
|
||||
|
||||
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
|
||||
45
account_usability/models/product.py
Normal file
45
account_usability/models/product.py
Normal file
@@ -0,0 +1,45 @@
|
||||
# Copyright 2015-2021 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 api, fields, models, _
|
||||
|
||||
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = 'product.template'
|
||||
|
||||
# DON'T put store=True on those fields, because they are company dependent
|
||||
sale_price_type = fields.Selection(
|
||||
'_sale_purchase_price_type_sel', compute='_compute_sale_price_type',
|
||||
string='Sale Price Type', compute_sudo=False, readonly=True)
|
||||
purchase_price_type = fields.Selection(
|
||||
'_sale_purchase_price_type_sel', compute='_compute_purchase_price_type',
|
||||
string='Purchase Price Type', compute_sudo=False, readonly=True)
|
||||
|
||||
@api.model
|
||||
def _sale_purchase_price_type_sel(self):
|
||||
return [('incl', _('Tax incl.')), ('excl', _('Tax excl.'))]
|
||||
|
||||
@api.depends('taxes_id')
|
||||
def _compute_sale_price_type(self):
|
||||
for pt in self:
|
||||
sale_price_type = 'incl'
|
||||
if pt.taxes_id and all([not t.price_include for t in pt.taxes_id if t.amount_type == 'percent']):
|
||||
sale_price_type = 'excl'
|
||||
pt.sale_price_type = sale_price_type
|
||||
|
||||
@api.depends('supplier_taxes_id')
|
||||
def _compute_purchase_price_type(self):
|
||||
for pt in self:
|
||||
purchase_price_type = 'incl'
|
||||
if pt.supplier_taxes_id and all([not t.price_include for t in pt.supplier_taxes_id if t.amount_type == 'percent']):
|
||||
purchase_price_type = 'excl'
|
||||
pt.purchase_price_type = purchase_price_type
|
||||
|
||||
|
||||
class ProductSupplierinfo(models.Model):
|
||||
_inherit = 'product.supplierinfo'
|
||||
|
||||
# DON'T put store=True on those fields, because they are company dependent
|
||||
purchase_price_type = fields.Selection(
|
||||
related='product_tmpl_id.purchase_price_type', related_sudo=False)
|
||||
12
account_usability/models/res_partner.py
Normal file
12
account_usability/models/res_partner.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# Copyright 2017-2020 Akretion France (https://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 ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
invoice_warn = fields.Selection(tracking=True)
|
||||
property_account_position_id = fields.Many2one(tracking=True)
|
||||
2
account_usability/readme/CONTRIBUTORS.rst
Normal file
2
account_usability/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1,2 @@
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* David Beal <david.beal@akretion.com>
|
||||
39
account_usability/readme/DESCRIPTION.rst
Normal file
39
account_usability/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1,39 @@
|
||||
This modules adds the following functions:
|
||||
|
||||
* Add an *Overdue* filter on invoice search view (this feature was previously
|
||||
located in te module *account_invoice_overdue_filter*)
|
||||
* Increase the default limit of 80 lines in account move and account move line view.
|
||||
* disable reconciliation "guessing"
|
||||
* fast search on *Reconcile Ref* for account move line.
|
||||
* add sale dates to invoice report to be compliant with
|
||||
https://www.service-public.fr/professionnels-entreprises/vosdroits/F31808
|
||||
* Sale date on qweb invoices
|
||||
* A wizard to mark several invoices as sent at once (forward from v8)
|
||||
* Default date for Account Move Reversal is now D+1 instead of today
|
||||
* Track more fields on invoice (see details in account.py)
|
||||
* Add boolean fields `has_discount` and `has_attachment` on invoice
|
||||
* Add button "Delete line qty = 0" on supplier invoice
|
||||
* Cut name_get() of invoice if too long
|
||||
* A script for if Odoo screws up invoice attachment filename
|
||||
* help functions for py3o reports
|
||||
* Show code on name_get of journal
|
||||
* add direct search of journal using code
|
||||
* add copy=False on some fields
|
||||
* Add unicity constraint on analytic codes per company
|
||||
* Better default values on account move
|
||||
* Add link from account move line to invoice
|
||||
* Add start_date and end_date on bank statements
|
||||
* Add transfer_account_id to invoicing config page
|
||||
* Improve domain reconciliation widget
|
||||
* account.reconcile.model don't copy name to label via onchange
|
||||
* Add method to get fiscal position without partner_id
|
||||
* Restore drill-through on sale and invoice reports
|
||||
* don't attach PDF upon invoice report generation on supplier invoices/refunds
|
||||
* Add filter on debit and credit amount for Move Lines
|
||||
* Add supplier invoice number in invoice tree view
|
||||
|
||||
Together with this module, I recommend the use of the following modules:
|
||||
|
||||
* account_invoice_supplier_ref_unique (OCA project account-invoicing)
|
||||
* account_move_line_no_default_search (OCA project account-financial-tools)
|
||||
* invoice_fiscal_position_update (OCA project account-invoicing)
|
||||
10
account_usability/report/invoice_report.xml
Normal file
10
account_usability/report/invoice_report.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="report_invoice_document" inherit_id="account.report_invoice_document">
|
||||
<xpath expr="//div[@name='origin']/p" position="replace">
|
||||
<p class="m-0" t-field="o.sale_dates"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
3
account_usability/security/ir.model.access.csv
Normal file
3
account_usability/security/ir.model.access.csv
Normal file
@@ -0,0 +1,3 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_account_group_generate_full,Full access on account.group.generate,model_account_group_generate,account.group_account_manager,1,1,1,1
|
||||
access_account_invoice_mark_sent_full,Full access on account.invoice.mark.sent,model_account_invoice_mark_sent,account.group_account_invoice,1,1,1,1
|
||||
|
BIN
account_usability/static/description/icon.png
Normal file
BIN
account_usability/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.5 KiB |
454
account_usability/static/description/index.html
Normal file
454
account_usability/static/description/index.html
Normal file
@@ -0,0 +1,454 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<title>Account Usability</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="account-usability">
|
||||
<h1 class="title">Account Usability</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/account_usability"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
|
||||
<p>This modules adds the following functions:</p>
|
||||
<ul class="simple">
|
||||
<li>Add an <em>Overdue</em> filter on invoice search view (this feature was previously
|
||||
located in te module <em>account_invoice_overdue_filter</em>)</li>
|
||||
<li>Increase the default limit of 80 lines in account move and account move line view.</li>
|
||||
<li>disable reconciliation “guessing”</li>
|
||||
<li>fast search on <em>Reconcile Ref</em> for account move line.</li>
|
||||
<li>add sale dates to invoice report to be compliant with
|
||||
<a class="reference external" href="https://www.service-public.fr/professionnels-entreprises/vosdroits/F31808">https://www.service-public.fr/professionnels-entreprises/vosdroits/F31808</a></li>
|
||||
<li>Sale date on qweb invoices</li>
|
||||
<li>A wizard to mark several invoices as sent at once (forward from v8)</li>
|
||||
<li>Default date for Account Move Reversal is now D+1 instead of today</li>
|
||||
<li>Track more fields on invoice (see details in account.py)</li>
|
||||
<li>Add boolean fields <cite>has_discount</cite> and <cite>has_attachment</cite> on invoice</li>
|
||||
<li>Add button “Delete line qty = 0” on supplier invoice</li>
|
||||
<li>Cut name_get() of invoice if too long</li>
|
||||
<li>A script for if Odoo screws up invoice attachment filename</li>
|
||||
<li>help functions for py3o reports</li>
|
||||
<li>Show code on name_get of journal</li>
|
||||
<li>add direct search of journal using code</li>
|
||||
<li>add copy=False on some fields</li>
|
||||
<li>Add unicity constraint on analytic codes per company</li>
|
||||
<li>Better default values on account move</li>
|
||||
<li>Add link from account move line to invoice</li>
|
||||
<li>Add start_date and end_date on bank statements</li>
|
||||
<li>Add transfer_account_id to invoicing config page</li>
|
||||
<li>Improve domain reconciliation widget</li>
|
||||
<li>account.reconcile.model don’t copy name to label via onchange</li>
|
||||
<li>Add method to get fiscal position without partner_id</li>
|
||||
<li>Restore drill-through on sale and invoice reports</li>
|
||||
<li>don’t attach PDF upon invoice report generation on supplier invoices/refunds</li>
|
||||
<li>Add filter on debit and credit amount for Move Lines</li>
|
||||
<li>Add supplier invoice number in invoice tree view</li>
|
||||
</ul>
|
||||
<p>Together with this module, I recommend the use of the following modules:</p>
|
||||
<ul class="simple">
|
||||
<li>account_invoice_supplier_ref_unique (OCA project account-invoicing)</li>
|
||||
<li>account_move_line_no_default_search (OCA project account-financial-tools)</li>
|
||||
<li>invoice_fiscal_position_update (OCA project account-invoicing)</li>
|
||||
</ul>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/akretion/odoo-usability/issues">GitHub Issues</a>.
|
||||
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
|
||||
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20account_usability%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Akretion</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Alexis de Lattre <<a class="reference external" href="mailto:alexis.delattre@akretion.com">alexis.delattre@akretion.com</a>></li>
|
||||
<li>David Beal <<a class="reference external" href="mailto:david.beal@akretion.com">david.beal@akretion.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/account_usability">akretion/odoo-usability</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
38
account_usability/views/account_account.xml
Normal file
38
account_usability/views/account_account.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2021 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_account_form" model="ir.ui.view">
|
||||
<field name="name">account.account.form</field>
|
||||
<field name="model">account.account</field>
|
||||
<field name="inherit_id" ref="account.view_account_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="deprecated" position="before">
|
||||
<field name="reconcile" attrs="{'invisible': ['|', ('internal_type','=','liquidity'), ('internal_group', '=', 'off_balance')]}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_account_search" model="ir.ui.view">
|
||||
<field name="name">account.account.search</field>
|
||||
<field name="model">account.account</field>
|
||||
<field name="inherit_id" ref="account.view_account_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<!-- The native "name" filter uses a domain ['|', ('name','ilike',self), ('code','=like',str(self)+'%')]
|
||||
This is good because it uses '=like' on 'code', but sometimes there are digits in account names,
|
||||
so you get additionnal unexpected accounts in the result of the search -->
|
||||
<field name="name" position="after">
|
||||
<field name="code" filter_domain="[('code', '=like', str(self)+'%')]" string="Code"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
21
account_usability/views/account_account_type.xml
Normal file
21
account_usability/views/account_account_type.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2020 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_account_type_tree" model="ir.ui.view">
|
||||
<field name="name">account_usability.account_type_tree</field>
|
||||
<field name="model">account.account.type</field>
|
||||
<field name="inherit_id" ref="account.view_account_type_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="type" position="after">
|
||||
<field name="include_initial_balance" optional="show"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
90
account_usability/views/account_bank_statement.xml
Normal file
90
account_usability/views/account_bank_statement.xml
Normal file
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2020 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="view_bank_statement_form" model="ir.ui.view">
|
||||
<field name="name">usability.account.bank.statement.form</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="account.view_bank_statement_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='line_ids']/tree/button[@name='button_undo_reconciliation']" position="after">
|
||||
<field name="move_id" invisible="1"/>
|
||||
<button name="show_account_move" type="object"
|
||||
title="View Journal Entry" icon="fa-arrow-right"/>
|
||||
</xpath>
|
||||
<field name="date" position="after">
|
||||
<field name="start_date"/>
|
||||
<field name="end_date"/>
|
||||
<field name="hide_bank_statement_balance" invisible="1"/>
|
||||
</field>
|
||||
<field name="date" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<label for="balance_start" position="attributes">
|
||||
<attribute name="attrs">{'invisible': [('hide_bank_statement_balance', '=', True)]}</attribute>
|
||||
</label>
|
||||
<label for="balance_end_real" position="attributes">
|
||||
<attribute name="attrs">{'invisible': [('hide_bank_statement_balance', '=', True)]}</attribute>
|
||||
</label>
|
||||
<xpath expr="//field[@name='balance_start']/.." position="attributes">
|
||||
<attribute name="attrs">{'invisible': [('hide_bank_statement_balance', '=', True)]}</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='balance_end_real']/.." position="attributes">
|
||||
<attribute name="attrs">{'invisible': [('hide_bank_statement_balance', '=', True)]}</attribute>
|
||||
</xpath>
|
||||
<group name="sale_total" position="attributes">
|
||||
<attribute name="attrs">{'invisible': [('hide_bank_statement_balance', '=', True)]}</attribute>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_bank_statement_tree" model="ir.ui.view">
|
||||
<field name="name">usability.account.bank.statement.tree</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="account.view_bank_statement_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="date" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<field name="journal_id" position="after">
|
||||
<field name="start_date"/>
|
||||
<field name="end_date"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_bank_statement_search" model="ir.ui.view">
|
||||
<field name="name">usability.account.bank.statement.search</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="account.view_bank_statement_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="date" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<filter name="filter_date" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</filter>
|
||||
<filter name="date" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</filter>
|
||||
<field name="date" position="after">
|
||||
<field name="start_date"/>
|
||||
<field name="end_date"/>
|
||||
</field>
|
||||
<filter name="date" position="after">
|
||||
<filter name="start_date_groupby" string="Start Date"
|
||||
context="{'group_by': 'start_date'}"/>
|
||||
<filter name="end_date_groupby" string="End Date"
|
||||
context="{'group_by': 'end_date'}"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
51
account_usability/views/account_invoice_report.xml
Normal file
51
account_usability/views/account_invoice_report.xml
Normal file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2018-2020 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<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="move_id"/>
|
||||
<field name="invoice_date"/>
|
||||
<field name="invoice_date_due"/>
|
||||
<field name="move_type"/>
|
||||
<field name="commercial_partner_id"/>
|
||||
<field name="invoice_user_id"/>
|
||||
<field name="product_id"/>
|
||||
<field name="quantity" sum="1"/>
|
||||
<field name="product_uom_id" groups="uom.group_uom"/>
|
||||
<field name="price_subtotal" 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, 'group_by': ['invoice_date']}</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, 'group_by': ['invoice_date']}</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>
|
||||
59
account_usability/views/account_journal.xml
Normal file
59
account_usability/views/account_journal.xml
Normal file
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2020 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_account_journal_form" model="ir.ui.view">
|
||||
<field name="name">usability.account.journal.form</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="inherit_id" ref="account.view_account_journal_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="bank_statements_source" position="after">
|
||||
<field name="hide_bank_statement_balance" groups="account.group_account_readonly"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account_journal_dashboard_kanban_view" model="ir.ui.view">
|
||||
<field name="name">usability.account.journal.dashboard</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="inherit_id" ref="account.account_journal_dashboard_kanban_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="kanban_dashboard" position="after">
|
||||
<field name="hide_bank_statement_balance"/>
|
||||
</field>
|
||||
<xpath expr="//div[@name='latest_statement']/.." position="attributes">
|
||||
<attribute name="t-if">dashboard.has_at_least_one_statement and dashboard.account_balance != dashboard.last_balance and !record.hide_bank_statement_balance.raw_value</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_journal_tree" model="ir.ui.view">
|
||||
<field name="name">usability.account.journal.tree</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="inherit_id" ref="account.view_account_journal_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="code" optional="show"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_journal_search" model="ir.ui.view">
|
||||
<field name="name">usability.account.journal.search</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="inherit_id" ref="account.view_account_journal_search"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter name="inactive" position="after">
|
||||
<group name="groupby" string="Group By">
|
||||
<filter name="type_groupby" string="Type" context="{'group_by': 'type'}"/>
|
||||
</group>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
16
account_usability/views/account_menu.xml
Normal file
16
account_usability/views/account_menu.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2020 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<!-- Duplicate the menu "Sales > Configuration > Contacts > Bank Accounts"
|
||||
under "Accounting > Configuration", because most users will try to find it there -->
|
||||
<menuitem id="res_bank_account_config_menu" action="base.action_res_bank_form" parent="account.account_banks_menu" sequence="10"/>
|
||||
|
||||
<menuitem id="res_partner_bank_account_config_menu" action="base.action_res_partner_bank_account_form" parent="account.account_banks_menu" sequence="20"/>
|
||||
|
||||
</odoo>
|
||||
99
account_usability/views/account_move.xml
Normal file
99
account_usability/views/account_move.xml
Normal file
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2020 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_move_form" model="ir.ui.view">
|
||||
<field name="name">account_usability.account.move.form</field>
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="fiscal_position_id" position="attributes">
|
||||
<attribute name="widget">selection</attribute>
|
||||
</field>
|
||||
<field name="invoice_incoterm_id" position="attributes">
|
||||
<attribute name="widget">selection</attribute>
|
||||
</field>
|
||||
<!-- move sent field and make it visible -->
|
||||
<field name="is_move_sent" position="replace"/>
|
||||
<field name="invoice_origin" position="after">
|
||||
<field name="is_move_sent" attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
|
||||
</field>
|
||||
<xpath expr="//field[@name='line_ids']/tree/field[@name='analytic_account_id']" position="attributes">
|
||||
<attribute name="optional">show</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='line_ids']/tree/field[@name='tax_tag_ids']" position="after">
|
||||
<field name="matching_number" optional="hide"/>
|
||||
<field name="reconcile_string" optional="show"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='product_id']" position="after">
|
||||
<field name="product_barcode" optional="hide"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_invoice_filter" model="ir.ui.view">
|
||||
<field name="name">account_usability.account.move.search</field>
|
||||
<field name="model">account.move</field>
|
||||
<field name="inherit_id" ref="account.view_account_invoice_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter name="due_date" position="after">
|
||||
<separator/>
|
||||
<filter name="to_send" string="To Send" domain="[('is_move_sent', '=', False), ('state', '=', 'posted'), ('move_type', 'in', ('out_invoice', 'out_refund'))]"/>
|
||||
<filter name="sent" string="Sent" domain="[('is_move_sent', '=', True), ('move_type', 'in', ('out_invoice', 'out_refund'))]"/>
|
||||
<separator/>
|
||||
<filter name="no_attachment" string="Missing Attachment" domain="[('has_attachment', '=', False)]"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_move_line_tree" model="ir.ui.view">
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_move_line_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="matching_number" position="after">
|
||||
<button title="View Journal Entry Form" type="object" name="show_account_move_form" icon="fa-arrow-right"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_move_line_filter" model="ir.ui.view">
|
||||
<field name="name">account_usability.account_move_line_search</field>
|
||||
<field name="model">account.move.line</field>
|
||||
<field name="inherit_id" ref="account.view_account_move_line_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<filter name="unposted" position="before">
|
||||
<filter name="current_year" string="Current Year" domain="[('date', '>=', (context_today().strftime('%Y-01-01'))), ('date', '<=', (context_today().strftime('%Y-12-31')))]"/>
|
||||
<filter name="previous_year" string="Previous Year" domain="[('date', '>=', (context_today() + relativedelta(day=1, month=1, years=-1)).strftime('%Y-%m-%d')), ('date', '<=', (context_today() + relativedelta(day=31, month=12, years=-1)).strftime('%Y-%m-%d'))]"/>
|
||||
<separator/>
|
||||
</filter>
|
||||
<field name="partner_id" position="after">
|
||||
<field name="reconcile_string" />
|
||||
<field name="debit" filter_domain="['|', ('debit', '=', self), ('credit', '=', self)]" string="Debit or Credit"/>
|
||||
</field>
|
||||
<filter name="unreconciled" position="before">
|
||||
<filter name="reconciled" string="Fully Reconciled" domain="[('full_reconcile_id', '!=', False)]"/>
|
||||
</filter>
|
||||
<filter name="unreconciled" position="attributes">
|
||||
<attribute name="string">Unreconciled or Partially Reconciled</attribute>
|
||||
</filter>
|
||||
<!--
|
||||
<field name="name" position="attributes">
|
||||
<attribute name="string">Name or Reference</attribute>
|
||||
</field> -->
|
||||
<field name="partner_id" position="attributes">
|
||||
<attribute name="domain">['|', ('parent_id', '=', False), ('is_company', '=', True)]</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account.action_move_journal_line" model="ir.actions.act_window">
|
||||
<field name="context">{'default_move_type': 'entry', 'view_no_maturity': True}</field>
|
||||
<!-- Remove 'search_default_misc_filter': 1 -->
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
21
account_usability/views/account_report.xml
Normal file
21
account_usability/views/account_report.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2018-2020 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="account.account_invoices" model="ir.actions.report">
|
||||
<!-- Attach only on customer invoices/refunds -->
|
||||
<field name="attachment">(object.move_type in ('out_invoice', 'out_refund')) and (object.state == 'posted') and ((object.name or 'INV').replace('/','_')+'.pdf')</field>
|
||||
</record>
|
||||
|
||||
<record id="account.account_invoices_without_payment" model="ir.actions.report">
|
||||
<!-- Attach only on customer invoices/refunds -->
|
||||
<field name="attachment">(object.move_type in ('out_invoice', 'out_refund')) and (object.state == 'posted') and ((object.name or 'INV').replace('/','_')+'.pdf')</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
20
account_usability/views/account_tax.xml
Normal file
20
account_usability/views/account_tax.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2020 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_tax_tree" model="ir.ui.view">
|
||||
<field name="model">account.tax</field>
|
||||
<field name="inherit_id" ref="account.view_tax_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="description" position="after">
|
||||
<field name="price_include" optional="show"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
72
account_usability/views/product.xml
Normal file
72
account_usability/views/product.xml
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2017-2020 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<!-- In the official account module, on product category and product template,
|
||||
some fields/groups are on account.group_account_invoice, some on
|
||||
account.group_account_user and some on account.group_account_manager
|
||||
Here, we set all those fields on account.group_account_invoice
|
||||
-->
|
||||
|
||||
<record id="product_template_form_view" model="ir.ui.view">
|
||||
<field name="name">account_usability.product.template.form</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="priority">100</field> <!-- when you replace a field, it's always better to inherit at the end -->
|
||||
<field name="inherit_id" ref="account.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="property_account_income_id" position="attributes">
|
||||
<attribute name="groups">account.group_account_invoice</attribute>
|
||||
</field>
|
||||
<field name="property_account_expense_id" position="attributes">
|
||||
<attribute name="groups">account.group_account_invoice</attribute>
|
||||
</field>
|
||||
<field name="list_price" position="replace">
|
||||
<div name="list_price">
|
||||
<field name="list_price" widget='monetary' options="{'currency_field': 'currency_id'}" class="oe_inline"/>
|
||||
<label for="sale_price_type" string=" "/>
|
||||
<field name="sale_price_type"/>
|
||||
</div>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_category_property_form" model="ir.ui.view">
|
||||
<field name="name">account_usability.product.category.form</field>
|
||||
<field name="model">product.category</field>
|
||||
<field name="inherit_id" ref="account.view_category_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="account_property" position="attributes">
|
||||
<attribute name="groups">account.group_account_invoice</attribute>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_supplierinfo_form_view" model="ir.ui.view">
|
||||
<field name="name">account_usability.product.supplierinfo.form</field>
|
||||
<field name="model">product.supplierinfo</field>
|
||||
<field name="inherit_id" ref="product.product_supplierinfo_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="currency_id" position="after">
|
||||
<field name="purchase_price_type"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_supplierinfo_tree_view" model="ir.ui.view">
|
||||
<field name="name">account_usability.product.supplierinfo.tree</field>
|
||||
<field name="model">product.supplierinfo</field>
|
||||
<field name="inherit_id" ref="product.product_supplierinfo_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="price" position="after">
|
||||
<field name="purchase_price_type" string="Tax"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
31
account_usability/views/res_config_settings.xml
Normal file
31
account_usability/views/res_config_settings.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2015-2020 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="res_config_settings_view_form" model="ir.ui.view">
|
||||
<field name="name">account_usability account config page</field>
|
||||
<field name="model">res.config.settings</field>
|
||||
<field name="inherit_id" ref="account.res_config_settings_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@id='bank_cash']" position="inside">
|
||||
<div class="col-xs-12 col-md-6 o_setting_box" id="transfer_account">
|
||||
<div class="o_setting_left_pane"/>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="transfer_account_id"/>
|
||||
<div class="text-muted">
|
||||
Transit account when you transfer money from a bank account of your company to another bank account of your company.
|
||||
</div>
|
||||
<field name="transfer_account_id"/>
|
||||
</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
23
account_usability/views/res_partner.xml
Normal file
23
account_usability/views/res_partner.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2017-2020 Akretion (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
|
||||
<record id="view_partner_property_form" model="ir.ui.view">
|
||||
<field name="name">account_usability.res.partner.form</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="account.view_partner_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="property_account_position_id" position="attributes">
|
||||
<attribute name="widget">selection</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</odoo>
|
||||
4
account_usability/wizard/__init__.py
Normal file
4
account_usability/wizard/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from . import account_invoice_mark_sent
|
||||
from . import account_move_reversal
|
||||
from . import res_config_settings
|
||||
from . import account_group_generate
|
||||
59
account_usability/wizard/account_group_generate.py
Normal file
59
account_usability/wizard/account_group_generate.py
Normal file
@@ -0,0 +1,59 @@
|
||||
# Copyright 2015-2020 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class AccountGroupGenerate(models.TransientModel):
|
||||
_name = 'account.group.generate'
|
||||
_description = 'Generate Account Groups'
|
||||
|
||||
name_prefix = fields.Char(string='Prefix', required=True, default='Comptes')
|
||||
level = fields.Integer(default=2, required=True)
|
||||
|
||||
def run(self):
|
||||
if self.level < 1:
|
||||
raise UserError(_("The level must be >= 1."))
|
||||
ago = self.env['account.group']
|
||||
aao = self.env['account.account']
|
||||
company = self.env.company
|
||||
groups = ago.search([('company_id', '=', company.id)])
|
||||
if groups:
|
||||
raise UserError(_(
|
||||
"%d account groups already exists in company '%s'. This wizard is "
|
||||
"designed to generate account groups from scratch.")
|
||||
% (len(groups), company.display_name))
|
||||
accounts = aao.search([('company_id', '=', company.id)])
|
||||
struct = {'childs': {}}
|
||||
for account in accounts:
|
||||
if len(account.code) <= self.level:
|
||||
raise UserError(_(
|
||||
"The code of account '%s' is %d caracters. "
|
||||
"It cannot be inferior to level (%d).")
|
||||
% (account.display_name, len(account.code), self.level))
|
||||
n = 1
|
||||
parent = struct
|
||||
gparent = False
|
||||
while n <= self.level:
|
||||
group_code = account.code[:n]
|
||||
if group_code not in parent['childs']:
|
||||
new_group = ago.create({
|
||||
'name': '%s %s' % (self.name_prefix or '', group_code),
|
||||
'code_prefix_start': group_code,
|
||||
'parent_id': gparent and gparent.id or False,
|
||||
'company_id': company.id,
|
||||
})
|
||||
parent['childs'][group_code] = {'obj': new_group, 'childs': {}}
|
||||
parent = parent['childs'][group_code]
|
||||
gparent = parent['obj']
|
||||
n += 1
|
||||
account.write({'group_id': gparent.id})
|
||||
action = {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _('Account Groups'),
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.group',
|
||||
}
|
||||
return action
|
||||
42
account_usability/wizard/account_group_generate_view.xml
Normal file
42
account_usability/wizard/account_group_generate_view.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2020 Akretion France (http://www.akretion.com/)
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="account_group_generate_form" model="ir.ui.view">
|
||||
<field name="name">account.group.generate.form</field>
|
||||
<field name="model">account.group.generate</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Generate account groups">
|
||||
<p>
|
||||
This wizard is designed to auto-generate account groups from the chart of account.
|
||||
</p>
|
||||
<group name="main">
|
||||
<field name="name_prefix"/>
|
||||
<field name="level"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button type="object" name="run" string="Generate" class="btn-primary"/>
|
||||
<button special="cancel" string="Cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account_group_generate_action" model="ir.actions.act_window">
|
||||
<field name="name">Generate Account Groups</field>
|
||||
<field name="res_model">account.group.generate</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="account_group_generate_menu"
|
||||
action="account_group_generate_action"
|
||||
parent="account.account_account_menu"
|
||||
sequence="51"/>
|
||||
|
||||
</odoo>
|
||||
24
account_usability/wizard/account_invoice_mark_sent.py
Normal file
24
account_usability/wizard/account_invoice_mark_sent.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# Copyright 2017-2020 Akretion France (https://akretion.com/en)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class AccountInvoiceMarkSent(models.TransientModel):
|
||||
_name = 'account.invoice.mark.sent'
|
||||
_description = 'Mark invoices as sent'
|
||||
|
||||
def run(self):
|
||||
assert self.env.context.get('active_model') == 'account.move',\
|
||||
'Source model must be invoices'
|
||||
assert self.env.context.get('active_ids'), 'No invoices selected'
|
||||
invoices = self.env['account.move'].search([
|
||||
('id', 'in', self.env.context.get('active_ids')),
|
||||
('move_type', 'in', ('out_invoice', 'out_refund')),
|
||||
('state', '=', 'posted')])
|
||||
invoices.write({'is_move_sent': True})
|
||||
logger.info('Marking invoices with ID %s as sent', invoices.ids)
|
||||
return
|
||||
35
account_usability/wizard/account_invoice_mark_sent_view.xml
Normal file
35
account_usability/wizard/account_invoice_mark_sent_view.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2017-2020 Akretion France
|
||||
@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_mark_sent_form" model="ir.ui.view">
|
||||
<field name="name">account.invoice.mark.sent.form</field>
|
||||
<field name="model">account.invoice.mark.sent</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Mark invoices as sent">
|
||||
<p>
|
||||
This wizard will mark as <i>sent</i> all the selected invoices in open or paid state.
|
||||
</p>
|
||||
<footer>
|
||||
<button type="object" name="run" string="Mark as Sent" class="btn-primary"/>
|
||||
<button special="cancel" string="Cancel"/>
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="account_invoice_mark_sent_action" model="ir.actions.act_window">
|
||||
<field name="name">Mark as Sent</field>
|
||||
<field name="res_model">account.invoice.mark.sent</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
<field name="binding_model_id" ref="account.model_account_move" />
|
||||
<field name="binding_view_types">list</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
22
account_usability/wizard/account_move_reversal.py
Normal file
22
account_usability/wizard/account_move_reversal.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Copyright 2018-2020 Akretion France (https://akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
|
||||
class AccountMoveReversal(models.TransientModel):
|
||||
_inherit = 'account.move.reversal'
|
||||
|
||||
@api.model
|
||||
def _default_date(self):
|
||||
date_dt = None
|
||||
if (
|
||||
self._context.get('active_model') == 'account.move' and
|
||||
self._context.get('active_id')):
|
||||
move = self.env['account.move'].browse(self._context['active_id'])
|
||||
date_dt = move.date + relativedelta(days=1)
|
||||
return date_dt
|
||||
|
||||
date = fields.Date(default=_default_date)
|
||||
12
account_usability/wizard/res_config_settings.py
Normal file
12
account_usability/wizard/res_config_settings.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# Copyright 2015-2020 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = 'res.config.settings'
|
||||
|
||||
transfer_account_id = fields.Many2one(
|
||||
related='company_id.transfer_account_id', readonly=False)
|
||||
57
base_company_extension/README.rst
Normal file
57
base_company_extension/README.rst
Normal file
@@ -0,0 +1,57 @@
|
||||
======================
|
||||
Base Company Extension
|
||||
======================
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
:alt: Beta
|
||||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
|
||||
:target: https://github.com/akretion/odoo-usability/tree/12.0/base_company_extension
|
||||
:alt: akretion/odoo-usability
|
||||
|
||||
|badge1| |badge2| |badge3|
|
||||
|
||||
This module adds the following fields on the company:
|
||||
|
||||
* Capital Amount
|
||||
* Legal Type
|
||||
|
||||
This is useful to display the legal name of the company in reports.
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_company_extension%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* Akretion
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/base_company_extension>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute.
|
||||
1
base_company_extension/__init__.py
Normal file
1
base_company_extension/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import company
|
||||
17
base_company_extension/__manifest__.py
Normal file
17
base_company_extension/__manifest__.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# Copyright 2014-2020 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Base Company Extension',
|
||||
'version': '14.0.1.0.0',
|
||||
'category': 'Partner',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Adds capital and title on company',
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
# I depend on base_usability only for _report_company_legal_name()
|
||||
'depends': ['base_usability'],
|
||||
'data': ['company_view.xml'],
|
||||
'installable': True,
|
||||
}
|
||||
28
base_company_extension/company.py
Normal file
28
base_company_extension/company.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# Copyright 2014-2020 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = "res.company"
|
||||
|
||||
capital_amount = fields.Monetary(string='Capital Amount')
|
||||
# in v9, title is only for contacts, not for companies
|
||||
legal_type = fields.Char(
|
||||
string="Legal Type", help="Type of Company, e.g. SARL, SAS, ...")
|
||||
|
||||
def _report_company_legal_name(self):
|
||||
self.ensure_one()
|
||||
if self.legal_type:
|
||||
name = '%s %s' % (self.name, self.legal_type)
|
||||
else:
|
||||
name = self.name
|
||||
return name
|
||||
|
||||
_sql_constraints = [(
|
||||
'capital_amount_positive',
|
||||
'CHECK (capital_amount >= 0)',
|
||||
"The value of the field 'Capital Amount' must be positive."
|
||||
)]
|
||||
22
base_company_extension/company_view.xml
Normal file
22
base_company_extension/company_view.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2020 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<record id="view_company_form" model="ir.ui.view">
|
||||
<field name="name">company.extension.form</field>
|
||||
<field name="model">res.company</field>
|
||||
<field name="inherit_id" ref="base.view_company_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="company_registry" position="after">
|
||||
<field name="capital_amount"/>
|
||||
<field name="legal_type"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
1
base_company_extension/readme/CONTRIBUTORS.rst
Normal file
1
base_company_extension/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1 @@
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
5
base_company_extension/readme/DESCRIPTION.rst
Normal file
5
base_company_extension/readme/DESCRIPTION.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
This module adds the following fields to the ResCompany model:
|
||||
* Capital Amount
|
||||
* Legal Type
|
||||
|
||||
This is useful to display the legal name of the company in reports
|
||||
417
base_company_extension/static/description/index.html
Normal file
417
base_company_extension/static/description/index.html
Normal file
@@ -0,0 +1,417 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<title>Base Company Extension</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="base-company-extension">
|
||||
<h1 class="title">Base Company Extension</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/base_company_extension"><img alt="akretion/odoo-usability" src="https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github" /></a></p>
|
||||
<p>This module adds the following fields to the ResCompany model:
|
||||
* Capital Amount
|
||||
* Legal Type</p>
|
||||
<p>This is useful to display the legal name of the company in reports</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/akretion/odoo-usability/issues">GitHub Issues</a>.
|
||||
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
|
||||
<a class="reference external" href="https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_company_extension%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id2">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id3">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Akretion</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Alexis de Lattre <<a class="reference external" href="mailto:alexis.delattre@akretion.com">alexis.delattre@akretion.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/akretion/odoo-usability/tree/12.0/base_company_extension">akretion/odoo-usability</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
2
base_partner_one2many_phone/__init__.py
Normal file
2
base_partner_one2many_phone/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from . import partner_phone
|
||||
from .post_install import migrate_to_partner_phone
|
||||
31
base_partner_one2many_phone/__manifest__.py
Normal file
31
base_partner_one2many_phone/__manifest__.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# Copyright 2014-2020 Abbaye du Barroux (http://www.barroux.org)
|
||||
# Copyright 2014-2020 Akretion (http://www.akretion.com>)
|
||||
# @author: Frère Bernard <informatique@barroux.org>
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Base Partner One2many Phone',
|
||||
'version': '14.0.1.0.0',
|
||||
'category': 'Phone',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'One2many link between partners and phone numbers/emails',
|
||||
'description': """
|
||||
Base Partner One2many Phone
|
||||
===========================
|
||||
|
||||
With this module, one partner can have several phone numbers and several emails. It adds a new table dedicated to phone numbers and emails and a one2many link between partners and phone numbers. This module keeps compatibility with the native behavior of Odoo on phone numbers and emails.
|
||||
|
||||
It has been developped by brother Bernard from Barroux Abbey and Alexis de Lattre from Akretion.
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'https://akretion.com/',
|
||||
'depends': ['contacts', 'base_usability', 'phone_validation'],
|
||||
'excludes': ['sms'], # because sms introduces big changes in partner form view
|
||||
'data': [
|
||||
'partner_phone_view.xml',
|
||||
'security/ir.model.access.csv',
|
||||
],
|
||||
'installable': True,
|
||||
'post_init_hook': 'migrate_to_partner_phone',
|
||||
}
|
||||
174
base_partner_one2many_phone/i18n/base_partner_one2many_phone.pot
Normal file
174
base_partner_one2many_phone/i18n/base_partner_one2many_phone.pot
Normal file
@@ -0,0 +1,174 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_partner_one2many_phone
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-01-27 18:03+0000\n"
|
||||
"PO-Revision-Date: 2020-01-27 18:03+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_email
|
||||
msgid "E-Mail"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: code:addons/base_partner_one2many_phone/partner_phone.py:61
|
||||
#, python-format
|
||||
msgid "E-mail field must be empty when type is Primary/Secondary Phone, Primary/Secondary Mobile or Primary/Secondary Fax."
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: code:addons/base_partner_one2many_phone/partner_phone.py:51
|
||||
#, python-format
|
||||
msgid "E-mail field must have a value when type is Primary E-mail or Secondary E-mail."
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone___last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_note
|
||||
msgid "Note"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model,name:base_partner_one2many_phone.model_res_partner
|
||||
msgid "Partner"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_phone
|
||||
msgid "Phone"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: code:addons/base_partner_one2many_phone/partner_phone.py:54
|
||||
#, python-format
|
||||
msgid "Phone field must be empty when type is Primary E-mail or Secondary E-mail."
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: code:addons/base_partner_one2many_phone/partner_phone.py:58
|
||||
#, python-format
|
||||
msgid "Phone field must have a value when type is Primary/Secondary Phone, Primary/Secondary Mobile or Primary/Secondary Fax."
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_ids
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_users_phone_ids
|
||||
msgid "Phones"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.ui.view,arch_db:base_partner_one2many_phone.res_partner_phone_tree
|
||||
msgid "Phones and E-mail"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.actions.act_window,name:base_partner_one2many_phone.res_partner_phone_action
|
||||
#: model:ir.ui.menu,name:base_partner_one2many_phone.res_partner_phone_menu
|
||||
msgid "Phones/E-mails"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Primary E-mail"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Primary Fax"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Primary Mobile"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Primary Phone"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_partner_id
|
||||
msgid "Related Partner"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.ui.view,arch_db:base_partner_one2many_phone.res_partner_phone_search
|
||||
msgid "Search Phones/E-mail"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Secondary E-mail"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Secondary Fax"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Secondary Mobile"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Secondary Phone"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_type
|
||||
#: model:ir.ui.view,arch_db:base_partner_one2many_phone.res_partner_phone_search
|
||||
msgid "Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model,name:base_partner_one2many_phone.model_res_partner_phone
|
||||
msgid "res.partner.phone"
|
||||
msgstr ""
|
||||
|
||||
174
base_partner_one2many_phone/i18n/fr.po
Normal file
174
base_partner_one2many_phone/i18n/fr.po
Normal file
@@ -0,0 +1,174 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_partner_one2many_phone
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 10.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-01-27 17:56+0000\n"
|
||||
"PO-Revision-Date: 2020-01-27 17:56+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Créé par"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_create_date
|
||||
msgid "Created on"
|
||||
msgstr "Créé le"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nom à afficher"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_email
|
||||
msgid "E-Mail"
|
||||
msgstr "Courriel"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: code:addons/base_partner_one2many_phone/partner_phone.py:61
|
||||
#, python-format
|
||||
msgid "E-mail field must be empty when type is Primary/Secondary Phone, Primary/Secondary Mobile or Primary/Secondary Fax."
|
||||
msgstr "Le champ courriel doit être vide quand le type est tél. primaire/secondaire, portable primaire/secondaire ou fax primaire/secondaire."
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: code:addons/base_partner_one2many_phone/partner_phone.py:51
|
||||
#, python-format
|
||||
msgid "E-mail field must have a value when type is Primary E-mail or Secondary E-mail."
|
||||
msgstr "Le champ courriel doit être renseigné quand le type est courriel primaire ou courriel secondaire."
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone___last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Dernière modification le"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Dernière mise à jour par"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Dernière mise à jour le"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_note
|
||||
msgid "Note"
|
||||
msgstr "Note"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model,name:base_partner_one2many_phone.model_res_partner
|
||||
msgid "Partner"
|
||||
msgstr "Partenaire"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_phone
|
||||
msgid "Phone"
|
||||
msgstr "Téléphone"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: code:addons/base_partner_one2many_phone/partner_phone.py:54
|
||||
#, python-format
|
||||
msgid "Phone field must be empty when type is Primary E-mail or Secondary E-mail."
|
||||
msgstr "Le champ téléphone doit être vide quand le type est courriel primaire ou courriel secondaire."
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: code:addons/base_partner_one2many_phone/partner_phone.py:58
|
||||
#, python-format
|
||||
msgid "Phone field must have a value when type is Primary/Secondary Phone, Primary/Secondary Mobile or Primary/Secondary Fax."
|
||||
msgstr "Le champ téléphone doit être renseigné quand le type est tél. primaire/secondaire, portable primaire/secondaire ou fax primaire/secondaire.."
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_ids
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_users_phone_ids
|
||||
msgid "Phones"
|
||||
msgstr "Téléphones"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.ui.view,arch_db:base_partner_one2many_phone.res_partner_phone_tree
|
||||
msgid "Phones and E-mail"
|
||||
msgstr "Téls et courriels"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.actions.act_window,name:base_partner_one2many_phone.res_partner_phone_action
|
||||
#: model:ir.ui.menu,name:base_partner_one2many_phone.res_partner_phone_menu
|
||||
msgid "Phones/E-mails"
|
||||
msgstr "Téls/Courriels"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Primary E-mail"
|
||||
msgstr "Courriel principal"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Primary Fax"
|
||||
msgstr "Fax principal"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Primary Mobile"
|
||||
msgstr "Portable principal"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Primary Phone"
|
||||
msgstr "Tél principal"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_partner_id
|
||||
msgid "Related Partner"
|
||||
msgstr "Partenaire associé"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.ui.view,arch_db:base_partner_one2many_phone.res_partner_phone_search
|
||||
msgid "Search Phones/E-mail"
|
||||
msgstr "Search Phones/E-mail"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Secondary E-mail"
|
||||
msgstr "Courriel secondaire"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Secondary Fax"
|
||||
msgstr "Fax secondaire"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Secondary Mobile"
|
||||
msgstr "Portable secondaire"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: selection:res.partner.phone,type:0
|
||||
msgid "Secondary Phone"
|
||||
msgstr "Tél. secondaire"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model.fields,field_description:base_partner_one2many_phone.field_res_partner_phone_type
|
||||
#: model:ir.ui.view,arch_db:base_partner_one2many_phone.res_partner_phone_search
|
||||
msgid "Type"
|
||||
msgstr "Type"
|
||||
|
||||
#. module: base_partner_one2many_phone
|
||||
#: model:ir.model,name:base_partner_one2many_phone.model_res_partner_phone
|
||||
msgid "res.partner.phone"
|
||||
msgstr "res.partner.phone"
|
||||
|
||||
193
base_partner_one2many_phone/partner_phone.py
Normal file
193
base_partner_one2many_phone/partner_phone.py
Normal file
@@ -0,0 +1,193 @@
|
||||
# Copyright 2014-2020 Abbaye du Barroux (http://www.barroux.org)
|
||||
# Copyright 2016-2020 Akretion (http://www.akretion.com>)
|
||||
# @author: Frère Bernard <informatique@barroux.org>
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models, _
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
EMAIL_TYPES = ('1_email_primary', '2_email_secondary')
|
||||
PHONE_TYPES = ('3_phone_primary', '4_phone_secondary', '5_mobile_primary', '6_mobile_secondary', '7_fax_primary', '8_fax_secondary')
|
||||
|
||||
|
||||
class ResPartnerPhone(models.Model):
|
||||
_name = 'res.partner.phone'
|
||||
_order = 'partner_id, type'
|
||||
_phone_name_sequence = 8
|
||||
_inherit = ['phone.validation.mixin']
|
||||
_description = 'Multiple emails and phones for partners'
|
||||
|
||||
partner_id = fields.Many2one(
|
||||
'res.partner', string='Related Partner', index=True, ondelete='cascade')
|
||||
type = fields.Selection([
|
||||
('1_email_primary', 'Primary E-mail'),
|
||||
('2_email_secondary', 'Secondary E-mail'),
|
||||
('3_phone_primary', 'Primary Phone'),
|
||||
('4_phone_secondary', 'Secondary Phone'),
|
||||
('5_mobile_primary', 'Primary Mobile'),
|
||||
('6_mobile_secondary', 'Secondary Mobile'),
|
||||
('7_fax_primary', 'Primary Fax'),
|
||||
('8_fax_secondary', 'Secondary Fax'),
|
||||
],
|
||||
string='Type', required=True, index=True)
|
||||
phone = fields.Char(string='Phone')
|
||||
email = fields.Char(string='E-Mail')
|
||||
note = fields.Char('Note')
|
||||
|
||||
@api.onchange('type')
|
||||
def type_change(self):
|
||||
if self.type:
|
||||
if self.type in EMAIL_TYPES:
|
||||
self.phone = False
|
||||
elif self.type in PHONE_TYPES:
|
||||
self.email = False
|
||||
|
||||
@api.onchange('phone', 'partner_id')
|
||||
def _onchange_phone_validation(self):
|
||||
if self.phone:
|
||||
self.phone = self.phone_format(self.phone)
|
||||
|
||||
@api.constrains('type', 'phone', 'email')
|
||||
def _check_partner_phone(self):
|
||||
for rec in self:
|
||||
if rec.type in EMAIL_TYPES:
|
||||
if not rec.email:
|
||||
raise ValidationError(_(
|
||||
"E-mail field must have a value when type is Primary E-mail or Secondary E-mail."))
|
||||
if rec.phone:
|
||||
raise ValidationError(_(
|
||||
"Phone field must be empty when type is Primary E-mail or Secondary E-mail."))
|
||||
elif rec.type in PHONE_TYPES:
|
||||
if not rec.phone:
|
||||
raise ValidationError(_(
|
||||
"Phone field must have a value when type is Primary/Secondary Phone, Primary/Secondary Mobile or Primary/Secondary Fax."))
|
||||
if rec.email:
|
||||
raise ValidationError(_(
|
||||
"E-mail field must be empty when type is Primary/Secondary Phone, Primary/Secondary Mobile or Primary/Secondary Fax."))
|
||||
|
||||
def name_get(self):
|
||||
res = []
|
||||
for pphone in self:
|
||||
if pphone.partner_id:
|
||||
if self._context.get('callerid'):
|
||||
name = pphone.partner_id.display_name
|
||||
else:
|
||||
name = u'%s (%s)' % (pphone.phone, pphone.partner_id.name)
|
||||
else:
|
||||
name = pphone.phone
|
||||
res.append((pphone.id, name))
|
||||
return res
|
||||
|
||||
def init(self):
|
||||
self._cr.execute('''
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS single_email_primary
|
||||
ON res_partner_phone (partner_id, type)
|
||||
WHERE (type='1_email_primary')
|
||||
''')
|
||||
self._cr.execute('''
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS single_phone_primary
|
||||
ON res_partner_phone (partner_id, type)
|
||||
WHERE (type='3_phone_primary')
|
||||
''')
|
||||
self._cr.execute('''
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS single_mobile_primary
|
||||
ON res_partner_phone (partner_id, type)
|
||||
WHERE (type='5_mobile_primary')
|
||||
''')
|
||||
self._cr.execute('''
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS single_fax_primary
|
||||
ON res_partner_phone (partner_id, type)
|
||||
WHERE (type='7_fax_primary')
|
||||
''')
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
# in v10, we are supposed to have in DB E.164 format
|
||||
# with the current implementation, we have:
|
||||
# in res.partner : PhoneNumberFormat.INTERNATIONAL
|
||||
# in res.partner.phone : E.164
|
||||
# It is not good, but it is not a big bug and it's complex to fix
|
||||
# so let's let it like that. In v12, we store in
|
||||
# PhoneNumberFormat.INTERNATIONAL, so this bug is kind of an anticipation
|
||||
# for the future :)
|
||||
|
||||
phone_ids = fields.One2many(
|
||||
'res.partner.phone', 'partner_id', string='Phones/Emails')
|
||||
phone = fields.Char(
|
||||
compute='_compute_partner_phone',
|
||||
store=True, readonly=True, compute_sudo=True)
|
||||
mobile = fields.Char(
|
||||
compute='_compute_partner_phone',
|
||||
store=True, readonly=True, compute_sudo=True)
|
||||
email = fields.Char(
|
||||
compute='_compute_partner_phone',
|
||||
store=True, readonly=True, compute_sudo=True)
|
||||
|
||||
@api.depends('phone_ids.phone', 'phone_ids.type', 'phone_ids.email')
|
||||
def _compute_partner_phone(self):
|
||||
for partner in self:
|
||||
phone = mobile = email = False
|
||||
for pphone in partner.phone_ids:
|
||||
if pphone.type == '1_email_primary' and pphone.email:
|
||||
email = pphone.email
|
||||
elif pphone.phone:
|
||||
if pphone.type == '5_mobile_primary':
|
||||
mobile = pphone.phone
|
||||
elif pphone.type == '3_phone_primary':
|
||||
phone = pphone.phone
|
||||
partner.phone = phone
|
||||
partner.mobile = mobile
|
||||
partner.email = email
|
||||
|
||||
def _update_create_vals(
|
||||
self, vals, type, partner_field, partner_phone_field):
|
||||
if vals.get(partner_field):
|
||||
vals['phone_ids'].append(
|
||||
(0, 0, {'type': type, partner_phone_field: vals[partner_field]}))
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
if 'phone_ids' not in vals:
|
||||
vals['phone_ids'] = []
|
||||
self._update_create_vals(vals, '1_email_primary', 'email', 'email')
|
||||
self._update_create_vals(vals, '3_phone_primary', 'phone', 'phone')
|
||||
self._update_create_vals(vals, '5_mobile_primary', 'mobile', 'phone')
|
||||
# self._update_create_vals(vals, '7_fax_primary', 'fax', 'phone')
|
||||
return super().create(vals)
|
||||
|
||||
def _update_write_vals(
|
||||
self, vals, type, partner_field, partner_phone_field):
|
||||
self.ensure_one()
|
||||
rppo = self.env['res.partner.phone']
|
||||
if partner_field in vals:
|
||||
pphone = rppo.search([
|
||||
('partner_id', '=', self.id),
|
||||
('type', '=', type)], limit=1)
|
||||
if vals[partner_field]:
|
||||
if pphone:
|
||||
vals['phone_ids'].append((1, pphone.id, {
|
||||
partner_phone_field: vals[partner_field]}))
|
||||
else:
|
||||
vals['phone_ids'].append((0, 0, {
|
||||
'type': type,
|
||||
partner_phone_field: vals[partner_field],
|
||||
}))
|
||||
else:
|
||||
if pphone:
|
||||
vals['phone_ids'].append((2, pphone.id))
|
||||
|
||||
def write(self, vals):
|
||||
if 'phone_ids' not in vals:
|
||||
for rec in self:
|
||||
vals['phone_ids'] = []
|
||||
rec._update_write_vals(vals, '1_email_primary', 'email', 'email')
|
||||
rec._update_write_vals(vals, '3_phone_primary', 'phone', 'phone')
|
||||
rec._update_write_vals(vals, '5_mobile_primary', 'mobile', 'phone')
|
||||
rec._update_write_vals(vals, '7_fax_primary', 'fax', 'phone')
|
||||
super(ResPartner, rec).write(vals)
|
||||
return True
|
||||
else:
|
||||
return super().write(vals)
|
||||
167
base_partner_one2many_phone/partner_phone_view.xml
Normal file
167
base_partner_one2many_phone/partner_phone_view.xml
Normal file
@@ -0,0 +1,167 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2014-2020 Abbaye du Barroux (http://www.barroux.org)
|
||||
Copyright 2016-2020 Akretion (http://www.akretion.com>)
|
||||
@author: Frère Bernard <informatique@barroux.org>
|
||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
-->
|
||||
|
||||
<odoo>
|
||||
|
||||
<!-- Partner phones -->
|
||||
<record id="res_partner_phone_tree" model="ir.ui.view">
|
||||
<field name="name">res.partner.phone.tree</field>
|
||||
<field name="model">res.partner.phone</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Phones and E-mail" editable="bottom">
|
||||
<field name="partner_id" invisible="not context.get('partner_phone_main_view')"/>
|
||||
<field name="type"/>
|
||||
<field name="phone" widget="phone" options="{'enable_sms': false}" attrs="{'required': [('type', 'not in', ('1_email_primary', '2_email_secondary'))], 'readonly': [('type', 'in', ('1_email_primary', '2_email_secondary'))]}"/>
|
||||
<field name="email" widget="email" attrs="{'readonly': [('type', 'not in', ('1_email_primary', '2_email_secondary'))], 'required': [('type', 'in', ('1_email_primary', '2_email_secondary'))]}"/>
|
||||
<field name="note"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="res_partner_phone_form" model="ir.ui.view">
|
||||
<field name="name">res.partner.phone.form</field>
|
||||
<field name="model">res.partner.phone</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Phone and E-mail">
|
||||
<group name="main">
|
||||
<field name="partner_id" invisible="not context.get('partner_phone_main_view')"/>
|
||||
<field name="type"/>
|
||||
<field name="phone" widget="phone" options="{'enable_sms': false}" attrs="{'required': [('type', 'not in', ('1_email_primary', '2_email_secondary'))], 'invisible': [('type', 'in', ('1_email_primary', '2_email_secondary'))]}"/>
|
||||
<field name="email" widget="email" attrs="{'invisible': [('type', 'not in', ('1_email_primary', '2_email_secondary'))], 'required': [('type', 'in', ('1_email_primary', '2_email_secondary'))]}"/>
|
||||
<field name="note"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="res_partner_phone_search" model="ir.ui.view">
|
||||
<field name="name">res.partner.phone.search</field>
|
||||
<field name="model">res.partner.phone</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Phones/E-mail">
|
||||
<field name="phone" />
|
||||
<field name="email" />
|
||||
<group name="groupby">
|
||||
<filter name="type_groupby" string="Type" context="{'group_by': 'type'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="res_partner_phone_action" model="ir.actions.act_window">
|
||||
<field name="name">Phones/E-mails</field>
|
||||
<field name="res_model">res.partner.phone</field>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="context">{'partner_phone_main_view': True}</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="res_partner_phone_menu" action="res_partner_phone_action"
|
||||
parent="contacts.menu_contacts" sequence="10"/>
|
||||
|
||||
<record id="contacts.res_partner_menu_config" model="ir.ui.menu">
|
||||
<field name="sequence">20</field>
|
||||
</record>
|
||||
|
||||
<!-- PARTNER views -->
|
||||
<record id="view_partner_form" model="ir.ui.view">
|
||||
<field name="name">add.phone_ids.on.partner.form</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="mail.res_partner_view_form_inherit_mail"/>
|
||||
<!-- This module depends on contacts which depends on mail
|
||||
and the mail module replaces the email field -->
|
||||
<field name="arch" type="xml">
|
||||
<field name="phone" position="after">
|
||||
<field name="phone_ids" nolabel="1" colspan="2"/>
|
||||
</field>
|
||||
<field name="phone" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<field name="mobile" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<label for="email" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</label>
|
||||
<xpath expr="//field[@name='email']/.." position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</xpath>
|
||||
<!-- I can't display phone_ids in the Contacts
|
||||
because there is a very strange thing in the web client: if
|
||||
you have a res.partner.phone on one of the fields,
|
||||
it will send to write {'child_ids': [1, ID_child, {'phone_ids': [[5], [4, id_phone_child]]}]}
|
||||
=> it will delete res.partner.phone and then try to re-create it,
|
||||
which triggers the message 'Record does not exist or has been deleted.'
|
||||
<xpath expr="//field[@name='child_ids']/form//field[@name='phone']" position="after">
|
||||
<field name="phone_ids" nolabel="1" colspan="2" widget="many2many_tags"/>
|
||||
</xpath>
|
||||
-->
|
||||
<xpath expr="//field[@name='child_ids']/form//field[@name='phone']" position="attributes">
|
||||
<attribute name="readonly">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='child_ids']/form//field[@name='mobile']" position="attributes">
|
||||
<attribute name="readonly">1</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='child_ids']/form//field[@name='email']" position="attributes">
|
||||
<attribute name="readonly">1</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_partner_simple_form" model="ir.ui.view">
|
||||
<field name="name">add.phone_ids.on.res.partner.simplified.form</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_simple_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="phone" position="after">
|
||||
<field name="phone_ids" nolabel="1" colspan="2"/>
|
||||
</field>
|
||||
<field name="phone" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<field name="mobile" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<field name="email" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="res_partner_view_form_private" model="ir.ui.view">
|
||||
<field name="name">add.phone_ids.on.res.partner.private.form</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.res_partner_view_form_private"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="phone" position="after">
|
||||
<field name="phone_ids" nolabel="1" colspan="2"/>
|
||||
</field>
|
||||
<field name="phone" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<field name="mobile" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
<field name="email" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_res_partner_filter" model="ir.ui.view">
|
||||
<field name="name">phone.one2many.res.partner.search</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base_usability.view_res_partner_filter"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="attributes">
|
||||
<attribute name="filter_domain">['|', '|', ('display_name', 'ilike', self), ('ref', '=ilike', self + '%'), ('phone_ids.email', 'ilike', self)]</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
49
base_partner_one2many_phone/post_install.py
Normal file
49
base_partner_one2many_phone/post_install.py
Normal file
@@ -0,0 +1,49 @@
|
||||
# Copyright 2017-2020 Akretion France (http://www.akretion.com/)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, SUPERUSER_ID
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def create_partner_phone(cr, phone_field, phone_type):
|
||||
cr.execute(
|
||||
'SELECT id, ' + phone_field + ' FROM res_partner WHERE ' +
|
||||
phone_field + ' IS NOT null AND ' + phone_field + "!= ''")
|
||||
to_create = []
|
||||
for partner in cr.fetchall():
|
||||
to_create.append({
|
||||
'partner_id': partner[0],
|
||||
'type': phone_type,
|
||||
'phone': partner[1],
|
||||
})
|
||||
return to_create
|
||||
|
||||
|
||||
def create_partner_email(cr):
|
||||
cr.execute(
|
||||
"SELECT id, email FROM res_partner WHERE email IS NOT null AND email != ''")
|
||||
to_create = []
|
||||
for partner in cr.fetchall():
|
||||
to_create.append({
|
||||
'partner_id': partner[0],
|
||||
'type': '1_email_primary',
|
||||
'email': partner[1],
|
||||
})
|
||||
return to_create
|
||||
|
||||
|
||||
def migrate_to_partner_phone(cr, registry):
|
||||
logger.info('start data migration for one2many_phone')
|
||||
with api.Environment.manage():
|
||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||
rppo = env['res.partner.phone']
|
||||
to_create = []
|
||||
to_create += create_partner_phone(cr, 'phone', '3_phone_primary')
|
||||
to_create += create_partner_phone(cr, 'mobile', '5_mobile_primary')
|
||||
to_create += create_partner_email(cr)
|
||||
# I need to create all at the end for invalidation purposes
|
||||
rppo.create(to_create)
|
||||
logger.info('end data migration for one2many_phone')
|
||||
return
|
||||
3
base_partner_one2many_phone/security/ir.model.access.csv
Normal file
3
base_partner_one2many_phone/security/ir.model.access.csv
Normal file
@@ -0,0 +1,3 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_partner_phone_full,Full access on res.partner.phone to Contact Manager grp,model_res_partner_phone,base.group_partner_manager,1,1,1,1
|
||||
access_partner_phone_read,Read access on res.partner.phone to Employees grp,model_res_partner_phone,base.group_user,1,0,0,0
|
||||
|
1
base_partner_one2many_phone/tests/__init__.py
Normal file
1
base_partner_one2many_phone/tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import test_partner_phone
|
||||
134
base_partner_one2many_phone/tests/test_partner_phone.py
Normal file
134
base_partner_one2many_phone/tests/test_partner_phone.py
Normal file
@@ -0,0 +1,134 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2019 Barroux Abbey
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
|
||||
class TestPartnerPhone(TransactionCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestPartnerPhone, self).setUp()
|
||||
|
||||
def _check_result(self, partner, result):
|
||||
rppo = self.env['res.partner.phone']
|
||||
pphone_email = rppo.search(
|
||||
[('type', '=', '1_email_primary'), ('partner_id', '=', partner.id)])
|
||||
if result['email']:
|
||||
self.assertEqual(partner.email, result['email'])
|
||||
self.assertEqual(len(pphone_email), 1)
|
||||
self.assertEqual(pphone_email.email, result['email'])
|
||||
else:
|
||||
self.assertFalse(partner.email)
|
||||
self.assertFalse(pphone_email)
|
||||
if result['phone']:
|
||||
self.assertEqual(partner.phone, result['phone'])
|
||||
else:
|
||||
self.assertFalse(partner.phone)
|
||||
if result['mobile']:
|
||||
self.assertEqual(partner.mobile, result['mobile'])
|
||||
else:
|
||||
self.assertFalse(partner.mobile)
|
||||
field2type = {
|
||||
'phone': '3_phone_primary',
|
||||
'mobile': '5_mobile_primary',
|
||||
'fax': '7_fax_primary',
|
||||
}
|
||||
for field, value in result.items():
|
||||
if field in field2type:
|
||||
type = field2type[field]
|
||||
pphone = rppo.search(
|
||||
[('type', '=', type), ('partner_id', '=', partner.id)])
|
||||
if value:
|
||||
self.assertEqual(len(pphone), 1)
|
||||
self.assertEqual(pphone.phone, value)
|
||||
else:
|
||||
self.assertFalse(pphone)
|
||||
|
||||
def test_create_partner(self):
|
||||
rpo = self.env['res.partner']
|
||||
p = rpo.create({
|
||||
'name': 'Test Me',
|
||||
'email': 'testme@example.com',
|
||||
'phone': '+33198089246',
|
||||
'mobile': '+33198089247',
|
||||
})
|
||||
result = {
|
||||
'email': 'testme@example.com',
|
||||
'phone': '+33198089246',
|
||||
'mobile': '+33198089247',
|
||||
}
|
||||
self._check_result(p, result)
|
||||
p2 = rpo.create({
|
||||
'name': 'Test me now',
|
||||
'email': 'testmenow@example.com',
|
||||
'phone': '+33972727272',
|
||||
})
|
||||
result = {
|
||||
'email': 'testmenow@example.com',
|
||||
'phone': '+33972727272',
|
||||
'mobile': False,
|
||||
}
|
||||
self._check_result(p2, result)
|
||||
p3 = rpo.create({
|
||||
'name': 'Test me now',
|
||||
'phone_ids': [
|
||||
(0, 0, {'type': '3_phone_primary', 'phone': '+33972727272'}),
|
||||
(0, 0, {'type': '1_email_primary', 'email': 'tutu@example.fr'})],
|
||||
})
|
||||
result = {
|
||||
'email': 'tutu@example.fr',
|
||||
'phone': '+33972727272',
|
||||
'mobile': False,
|
||||
}
|
||||
self._check_result(p3, result)
|
||||
|
||||
def test_write_partner(self):
|
||||
p1 = self.env['res.partner'].create({
|
||||
'name': 'test me now',
|
||||
'country_id': self.env.ref('base.fr').id,
|
||||
})
|
||||
result_none = {
|
||||
'email': False,
|
||||
'phone': False,
|
||||
'mobile': False,
|
||||
}
|
||||
self._check_result(p1, result_none)
|
||||
p1.write({
|
||||
'mobile': '+33198089247',
|
||||
'email': 'testmenow@example.com',
|
||||
})
|
||||
result = {
|
||||
'email': 'testmenow@example.com',
|
||||
'phone': False,
|
||||
'mobile': '+33198089247',
|
||||
}
|
||||
self._check_result(p1, result)
|
||||
p1.write({
|
||||
'email': 'testmenow2@example.com',
|
||||
'phone': False,
|
||||
'mobile': '+33472727272',
|
||||
})
|
||||
result = {
|
||||
'email': 'testmenow2@example.com',
|
||||
'phone': False,
|
||||
'mobile': '+33472727272',
|
||||
}
|
||||
self._check_result(p1, result)
|
||||
p1.write({
|
||||
'phone': False,
|
||||
'mobile': False,
|
||||
'email': False,
|
||||
})
|
||||
self._check_result(p1, result_none)
|
||||
p2 = self.env['res.partner'].create({'name': 'Toto', 'email': 'toto@example.com'})
|
||||
p_multi = p1 + p2
|
||||
p_multi.write({'email': 'all@example.com', 'phone': '+33560606070'})
|
||||
result = {
|
||||
'email': 'all@example.com',
|
||||
'phone': '+33560606070',
|
||||
'mobile': False,
|
||||
}
|
||||
self._check_result(p1, result)
|
||||
self._check_result(p2, result)
|
||||
1
base_partner_ref/__init__.py
Normal file
1
base_partner_ref/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import partner
|
||||
26
base_partner_ref/__manifest__.py
Normal file
26
base_partner_ref/__manifest__.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Copyright 2017-2019 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': 'Base Partner Reference',
|
||||
'version': '12.0.1.0.0',
|
||||
'category': 'Partner',
|
||||
'license': 'AGPL-3',
|
||||
'summary': "Improve usage of partner's Internal Reference",
|
||||
'description': """
|
||||
Base Partner Reference
|
||||
======================
|
||||
|
||||
* Adds Internal Reference in partner tree view
|
||||
|
||||
* Adds Internal Reference in name_get()
|
||||
|
||||
* Adds unicity constraint on Internal Reference
|
||||
""",
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['base'],
|
||||
'data': ['partner_view.xml'],
|
||||
'installable': False,
|
||||
}
|
||||
57
base_partner_ref/partner.py
Normal file
57
base_partner_ref/partner.py
Normal file
@@ -0,0 +1,57 @@
|
||||
# Copyright 2017-2019 Akretion
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
ref = fields.Char(copy=False) # To avoid blocking duplicate
|
||||
invalidate_display_name = fields.Boolean()
|
||||
|
||||
_sql_constraints = [(
|
||||
'ref_unique',
|
||||
'unique(ref)',
|
||||
'A partner already exists with this internal reference!'
|
||||
)]
|
||||
|
||||
# add 'ref' in depends
|
||||
@api.depends('is_company', 'name', 'parent_id.name', 'type', 'company_name', 'ref', 'invalidate_display_name')
|
||||
def _compute_display_name(self):
|
||||
super(ResPartner, self)._compute_display_name()
|
||||
|
||||
def _get_name(self):
|
||||
partner = self
|
||||
name = partner.name or ''
|
||||
|
||||
# START modif of native method
|
||||
if partner.ref:
|
||||
name = u"[%s] %s" % (partner.ref, name)
|
||||
# END modif of native method
|
||||
if partner.company_name or partner.parent_id:
|
||||
if not name and partner.type in ['invoice', 'delivery', 'other']:
|
||||
name = dict(self.fields_get(['type'])['type']['selection'])[partner.type]
|
||||
if not partner.is_company:
|
||||
# START modif of native name_get() method
|
||||
company_name = partner.commercial_company_name or partner.parent_id.name
|
||||
if partner.parent_id.ref:
|
||||
company_name = u"[%s] %s" % (partner.parent_id.ref, company_name)
|
||||
name = "%s, %s" % (company_name, name)
|
||||
# END modif of native name_get() method
|
||||
if self._context.get('show_address_only'):
|
||||
name = partner._display_address(without_company=True)
|
||||
if self._context.get('show_address'):
|
||||
name = name + "\n" + partner._display_address(without_company=True)
|
||||
name = name.replace('\n\n', '\n')
|
||||
name = name.replace('\n\n', '\n')
|
||||
if self._context.get('address_inline'):
|
||||
name = name.replace('\n', ', ')
|
||||
if self._context.get('show_email') and partner.email:
|
||||
name = "%s <%s>" % (name, partner.email)
|
||||
if self._context.get('html_format'):
|
||||
name = name.replace('\n', '<br/>')
|
||||
if self._context.get('show_vat') and partner.vat:
|
||||
name = "%s ‒ %s" % (name, partner.vat)
|
||||
return name
|
||||
52
base_partner_ref/partner_view.xml
Normal file
52
base_partner_ref/partner_view.xml
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2017-2019 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">Move ref in partner form to make it more visible</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="type" position="after">
|
||||
<field name="ref"/>
|
||||
</field>
|
||||
<xpath expr="//page[@name='sales_purchases']//field[@name='ref']" position="replace"/>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_partner_tree" model="ir.ui.view">
|
||||
<field name="name">Add ref in partner tree view</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<!-- show name and ref in separate columns -->
|
||||
<field name="display_name" position="after">
|
||||
<field name="name"/>
|
||||
<field name="ref"/>
|
||||
</field>
|
||||
<field name="display_name" position="attributes">
|
||||
<attribute name="invisible">1</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="res_partner_kanban_view" model="ir.ui.view">
|
||||
<field name="name">Add ref in partner kanban view</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.res_partner_kanban_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="display_name" position="after">
|
||||
<field name="ref"/>
|
||||
</field>
|
||||
<li t-if="record.email.raw_value" position="after">
|
||||
<li t-if="record.ref.raw_value">Ref: <field name="ref"/></li>
|
||||
</li>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
82
base_usability/README.rst
Normal file
82
base_usability/README.rst
Normal file
@@ -0,0 +1,82 @@
|
||||
==============
|
||||
Base Usability
|
||||
==============
|
||||
|
||||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
:alt: Beta
|
||||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-akretion%2Fodoo--usability-lightgray.png?logo=github
|
||||
:target: https://github.com/akretion/odoo-usability/tree/12.0/base_usability
|
||||
:alt: akretion/odoo-usability
|
||||
|
||||
|badge1| |badge2| |badge3|
|
||||
|
||||
This module adds the following functions:
|
||||
|
||||
* Adds *track_visibility='onchange'* on all the important fields of the Partner object
|
||||
* By default, Odoo doesn't display the title field on all the partner form views. This module fixes it (it replaces the module base_title_on_partner)
|
||||
* Adds a log message at INFO level when sending an email via SMTP
|
||||
* Displays the local modules with installable filter
|
||||
* A group by "State" is added to module search view
|
||||
* Provides a _display_report_header method on the res.company object and _display_full_address on res.partner which are useful for reporting.
|
||||
* Add model in cron tree view
|
||||
* Add prefix field in sequence search view
|
||||
* Better search and form view for country and state
|
||||
* Display technical name of modules in kanban view
|
||||
* Change module filter to `installable`
|
||||
* Add widget=handle on sequence of res.partner.bank
|
||||
* Add city and country in partner tree view
|
||||
* Add widget="email" on email of contacts
|
||||
* Add script to fix partners related to users in multi-company setup
|
||||
* Add methods for py3o reports
|
||||
* Add name_get() on ir.model
|
||||
* Language wizard defaults to ".po"
|
||||
* Add tracking on partner fields
|
||||
* Handle lang in name_title field
|
||||
* Remove empty lines in address
|
||||
* Add bank Name field on res.partner.bank
|
||||
* Partners auto-created for users are Suppliers and not Customers
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/akretion/odoo-usability/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us smashing it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/akretion/odoo-usability/issues/new?body=module:%20base_usability%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* Akretion
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* David Beal <david.beal@akretion.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is part of the `akretion/odoo-usability <https://github.com/akretion/odoo-usability/tree/12.0/base_usability>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute.
|
||||
1
base_usability/__init__.py
Normal file
1
base_usability/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
||||
24
base_usability/__manifest__.py
Normal file
24
base_usability/__manifest__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# Copyright 2014-2020 Akretion France (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
'name': 'Base Usability',
|
||||
'version': '14.0.1.0.0',
|
||||
'category': 'Partner',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Better usability in base module',
|
||||
'author': 'Akretion',
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['base'],
|
||||
'data': [
|
||||
'security/group.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'views/res_partner.xml',
|
||||
'views/res_partner_bank.xml',
|
||||
'views/res_country.xml',
|
||||
'views/ir_module.xml',
|
||||
'views/ir_sequence.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
diff --git a/odoo/addons/base/models/res_users.py b/odoo/addons/base/models/res_users.py
|
||||
index a3baf47c615..e546d450107 100644
|
||||
--- a/odoo/addons/base/models/res_users.py
|
||||
+++ b/odoo/addons/base/models/res_users.py
|
||||
@@ -544,7 +544,13 @@ class Users(models.Model):
|
||||
for user in users:
|
||||
# if partner is global we keep it that way
|
||||
if user.partner_id.company_id:
|
||||
- user.partner_id.company_id = user.company_id
|
||||
+ # AKRETION HACK: if you have a multi-company setup where
|
||||
+ # partners are NOT shared between companies, having
|
||||
+ # company_id=False on partners related to users
|
||||
+ # avoids a lot of trouble (you should also disable 'read'
|
||||
+ # on the ir.rule 'user rule' (XMLID base.res_users_rule)
|
||||
+ # user.partner_id.company_id = user.company_id
|
||||
+ user.partner_id.write({'company_id': False})
|
||||
user.partner_id.active = user.active
|
||||
return users
|
||||
|
||||
194
base_usability/i18n/base_usability.pot
Normal file
194
base_usability/i18n/base_usability.pot
Normal file
@@ -0,0 +1,194 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_usability
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-17 16:55+0000\n"
|
||||
"PO-Revision-Date: 2021-02-17 16:55+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_partner_bank
|
||||
msgid "Bank Accounts"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_bank__bank_name
|
||||
msgid "Bank Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_company
|
||||
msgid "Companies"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_partner
|
||||
msgid "Contact"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.res_country_search
|
||||
msgid "Currency"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "Customer Number:"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_mail_server__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_model__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_company__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_bank__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_category__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_users__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "E-mail:"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.res_country_search
|
||||
msgid "Group By"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_mail_server__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_model__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_company__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_bank__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_category__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_users__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.view_module_filter
|
||||
msgid "Installable"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_mail_server____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_model____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_company____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_bank____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_category____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_users____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_ir_mail_server
|
||||
msgid "Mail Server"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "Mobile:"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_ir_model
|
||||
msgid "Models"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.res_country_search
|
||||
msgid "Name or Code"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.view_res_partner_filter
|
||||
msgid "Name or Email or Reference"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner__name_title
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_users__name_title
|
||||
msgid "Name with Title"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:res.groups,name:base_usability.group_nobody
|
||||
msgid "Nobody (used to hide native menus)"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_partner_category
|
||||
msgid "Partner Tags"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner__ref
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_users__ref
|
||||
msgid "Reference"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.res_country_search
|
||||
msgid "Search Countries"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "Supplier Number:"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_category__name
|
||||
msgid "Tag Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "Tel:"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_users
|
||||
msgid "Users"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "VAT Number:"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#, python-format
|
||||
msgid "VAT:"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "Website:"
|
||||
msgstr ""
|
||||
194
base_usability/i18n/fr.po
Normal file
194
base_usability/i18n/fr.po
Normal file
@@ -0,0 +1,194 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_usability
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-17 16:55+0000\n"
|
||||
"PO-Revision-Date: 2021-02-17 16:55+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_partner_bank
|
||||
msgid "Bank Accounts"
|
||||
msgstr "Comptes bancaires"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_bank__bank_name
|
||||
msgid "Bank Name"
|
||||
msgstr "Nom de la banque"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_company
|
||||
msgid "Companies"
|
||||
msgstr "Sociétés"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_partner
|
||||
msgid "Contact"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.res_country_search
|
||||
msgid "Currency"
|
||||
msgstr "Monnaie"
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "Customer Number:"
|
||||
msgstr "N° client :"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_mail_server__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_model__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_company__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_bank__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_category__display_name
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_users__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nom affiché"
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "E-mail:"
|
||||
msgstr "E-mail :"
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.res_country_search
|
||||
msgid "Group By"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_mail_server__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_model__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_company__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_bank__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_category__id
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_users__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.view_module_filter
|
||||
msgid "Installable"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_mail_server____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_ir_model____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_company____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_bank____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_category____last_update
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_users____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Dernière modification le"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_ir_mail_server
|
||||
msgid "Mail Server"
|
||||
msgstr "Serveur d'email"
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "Mobile:"
|
||||
msgstr "Portable :"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_ir_model
|
||||
msgid "Models"
|
||||
msgstr "Modèles"
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.res_country_search
|
||||
msgid "Name or Code"
|
||||
msgstr "Nom ou code"
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.view_res_partner_filter
|
||||
msgid "Name or Email or Reference"
|
||||
msgstr "Nom ou e-mail ou référence"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner__name_title
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_users__name_title
|
||||
msgid "Name with Title"
|
||||
msgstr "Nom avec titre"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:res.groups,name:base_usability.group_nobody
|
||||
msgid "Nobody (used to hide native menus)"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_partner_category
|
||||
msgid "Partner Tags"
|
||||
msgstr "Étiquettes du partenaire"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner__ref
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_users__ref
|
||||
msgid "Reference"
|
||||
msgstr "Référence"
|
||||
|
||||
#. module: base_usability
|
||||
#: model_terms:ir.ui.view,arch_db:base_usability.res_country_search
|
||||
msgid "Search Countries"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "Supplier Number:"
|
||||
msgstr "N° fournisseur :"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model.fields,field_description:base_usability.field_res_partner_category__name
|
||||
msgid "Tag Name"
|
||||
msgstr "Nom de l'étiquette"
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "Tel:"
|
||||
msgstr "Tél :"
|
||||
|
||||
#. module: base_usability
|
||||
#: model:ir.model,name:base_usability.model_res_users
|
||||
msgid "Users"
|
||||
msgstr "Utilisateurs"
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "VAT Number:"
|
||||
msgstr "N° TVA :"
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#, python-format
|
||||
msgid "VAT:"
|
||||
msgstr "TVA :"
|
||||
|
||||
#. module: base_usability
|
||||
#: code:addons/base_usability/models/res_company.py:0
|
||||
#: code:addons/base_usability/models/res_partner.py:0
|
||||
#, python-format
|
||||
msgid "Website:"
|
||||
msgstr "Site web :"
|
||||
7
base_usability/models/__init__.py
Normal file
7
base_usability/models/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from . import res_users
|
||||
from . import res_partner
|
||||
from . import res_partner_bank
|
||||
from . import res_partner_category
|
||||
from . import res_company
|
||||
from . import ir_mail_server
|
||||
from . import ir_model
|
||||
36
base_usability/models/ir_mail_server.py
Normal file
36
base_usability/models/ir_mail_server.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# Copyright 2015-2020 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, models
|
||||
from odoo.addons.base.models.ir_mail_server import extract_rfc2822_addresses
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class IrMailServer(models.Model):
|
||||
_inherit = "ir.mail_server"
|
||||
|
||||
@api.model
|
||||
def send_email(
|
||||
self, message, mail_server_id=None, smtp_server=None,
|
||||
smtp_port=None, smtp_user=None, smtp_password=None,
|
||||
smtp_encryption=None, smtp_debug=False, smtp_session=None):
|
||||
# Start copy from native method
|
||||
smtp_from = message['Return-Path'] or\
|
||||
self._get_default_bounce_address() or message['From']
|
||||
from_rfc2822 = extract_rfc2822_addresses(smtp_from)
|
||||
smtp_from = from_rfc2822[-1]
|
||||
# End copy from native method
|
||||
logger.info(
|
||||
"Sending email from '%s' to '%s' Cc '%s' Bcc '%s' "
|
||||
"with subject '%s'",
|
||||
smtp_from, message.get('To'), message.get('Cc'),
|
||||
message.get('Bcc'), message.get('Subject'))
|
||||
return super().send_email(
|
||||
message, mail_server_id=mail_server_id,
|
||||
smtp_server=smtp_server, smtp_port=smtp_port,
|
||||
smtp_user=smtp_user, smtp_password=smtp_password,
|
||||
smtp_encryption=smtp_encryption, smtp_debug=smtp_debug,
|
||||
smtp_session=smtp_session)
|
||||
16
base_usability/models/ir_model.py
Normal file
16
base_usability/models/ir_model.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Copyright 2019 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class IrModel(models.Model):
|
||||
_inherit = 'ir.model'
|
||||
|
||||
@api.depends('name', 'model')
|
||||
def name_get(self):
|
||||
res = []
|
||||
for rec in self:
|
||||
res.append((rec.id, '%s (%s)' % (rec.name, rec.model)))
|
||||
return res
|
||||
80
base_usability/models/res_company.py
Normal file
80
base_usability/models/res_company.py
Normal file
@@ -0,0 +1,80 @@
|
||||
# Copyright 2015-2020 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, models, _
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
@api.model
|
||||
def generate_line(self, fields, options, icon=True, separator=' - '):
|
||||
assert fields
|
||||
assert options
|
||||
content = []
|
||||
for field in fields:
|
||||
value = False
|
||||
if isinstance(field, tuple) and len(field) == 2:
|
||||
value = field[0]
|
||||
label = field[1]
|
||||
uicon = False
|
||||
elif isinstance(field, str) and field in options:
|
||||
value = options[field]['value']
|
||||
label = options[field].get('label')
|
||||
uicon = options[field].get('icon')
|
||||
if value:
|
||||
prefix = icon and uicon or label
|
||||
if prefix:
|
||||
content.append('%s %s' % (prefix, value))
|
||||
else:
|
||||
content.append(value)
|
||||
line = separator.join(content)
|
||||
return line
|
||||
|
||||
def _prepare_header_options(self):
|
||||
self.ensure_one()
|
||||
options = {
|
||||
'phone': {
|
||||
'value': self.phone,
|
||||
# http://www.fileformat.info/info/unicode/char/1f4de/index.htm
|
||||
'icon': '\U0001F4DE',
|
||||
'label': _('Tel:')},
|
||||
'email': {
|
||||
'value': self.email,
|
||||
# http://www.fileformat.info/info/unicode/char/2709/index.htm
|
||||
'icon': '\u2709',
|
||||
'label': _('E-mail:')},
|
||||
'website': {
|
||||
'value': self.website,
|
||||
'icon': '\U0001f310',
|
||||
'label': _('Website:')},
|
||||
'vat': {
|
||||
'value': self.vat,
|
||||
'label': _('VAT:')},
|
||||
}
|
||||
return options
|
||||
|
||||
def _report_company_legal_name(self):
|
||||
'''Method inherited in the module base_company_extension'''
|
||||
self.ensure_one()
|
||||
return self.name
|
||||
|
||||
# for reports
|
||||
def _display_report_header(
|
||||
self, line_details=[['phone', 'website'], ['vat']],
|
||||
icon=True, line_separator=' - '):
|
||||
self.ensure_one()
|
||||
res = ''
|
||||
address = self.partner_id._display_address(without_company=True)
|
||||
address = address.replace('\n', ' - ')
|
||||
|
||||
line1 = '%s - %s' % (self._report_company_legal_name(), address)
|
||||
lines = [line1]
|
||||
options = self._prepare_header_options()
|
||||
for details in line_details:
|
||||
line = self.generate_line(
|
||||
details, options, icon=icon, separator=line_separator)
|
||||
lines.append(line)
|
||||
res = '\n'.join(lines)
|
||||
return res
|
||||
154
base_usability/models/res_partner.py
Normal file
154
base_usability/models/res_partner.py
Normal file
@@ -0,0 +1,154 @@
|
||||
# Copyright 2015-2020 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
# track_visibility is handled in the 'mail' module, and base_usability
|
||||
# doesn't depend on 'mail', but that doesn't hurt, it will just be
|
||||
# ignored if mail is not installed
|
||||
# TODO move to mail module
|
||||
# name = fields.Char(tracking=True)
|
||||
# parent_id = fields.Many2one(tracking=True)
|
||||
# ref = fields.Char(tracking=True)
|
||||
# lang = fields.Selection(tracking=True)
|
||||
# user_id = fields.Many2one(tracking=True)
|
||||
# vat = fields.Char(tracking=True)
|
||||
# street = fields.Char(tracking=True)
|
||||
# street2 = fields.Char(tracking=True)
|
||||
# zip = fields.Char(tracking=True)
|
||||
# city = fields.Char(tracking=True)
|
||||
# state_id = fields.Many2one(tracking=True)
|
||||
# country_id = fields.Many2one(tracking=True)
|
||||
# is_company = fields.Boolean(tracking=True)
|
||||
# active = fields.Boolean(tracking=True)
|
||||
# company_id = fields.Many2one(tracking=True)
|
||||
ref = fields.Char(copy=False)
|
||||
# For reports
|
||||
name_title = fields.Char(
|
||||
compute='_compute_name_title', string='Name with Title')
|
||||
|
||||
@api.depends('name', 'title')
|
||||
def _compute_name_title(self):
|
||||
for partner in self:
|
||||
name_title = partner.name
|
||||
if partner.title and not partner.is_company:
|
||||
partner_lg = partner
|
||||
# If prefer to read the lang of the partner than the lang
|
||||
# of the context. That way, an English man will be displayed
|
||||
# with his title in English whatever the environment
|
||||
if partner.lang:
|
||||
partner_lg = partner.with_context(lang=partner.lang)
|
||||
title = partner_lg.title.shortcut or partner_lg.title.name
|
||||
name_title = ' '.join([title, name_title])
|
||||
partner.name_title = name_title
|
||||
|
||||
def _display_address(self, without_company=False):
|
||||
'''Remove empty lines'''
|
||||
res = super()._display_address(without_company=without_company)
|
||||
while "\n\n" in res:
|
||||
res = res.replace('\n\n', '\n')
|
||||
return res
|
||||
|
||||
# for reports
|
||||
def _display_full_address(
|
||||
self,
|
||||
details=['company', 'name', 'address', 'phone', 'mobile', 'email'],
|
||||
icon=True):
|
||||
self.ensure_one()
|
||||
# To make the icons work with py3o with PDF export, on the py3o server:
|
||||
# 1) sudo apt-get install fonts-symbola
|
||||
# 2) start libreoffice in xvfb (don't use --headless) (To confirm)
|
||||
if self.is_company:
|
||||
company = self.name
|
||||
name = False
|
||||
name_no_title = False
|
||||
title = False
|
||||
title_short = False
|
||||
else:
|
||||
company = self.parent_id and self.parent_id.is_company and\
|
||||
self.parent_id.name or False
|
||||
name = self.name_title
|
||||
name_no_title = self.name
|
||||
title = self.title.name
|
||||
title_short = self.title.shortcut
|
||||
options = {
|
||||
'name': {
|
||||
'value': name,
|
||||
},
|
||||
'company': {
|
||||
'value': company,
|
||||
},
|
||||
'title': {
|
||||
'value': title,
|
||||
},
|
||||
'title_short': {
|
||||
'value': title_short,
|
||||
},
|
||||
'name_no_title': {
|
||||
'value': name_no_title,
|
||||
},
|
||||
'phone': {
|
||||
'value': self.phone,
|
||||
# http://www.fileformat.info/info/unicode/char/1f4de/index.htm
|
||||
'icon': '\U0001F4DE',
|
||||
'label': _('Tel:'),
|
||||
},
|
||||
'mobile': {
|
||||
'value': self.mobile,
|
||||
# http://www.fileformat.info/info/unicode/char/1f4f1/index.htm
|
||||
'icon': '\U0001F4F1',
|
||||
'label': _('Mobile:'),
|
||||
},
|
||||
'email': {
|
||||
'value': self.email,
|
||||
# http://www.fileformat.info/info/unicode/char/2709/index.htm
|
||||
'icon': '\u2709',
|
||||
'label': _('E-mail:'),
|
||||
},
|
||||
'website': {
|
||||
'value': self.website,
|
||||
# http://www.fileformat.info/info/unicode/char/1f310/index.htm
|
||||
'icon': '\U0001f310',
|
||||
'label': _('Website:'),
|
||||
},
|
||||
'address': {
|
||||
'value': self._display_address(without_company=True),
|
||||
},
|
||||
'vat': {
|
||||
'value': self.commercial_partner_id.vat,
|
||||
'label': _('VAT Number:'),
|
||||
},
|
||||
'commercial_ref': {
|
||||
'value': self.commercial_partner_id.ref,
|
||||
'label': _('Customer Number:'),
|
||||
},
|
||||
'ref': {
|
||||
'value': self.ref,
|
||||
'label': _('Customer Number:'),
|
||||
},
|
||||
# Same with 'supplier_' prefix, to change the label
|
||||
'supplier_commercial_ref': {
|
||||
'value': self.commercial_partner_id.ref,
|
||||
'label': _('Supplier Number:'),
|
||||
},
|
||||
'supplier_ref': {
|
||||
'value': self.ref,
|
||||
'label': _('Supplier Number:'),
|
||||
},
|
||||
}
|
||||
res = []
|
||||
for detail in details:
|
||||
if options.get(detail) and options[detail]['value']:
|
||||
entry = options[detail]
|
||||
prefix = icon and entry.get('icon') or entry.get('label')
|
||||
if prefix:
|
||||
res.append('%s %s' % (prefix, entry['value']))
|
||||
else:
|
||||
res.append('%s' % entry['value'])
|
||||
res = '\n'.join(res)
|
||||
return res
|
||||
14
base_usability/models/res_partner_bank.py
Normal file
14
base_usability/models/res_partner_bank.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# Copyright 2015-2020 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResPartnerBank(models.Model):
|
||||
_inherit = 'res.partner.bank'
|
||||
|
||||
# In the 'base' module, they didn't put any string, so the bank name is
|
||||
# displayed as 'Name', which the string of the related field it
|
||||
# points to
|
||||
bank_name = fields.Char(string='Bank Name')
|
||||
11
base_usability/models/res_partner_category.py
Normal file
11
base_usability/models/res_partner_category.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# Copyright 2015-2020 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResPartnerCategory(models.Model):
|
||||
_inherit = 'res.partner.category'
|
||||
|
||||
name = fields.Char(translate=False)
|
||||
27
base_usability/models/res_users.py
Normal file
27
base_usability/models/res_users.py
Normal file
@@ -0,0 +1,27 @@
|
||||
# Copyright 2018-2020 Akretion France (http://www.akretion.com/)
|
||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from odoo import api, models, SUPERUSER_ID
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ResUsers(models.Model):
|
||||
_inherit = 'res.users'
|
||||
|
||||
@api.model
|
||||
def _script_partners_linked_to_users_no_company(self):
|
||||
if self.env.user.id != SUPERUSER_ID:
|
||||
self = self.sudo()
|
||||
logger.info(
|
||||
'START to set company_id=False on partners related to users')
|
||||
users = self.with_context(active_test=False).search([])
|
||||
for user in users:
|
||||
if user.partner_id.company_id:
|
||||
user.partner_id.write({'company_id': False})
|
||||
logger.info(
|
||||
'Wrote company_id=False on user %s ID %d',
|
||||
user.login, user.id)
|
||||
logger.info(
|
||||
'END setting company_id=False on partners related to users')
|
||||
3
base_usability/readme/CONTRIBUTORS.rst
Normal file
3
base_usability/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1,3 @@
|
||||
* Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
* Raphaël Valyi <rvalyi@akretion.com>
|
||||
* David Beal <david.beal@akretion.com>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user