From 7416737d3faddcab71952f55eda3b7f37ee355f7 Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Wed, 25 Apr 2018 18:03:25 +0200 Subject: [PATCH 01/18] [ADD] stock_request_kanban --- stock_request_kanban/README.rst | 83 +++++++++ stock_request_kanban/__init__.py | 5 + stock_request_kanban/__manifest__.py | 28 +++ .../data/stock_request_sequence_data.xml | 14 ++ stock_request_kanban/models/__init__.py | 5 + stock_request_kanban/models/stock_request.py | 10 ++ .../models/stock_request_kanban.py | 19 ++ .../report/report_paper_format.xml | 15 ++ .../report/stock_request_kanban_templates.xml | 75 ++++++++ .../security/ir.model.access.csv | 3 + .../static/description/icon.png | Bin 0 -> 5760 bytes stock_request_kanban/tests/__init__.py | 1 + stock_request_kanban/tests/test_kanban.py | 166 ++++++++++++++++++ .../views/stock_request_kanban_views.xml | 146 +++++++++++++++ .../views/stock_request_order_views.xml | 21 +++ stock_request_kanban/wizard/__init__.py | 6 + .../wizard/wizard_stock_request_kanban.py | 14 ++ .../wizard_stock_request_kanban_abstract.py | 90 ++++++++++ .../wizard_stock_request_kanban_views.xml | 56 ++++++ .../wizard_stock_request_order_kanban.py | 53 ++++++ ...izard_stock_request_order_kanban_views.xml | 31 ++++ 21 files changed, 841 insertions(+) create mode 100644 stock_request_kanban/README.rst create mode 100644 stock_request_kanban/__init__.py create mode 100644 stock_request_kanban/__manifest__.py create mode 100644 stock_request_kanban/data/stock_request_sequence_data.xml create mode 100644 stock_request_kanban/models/__init__.py create mode 100644 stock_request_kanban/models/stock_request.py create mode 100644 stock_request_kanban/models/stock_request_kanban.py create mode 100644 stock_request_kanban/report/report_paper_format.xml create mode 100644 stock_request_kanban/report/stock_request_kanban_templates.xml create mode 100644 stock_request_kanban/security/ir.model.access.csv create mode 100644 stock_request_kanban/static/description/icon.png create mode 100644 stock_request_kanban/tests/__init__.py create mode 100644 stock_request_kanban/tests/test_kanban.py create mode 100644 stock_request_kanban/views/stock_request_kanban_views.xml create mode 100644 stock_request_kanban/views/stock_request_order_views.xml create mode 100644 stock_request_kanban/wizard/__init__.py create mode 100644 stock_request_kanban/wizard/wizard_stock_request_kanban.py create mode 100644 stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py create mode 100644 stock_request_kanban/wizard/wizard_stock_request_kanban_views.xml create mode 100644 stock_request_kanban/wizard/wizard_stock_request_order_kanban.py create mode 100644 stock_request_kanban/wizard/wizard_stock_request_order_kanban_views.xml diff --git a/stock_request_kanban/README.rst b/stock_request_kanban/README.rst new file mode 100644 index 000000000..b998d251f --- /dev/null +++ b/stock_request_kanban/README.rst @@ -0,0 +1,83 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +==================== +Stock Request Kanban +==================== + +On most companies there is products that must be purchased often but cannot be +stored as a usual product because no consumption moves are made. +Usually, they are stored as consumables or putaway rules are defined. +In both cases, reordering rules cannot be used. +This module allows to use stock request as reordering rules for this kind of +products. + +It is created following the concept of lean kanban cards. + +Usage +===== + +Creation +-------- +* Go to 'Stock Requests / Stock Requests Kanban' and create a new Kanban. +* Indicate a product, quantity and location. +* Press 'Save'. +* Print the kanban and put it in the storage of the product + +Request kanban +-------------- + +This should be used if you want to create the kanban when the card is consumed. + +* Once the product is consumed, take the card +* Go to 'Stock Requests / Order Kanban Card' +* Scan the card +* The stock request is created + +Request kanban batch +-------------------- + +This should be used when you will store the cards and create request orders +for kanbans later. + +* Once the product is consumed, take the card and store it +* Create a store request order +* Press the scan button +* Scan all the pending kanban cards + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/153/11.0 + + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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. + +Credits +======= + +Contributors +------------ + +* Enric Tobella + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/stock_request_kanban/__init__.py b/stock_request_kanban/__init__.py new file mode 100644 index 000000000..22ba14540 --- /dev/null +++ b/stock_request_kanban/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2018 Creu Blanca +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from . import models +from . import wizard diff --git a/stock_request_kanban/__manifest__.py b/stock_request_kanban/__manifest__.py new file mode 100644 index 000000000..ccb4333a6 --- /dev/null +++ b/stock_request_kanban/__manifest__.py @@ -0,0 +1,28 @@ +# Copyright 2018 Creu Blanca +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +{ + 'name': 'Stock Request kanban', + 'version': '11.0.1.0.0', + 'category': 'Reporting', + 'website': 'https://github.com/eficent/cb-addons', + 'author': 'Creu Blanca, Eficent, Odoo Community Association (OCA)', + 'license': 'AGPL-3', + 'summary': 'Adds a stock request order, and takes stock requests as lines', + 'depends': [ + 'stock_request', + 'barcodes', + ], + 'data': [ + 'data/stock_request_sequence_data.xml', + 'report/report_paper_format.xml', + 'wizard/wizard_stock_request_kanban_views.xml', + 'wizard/wizard_stock_request_order_kanban_views.xml', + 'views/stock_request_order_views.xml', + 'views/stock_request_kanban_views.xml', + 'report/stock_request_kanban_templates.xml', + 'security/ir.model.access.csv', + ], + 'installable': True, + 'application': False, +} diff --git a/stock_request_kanban/data/stock_request_sequence_data.xml b/stock_request_kanban/data/stock_request_sequence_data.xml new file mode 100644 index 000000000..33931ab67 --- /dev/null +++ b/stock_request_kanban/data/stock_request_sequence_data.xml @@ -0,0 +1,14 @@ + + + + + + Stock Request Kanban + stock.request.kanban + KB + 5 + + + + + diff --git a/stock_request_kanban/models/__init__.py b/stock_request_kanban/models/__init__.py new file mode 100644 index 000000000..66d035730 --- /dev/null +++ b/stock_request_kanban/models/__init__.py @@ -0,0 +1,5 @@ +# Copyright 2018 Creu Blanca +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from . import stock_request +from . import stock_request_kanban diff --git a/stock_request_kanban/models/stock_request.py b/stock_request_kanban/models/stock_request.py new file mode 100644 index 000000000..664b71afe --- /dev/null +++ b/stock_request_kanban/models/stock_request.py @@ -0,0 +1,10 @@ +# Copyright 2018 Creu Blanca +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from odoo import models, fields + + +class StockRequest(models.Model): + _inherit = 'stock.request' + + kanban_id = fields.Many2one('stock.request.kanban', readonly=True) diff --git a/stock_request_kanban/models/stock_request_kanban.py b/stock_request_kanban/models/stock_request_kanban.py new file mode 100644 index 000000000..b91378e2c --- /dev/null +++ b/stock_request_kanban/models/stock_request_kanban.py @@ -0,0 +1,19 @@ +# Copyright 2018 Creu Blanca +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from odoo import api, models, fields + + +class StockRequestKanban(models.Model): + _name = 'stock.request.kanban' + _description = 'Stock Request Kanban' + _inherit = 'stock.request.abstract' + + active = fields.Boolean(default=True) + + @api.model + def create(self, vals): + if vals.get('name', '/') == '/': + vals['name'] = self.env['ir.sequence'].next_by_code( + 'stock.request.kanban') + return super().create(vals) diff --git a/stock_request_kanban/report/report_paper_format.xml b/stock_request_kanban/report/report_paper_format.xml new file mode 100644 index 000000000..4296a6412 --- /dev/null +++ b/stock_request_kanban/report/report_paper_format.xml @@ -0,0 +1,15 @@ + + + + Kanban format + A4 + Portrait + 0.0 + 0.0 + 0.0 + 0.0 + 0 + 72 + + + \ No newline at end of file diff --git a/stock_request_kanban/report/stock_request_kanban_templates.xml b/stock_request_kanban/report/stock_request_kanban_templates.xml new file mode 100644 index 000000000..2bcff8ff6 --- /dev/null +++ b/stock_request_kanban/report/stock_request_kanban_templates.xml @@ -0,0 +1,75 @@ + + + + + + + + + diff --git a/stock_request_kanban/security/ir.model.access.csv b/stock_request_kanban/security/ir.model.access.csv new file mode 100644 index 000000000..2b0a2da15 --- /dev/null +++ b/stock_request_kanban/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_stock_request_kanban_user,stock request kanban user,model_stock_request_kanban,stock_request.group_stock_request_user,1,1,1, +access_stock_request_kanban_manager,stock request kanban manager,model_stock_request_kanban,stock_request.group_stock_request_manager,1,1,1,1 diff --git a/stock_request_kanban/static/description/icon.png b/stock_request_kanban/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..dc706ff5d0d8eeb02bdc4c3486060e9a81ecd48b GIT binary patch literal 5760 zcmcgwE`kGKfLEXGk4;CxnJhYIWuv3I%*_@^n?HafJ8%GMgLz8{|`XCf3aJ^X7FFav(;2n z0X+O?ACVPl{}=*KbyFVzfQaHhU;%RSX#bJ;z8c!9_^Uu5J~948#_-#J6qB=|iLbJU zo125X@4prRQ1*7P@pZ6gg*p4aW>wSB*0UFKzy|=R)-_ZV4Fl%(^I^W`llgs+3#62G ziO?65Zwo|{cy=GO2g!wT$vcxfxs$sGxa}j>qiSW^z-=-JE*ss9+j?*mHR}Mk>zq3| z4wh{^R_soA*U#_f4zn4Pa`cVc9!toZzFazum)UhGuDBPwb}Y_Ixi{#;;IKPOqB4Zi zA7vut4s2}z$^V@vRN`rNL_U_xd3;c@@kam%Y!O=YTwbVTMQ`{@vQHh@K zg2OKDu7iRbA0OFtmsguzZgfMGp_Tcaj~R0O57%fQAttdAEYJ7kf1&OmEyn-VrFr5P zi@{GQS2{GoU_v~RSQV@>6~=UbkkV^xEmgVGe&rdA{n80SUqHbREVX>PLDuJfbHH>O z8`MaU74LQbbzhd~sqxd)oU4Qq=G+Nk%^QFL*@gTmE82_jA#z-21t0G&1?&89hD1qg zCMySE0L-_rpx}cuJ<<|!U2JzVk9}go*dso);G{FxwRM&d)V_RJQCg}(VGZrQ7rgmN z8Tw~o7QS29VR>XSZ2`-d#4;dR)qCxW-Cu_c*~fv0Cxg6EeR&{?j|glokjo_r9~($1 z{1+-0lw|Slf&dF~lcdiYLlD@kM5b&=Nz1zM(GWQN&Q7te0hr`>M7vz+*AQt8b!^pC zImoH&#+k7Y8OPBW2RG4m9S33%SD5L{6~QwSeWez9yKm~h7J|ad_q7`uS&BP6!UG-v z;EiNoSAdqyiiDsXss|VV#^3=dX~e3(=d}1Z`k*y-<8Teof zF7LM=mxJgdra$#Y62HkwlS;#diF20cevV8S+hlEmyuf_#HM6M&7%=(gOQ00{;?6|Y z4blv%93~CW;=E>n0YlM#b<|VkC}kV;U0FaBJ{G5aWV?M-Yb!mP;Z0WHxl-g{`3pIu z>u-@|BD`WU$@VL$f`B!GywZL28gHMGJ{ztH77J`46n}%O%&uU5Zg!+5^p4jp_;GXQ z08FrQ!AXJ`VMvShc*9|1C|fqup+eBk(E`UPJw5Oc(~@bqf`QyR5B>2Mjiyh%PIHc( zoHp-jq_GlNTfk=t2ya>rmF>XO8_&mJD}LjE?#9S7208Fp+&sl(QR_qX(fMbqDjts9 z&0>oxzi4(i<|sI}s2Z!pZe|Zil@zG4Pf$aDCMTj1*{z=s}zUd0|*i@xGxEPP4 z+_i$Ie3>#A*$E7OmD92n3-KnfqYMyKZXV5PNraYfZxfD9P}xrGGLR|hy)^BTYCqG4 z;&h3`WIG~d8_Z@V`cwcTrPSTucd#mjXH$GY zWzT>K#ihI6FT{+0*$#T@^2K?DqeRSKqe22*`fJKl?!b0W8FMWslZuG_ArC@=47sNM zcQU`NYCE~GqSc5W-|pG?ceI6|3`(F~RgX$W8_Jnv^_*h|BDG|1uae$i@ZU>&OwMv7 z-pE;wATQyTf#Gn=#}G#yx~HE#&tRbuHoGemR>6B`dY&Aop?$L7S2 zeX;qCblE!VH9a>T9u$17|Kb{jbZzm#8BS_X0HGSK9yN2mnU){;-Xx{le1tW`&XQo% zSn}l|WH{|`hp5Z0;{ie**Yhd12D!FF_Bj+K9xh8{k=uA7l{<4$A?Vw8oeU)#|$0q4z5AVpw5IDLIciGr&q1W_XeZ7oE1}xV95XOtxLWWI7bHW>p~jnJ(FA zR@unuWjeESsN-m!%%-%w#bO`VLcM|H6E}Fe=7^d64yMB_L}9n^mDG>vu!dPT`n{P; z(s^n@=JP#&@vd_w?UF3O24Ps=q2$DMpP+9~TT0?v@X*2snr1O`aI_(Lw=gJt^r*#6 ztz3!C)1Kb!DJ!Kubf{{e--To~hpf-*b%HP1l@9_@Wa9rvMmqaMt(&C)PHd_!ZyvFI zB3x1wL3iRfp=YI=-NfruT&$B?@YS94B6j<5ue_;)g(rX0j>b|vF>$0YuKouz{SHG6 zMoN&0JPsEb5;7BKuecs^zU^m6zG9I1)n@*?n=g~=V2Kv4g&Wg?&-8^F`~VXaOToIk z--K+=%~(ciNKZ=f-tO%UCqIM2zTXHwQC(t1Vib7EFZne=8H%DAJ)|Vo;51Py5##`n z)ER+00iuI-QAImvNskxls&2y_dEDwhS9Sz+eHzgj(mCF_CV7PHL|@b2?_0IUEpPp4 zRs^?ucGJlC<(Z=fJ>1qWI&KSplnYVCQRr3xO-jDpn6;l$xp(Y;#}eaAXpN)!DF;*{pJD#u^70FAEO*>69klKW zmF6pK-bi@Y)kh{I-A1d(DeBKDyZ%6bf_v)WYOzqMmI)voskRO|pf#l5 zaN*pCG~Z6zA*oZ?meq~_xCW1Q97;ztdnh-8gqn&U0??1*W;iC z{#}|JDRR4cH%AafuJ(y7&dLOL5Gs9Q^@L3t*^_@({=)M)6u9abU0Uqw&&A*21upAV z6tLN7(9((KcsJ|ys_CF2OwCE>62Em$)TkFD<}$Invvh&Vcl!6WQ~bi^zKOKfWhMFV{1s8nK};Cd}bnVIp;dQ54WU@y2n;bY%u_y;>+dTzqk z9SLFWw}I0_C8c%Vo>MF(A&A6M_zQ^yVmo&6{z-IC`VROsX-Cm*8N1jdbsjfXeT3);4}Si_o(3G6fGPsChBULXk~^RPtx+Z z0bK5%!qpqBG7UbE_iIkpxN?j;GIF7->YY`l^*YVrZOV&T8iDK8V`D7kWq~ZYmdonR zvT|RKLP8-GLuTSd7e;Q6)UC%Nn+rzlCZE1%(Ji!^uXoMCI`yF3x zq@^R=R%RFymL9;qaZPOM4^|am;+V{1pCT&?(0LTM6oDa+I#7OTSYWbE)TIn*^*GHP z`mJ${gmjCxtPV=qnD$jzO{@F%YVeRtk7Et2K*3XilW*7=*@>8d_kEKT!` zsjIx@-_%o3Jwx(QS+M@2Us$P&UQ%I9 zI}DJY)R9o#id$2{8)>VXISS9uCv(@_k7FN3t2dXmVvH02Z`Z zk2Yl>+sM={Rh{SfNRyf`1TPQQfC-&)yN(ZW-2KYbw-J;`Q-t zyDh>~l`GZek&lR9(tDy06<`xh;Ocg&qdIN7Fe2}#z#~*DI-n4c&#DVxwmj^|PK@V# z$GLVI(_OlDrHOjHcmsgl_rX5#f^*HWvm8QQo$UxH)MVUU^dce@p-+MMw$*otp~@^z z4;cwih20ibsy{iHYLkq~Q7HoU3J@ND?EUHlBs?YMS-kb6@L^%=lOP?0F=TI>C-8pT zFOWNKy)5$q%>(heTF(J^_>tXz#GepdoU<-hip6s7D_6fHaB~?Df!i*n$?A=6`VYN} zs}?QWsyg#}qPw86R_Q76Ec;1v6V7JmJr0k;gz>X_bb4X)hf%Ar5X-`?>JFsLl|pzE z`!hE?d2aTJr|HgxO4h))4QY-SMDum{vlT?$S%n}(@bKg`8r46*9bVC|yq`*!RUQp;6iQnqR0iqt#5J7P z?p_J9N^g=7_~7=77c##ITynJN{_%A% zOIzp(x4(a{R{3g=e4hkaiecXN7soB^h%3K@N6{tt70J|k(9IC57d#SIxV)z3+KZ8R zx6BX}W9m0UYeMxhx3v^pkNdxYYem4U=jCMUysqtk&KbFHY=2;^M#%{-(vrbafhFFF zawtk%`OuxrpSao7_L~grR|onv zuFVyq`XVH6KQWcT!lY^zuQ>09>9mtAh}kFAMc1E3mhziUuud(FF1J50-nF&S)|O;t zKPs0IWbN{2I&w!+zSbNsWZ&Exr!#@|wNH{!=2eH0t-@eNNV z0OiTlHp^n6)tl!MFRzI3H1hdMWe(KRD&FQ@eVhNod#iBv;nIIE0%5l9NdssWv@!ip zop{_U_q!A9WO|;3qhTL}Q_0KisB`ADON`btyo|3jUFbYL*-Yw}6_B}F|KVXmi`Q{~ zXf-xA8^}Hm;3OngWodoriX8d!HERJoGaczS_@-`8bL-^V?Ttn$$+(N><_2yNs|$}t zY;eHI>KQ^FnLSIBr*bxMhRcAiLx;$uJF2B}zQUJY`2GAOWlp=WX0i)Vr1#;cILEdfw&zY5SFJ?8e>q`d4B2c+QTc$p z$(cp^(708*l``hmEWpK7r^ag9$&`-%)-XF<(eVR=Vn@x*G+J*^QEjcxOZE5_;W|s7 zTX!^g_E(ONh6b1J`i5O^dIweVaP5r=9cJ>~NHU@9#1W%M|F#+49&clUAHon}utP$w z(fjxD#rW)!MjbHurL(O+Y7*!YFlr;Ymi)}li^QkBHg7hwKy;J6zj3#~{w{4dk#9%% zeTd;pL%mm~aS=wfw?!+Y|sI2jxb60tP z`I^X{c0Hykw6-(&RhpT;ld2YxdQ~Wwe*e~jG05i0-8mqUGV3`v)Yv_=lhXZ_G&s$j zsD=Er@r>N1vnU>yKa ze3{1kR$rG)?B749QYwVg1Ie~>;dAB$5vxq^C@3g+al&Lo(pR&3T6OY}`13mEk6Jj} zwsaLc3x9hk*?S?Yk<&F7c#M4s!X6wvie; z6oVV$4Vu($`o4twomtmA7YulxZ}VUEUu|jA6a2d;z)qzJ3PSl$p)aOqI-P2+PrcZ3 zBy!Ly5gUyrp53OD!&SDs9+upbZzgj84ptuR75~a>_|4lJx%b&CrUtB{7+piGs~YYg zRiL>z>l4daNNA8gZGPtr4~6VbYbz}r@?P&rM{uHLyF??y+fX2oFEhB zNG&Sb%tTy-gd$0}ED4!OfKa|D zuA@gttv8=+UfGdMWQ=@-+mPJTm6asQ6wx!P4lX&K!(hof2P~Wsh5?R-<10@pnp;!p zs3zevUWN}|_U^GsZ1sHkwHjyKFEEtj%#7$$T3}&Z1$ MsOqSERkDu!AL4u3zW@LL literal 0 HcmV?d00001 diff --git a/stock_request_kanban/tests/__init__.py b/stock_request_kanban/tests/__init__.py new file mode 100644 index 000000000..6370893a8 --- /dev/null +++ b/stock_request_kanban/tests/__init__.py @@ -0,0 +1 @@ +from . import test_kanban diff --git a/stock_request_kanban/tests/test_kanban.py b/stock_request_kanban/tests/test_kanban.py new file mode 100644 index 000000000..38f8b2df6 --- /dev/null +++ b/stock_request_kanban/tests/test_kanban.py @@ -0,0 +1,166 @@ +# Copyright 2017 Creu Blanca +# Copyright 2017 Eficent Business and IT Consulting Services, S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from odoo.tests.common import TransactionCase +from odoo.exceptions import ValidationError +from reportlab.graphics.barcode import getCodes + + +class TestKanban(TransactionCase): + + def setUp(self): + super().setUp() + self.main_company = self.env.ref('base.main_company') + self.warehouse = self.env.ref('stock.warehouse0') + self.categ_unit = self.env.ref('product.product_uom_categ_unit') + + # common data + self.company_2 = self.env['res.company'].create({ + 'name': 'Comp2', + }) + self.wh2 = self.env['stock.warehouse'].search( + [('company_id', '=', self.company_2.id)], limit=1) + + self.ressuply_loc = self.env['stock.location'].create({ + 'name': 'Ressuply', + 'location_id': self.warehouse.view_location_id.id, + }) + self.route = self.env['stock.location.route'].create({ + 'name': 'Transfer', + 'product_categ_selectable': False, + 'product_selectable': True, + 'company_id': self.main_company.id, + 'sequence': 10, + }) + self.product = self.env['product.product'].create({ + 'name': 'Product', + 'route_ids': [(4, self.route.id)], + 'company_id': False, + }) + self.uom_dozen = self.env['product.uom'].create({ + 'name': 'Test-DozenA', + 'category_id': self.categ_unit.id, + 'factor_inv': 12, + 'uom_type': 'bigger', + 'rounding': 0.001}) + + self.env['procurement.rule'].create({ + 'name': 'Transfer', + 'route_id': self.route.id, + 'location_src_id': self.ressuply_loc.id, + 'location_id': self.warehouse.lot_stock_id.id, + 'action': 'move', + 'picking_type_id': self.warehouse.int_type_id.id, + 'procure_method': 'make_to_stock', + 'warehouse_id': self.warehouse.id, + 'company_id': self.main_company.id, + 'propagate': 'False', + }) + + def test_onchanges(self): + kanban = self.env['stock.request.kanban'].new({}) + kanban.product_id = self.product + kanban.onchange_product_id() + kanban.company_id = self.main_company + kanban.onchange_company_id() + self.assertTrue(kanban.warehouse_id) + kanban.warehouse_id = self.wh2 + kanban.onchange_warehouse_id() + self.assertEqual(kanban.company_id, self.company_2) + kanban.location_id = self.warehouse.view_location_id + kanban.onchange_location_id() + self.assertEqual(kanban.company_id, self.main_company) + self.assertEqual(kanban.warehouse_id, self.warehouse) + + def test_create(self): + kanban = self.env['stock.request.kanban'].new({}) + kanban.product_id = self.product + kanban.onchange_product_id() + kanban.product_uom_qty = 1 + kanban = kanban.create(kanban._convert_to_write(kanban._cache)) + self.assertTrue(kanban.company_id) + self.assertEqual(kanban.route_ids, self.route) + + def test_order_barcodes(self): + kanban_1 = self.env['stock.request.kanban'].create({ + 'product_id': self.product.id, + 'product_uom_id': self.product.uom_id.id, + 'product_uom_qty': 1, + }) + kanban_2 = self.env['stock.request.kanban'].create({ + 'product_id': self.product.id, + 'product_uom_id': self.product.uom_id.id, + 'product_uom_qty': 1, + }) + kanban_3 = self.env['stock.request.kanban'].create({ + 'product_id': self.product.id, + 'product_uom_id': self.product.uom_id.id, + 'product_uom_qty': 1, + 'company_id': self.company_2.id, + 'warehouse_id': self.wh2.id, + 'location_id': self.wh2.lot_stock_id.id, + }) + order = self.env['stock.request.order'].create({ + 'company_id': self.main_company.id, + 'warehouse_id': self.warehouse.id, + 'location_id': self.warehouse.lot_stock_id.id, + }) + wizard = self.env['wizard.stock.request.order.kanban'].with_context( + default_order_id=order.id + ).create({}) + with self.assertRaises(ValidationError): + wizard.on_barcode_scanned(kanban_1.name) + self.pass_code(wizard, kanban_1.name) + self.assertEqual(wizard.status_state, 0) + self.assertTrue(order.stock_request_ids.filtered( + lambda r: r.kanban_id == kanban_1 + )) + self.pass_code(wizard, kanban_2.name) + self.assertTrue(order.stock_request_ids.filtered( + lambda r: r.kanban_id == kanban_2 + )) + self.assertEqual(wizard.status_state, 0) + self.pass_code(wizard, kanban_1.name) + self.assertEqual(wizard.status_state, 1) + self.pass_code(wizard, kanban_2.name+kanban_1.name) + self.assertEqual(wizard.status_state, 1) + with self.assertRaises(ValidationError): + self.pass_code(wizard, kanban_3.name) + + def test_barcodes(self): + kanban_1 = self.env['stock.request.kanban'].create({ + 'product_id': self.product.id, + 'product_uom_id': self.product.uom_id.id, + 'product_uom_qty': 1, + }) + kanban_2 = self.env['stock.request.kanban'].create({ + 'product_id': self.product.id, + 'product_uom_id': self.product.uom_id.id, + 'product_uom_qty': 1, + }) + wizard = self.env['wizard.stock.request.kanban'].with_context( + ).create({}) + with self.assertRaises(ValidationError): + wizard.on_barcode_scanned(kanban_1.name) + self.assertFalse(self.env['stock.request'].search( + [('kanban_id', '=', kanban_1.id)]) + ) + self.pass_code(wizard, kanban_1.name) + self.assertEqual(wizard.status_state, 0) + self.assertTrue(self.env['stock.request'].search( + [('kanban_id', '=', kanban_1.id)]) + ) + self.assertFalse(self.env['stock.request'].search( + [('kanban_id', '=', kanban_2.id)]) + ) + self.pass_code(wizard, kanban_2.name) + self.assertTrue(self.env['stock.request'].search( + [('kanban_id', '=', kanban_2.id)]) + ) + + def pass_code(self, wizard, code): + bcc = getCodes()[wizard.get_barcode_format()](value=code) + bcc.validate() + bcc.encode() + wizard.on_barcode_scanned(bcc.encoded[1:-1]) diff --git a/stock_request_kanban/views/stock_request_kanban_views.xml b/stock_request_kanban/views/stock_request_kanban_views.xml new file mode 100644 index 000000000..1f3474a8a --- /dev/null +++ b/stock_request_kanban/views/stock_request_kanban_views.xml @@ -0,0 +1,146 @@ + + + + + + stock.request.kanban.tree + stock.request.kanban + + + + + + + + + + + + + + + + + stock.request.kanban.search + stock.request.kanban + + + + + + + + + + + + + + + + + + stock.request.kanban.form + stock.request.kanban + +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + stock.request.kanban.kanban + stock.request.kanban + + + + + + + + + + + +
+ +
+ +
+
+ +
+
    +
  • +
  • +
  • +
  • +
+
+
+ + + + + + + + + Stock Request Kanbans + stock.request.kanban + ir.actions.act_window + form + kanban,tree,form + +

+ Click to add a Stock Request Kanban. +

+
+
+ + + + diff --git a/stock_request_kanban/views/stock_request_order_views.xml b/stock_request_kanban/views/stock_request_order_views.xml new file mode 100644 index 000000000..d830b6c75 --- /dev/null +++ b/stock_request_kanban/views/stock_request_order_views.xml @@ -0,0 +1,21 @@ + + + + + stock.request.order.form + stock.request.order + + + +
@@ -136,11 +142,4 @@ - - diff --git a/stock_request_kanban/views/stock_request_menu.xml b/stock_request_kanban/views/stock_request_menu.xml new file mode 100644 index 000000000..c54ef5599 --- /dev/null +++ b/stock_request_kanban/views/stock_request_menu.xml @@ -0,0 +1,16 @@ + + + + + + + diff --git a/stock_request_kanban/wizard/wizard_stock_request_kanban_views.xml b/stock_request_kanban/wizard/wizard_stock_request_kanban_views.xml index 9d54e7b2d..f9e1cb489 100644 --- a/stock_request_kanban/wizard/wizard_stock_request_kanban_views.xml +++ b/stock_request_kanban/wizard/wizard_stock_request_kanban_views.xml @@ -47,10 +47,4 @@ view_type="form" target="new"/> - - From 8ddddda2063ba8965771553b21e99208c555632a Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Wed, 5 Sep 2018 10:20:22 +0000 Subject: [PATCH 03/18] Added translation using Weblate (Spanish) --- stock_request_kanban/i18n/es.po | 255 ++++++++++++++++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 stock_request_kanban/i18n/es.po diff --git a/stock_request_kanban/i18n/es.po b/stock_request_kanban/i18n/es.po new file mode 100644 index 000000000..92b38411c --- /dev/null +++ b/stock_request_kanban/i18n/es.po @@ -0,0 +1,255 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_request_kanban +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_active +msgid "Active" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.actions.act_window,name:stock_request_kanban.wizard_stock_request_kanban_action +#: model:ir.actions.act_window,name:stock_request_kanban.wizard_stock_request_order_kanban_action +#: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_request_kanban_form +msgid "Add Kanban" +msgstr "" + +#. module: stock_request_kanban +#: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py:60 +#, python-format +msgid "Added kanban %s for product %s" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search +msgid "Archived" +msgstr "" + +#. module: stock_request_kanban +#: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py:49 +#, python-format +msgid "Barcode %s does not correspond to any Kanban. Try with another barcode or press Close to finish scanning." +msgstr "" + +#. module: stock_request_kanban +#: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:23 +#, python-format +msgid "Barcode %s is on the order" +msgstr "" + +#. module: stock_request_kanban +#: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py:39 +#, python-format +msgid "CRC is not valid" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.actions.act_window,help:stock_request_kanban.stock_request_kanban_action +msgid "Click to add a Stock Request Kanban." +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_request_kanban_form +msgid "Close" +msgstr "" + +#. module: stock_request_kanban +#: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:32 +#, python-format +msgid "Company must be the same" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_create_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_create_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_create_uid +msgid "Created by" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_create_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_create_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_create_date +msgid "Created on" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_display_name +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_display_name +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_display_name +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_display_name +msgid "Display Name" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search +msgid "Group By" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_5473 +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_id +msgid "ID" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_kanban_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_kanban_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_kanban_id +msgid "Kanban" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.menu,name:stock_request_kanban.stock_request_kanban_menu +msgid "Kanban cards" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban___last_update +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban___last_update +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract___last_update +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban___last_update +msgid "Last Modified on" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_write_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_write_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_write_uid +msgid "Last Updated by" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_write_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_write_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_write_date +msgid "Last Updated on" +msgstr "" + +#. module: stock_request_kanban +#: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:27 +#, python-format +msgid "Lines only can be added on orders with draft state" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search +msgid "Location" +msgstr "" + +#. module: stock_request_kanban +#: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:40 +#, python-format +msgid "Location must be the same" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_order_id +msgid "Order" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.actions.report,name:stock_request_kanban.action_report_kanban +msgid "Print kanban" +msgstr "" + +#. module: stock_request_kanban +#: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:38 +#, python-format +msgid "Procurement group must be the same" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.menu,name:stock_request_kanban.menu_wizard_stock_request_kanban +msgid "Request from Kanban cards" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_order_form +msgid "Scan" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_status +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_status +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_status +msgid "Status" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_status_state +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_status_state +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_status_state +msgid "Status State" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model,name:stock_request_kanban.model_stock_request +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_stock_request_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_stock_request_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_stock_request_id +msgid "Stock Request" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model,name:stock_request_kanban.model_stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_request_kanban_form +msgid "Stock Request Kanban" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.actions.act_window,name:stock_request_kanban.stock_request_kanban_action +msgid "Stock Request Kanbans" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_request_kanban_form +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_request_kanban_tree +msgid "Stock Requests" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search +msgid "Stock Requests Kanban" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search +msgid "Warehouse" +msgstr "" + +#. module: stock_request_kanban +#: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:42 +#, python-format +msgid "Warehouse must be the same" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model,name:stock_request_kanban.model_wizard_stock_request_kanban +msgid "wizard.stock.request.kanban" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model,name:stock_request_kanban.model_wizard_stock_request_kanban_abstract +msgid "wizard.stock.request.kanban.abstract" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model,name:stock_request_kanban.model_wizard_stock_request_order_kanban +msgid "wizard.stock.request.order.kanban" +msgstr "" From 1a145dc6277b8e0745d9155508e14592b065ab73 Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Wed, 5 Sep 2018 10:20:44 +0000 Subject: [PATCH 04/18] Translated using Weblate (Spanish) Currently translated at 100,0% (40 of 40 strings) Translation: stock-logistics-warehouse-11.0/stock-logistics-warehouse-11.0-stock_request_kanban Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-11-0/stock-logistics-warehouse-11-0-stock_request_kanban/es/ --- stock_request_kanban/i18n/es.po | 84 ++++++++++--------- .../i18n/stock_request_kanban.pot | 2 +- 2 files changed, 45 insertions(+), 41 deletions(-) diff --git a/stock_request_kanban/i18n/es.po b/stock_request_kanban/i18n/es.po index 92b38411c..7020741c7 100644 --- a/stock_request_kanban/i18n/es.po +++ b/stock_request_kanban/i18n/es.po @@ -6,84 +6,88 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2018-09-06 11:53+0000\n" +"Last-Translator: Enric Tobella \n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.1.1\n" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_active msgid "Active" -msgstr "" +msgstr "Activo" #. module: stock_request_kanban #: model:ir.actions.act_window,name:stock_request_kanban.wizard_stock_request_kanban_action #: model:ir.actions.act_window,name:stock_request_kanban.wizard_stock_request_order_kanban_action #: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_request_kanban_form msgid "Add Kanban" -msgstr "" +msgstr "Añadir Kanban" #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py:60 #, python-format msgid "Added kanban %s for product %s" -msgstr "" +msgstr "Se ha añadido el kanban %s para el product %s" #. module: stock_request_kanban #: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Archived" -msgstr "" +msgstr "Archivado" #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py:49 #, python-format msgid "Barcode %s does not correspond to any Kanban. Try with another barcode or press Close to finish scanning." msgstr "" +"El código de barras %s no corresponde a ningún Kanban. Prueba otro código de " +"barras o haz click en Cerrar para acabar de escanear." #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:23 #, python-format msgid "Barcode %s is on the order" -msgstr "" +msgstr "El código %s ya está en la petición" #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py:39 #, python-format msgid "CRC is not valid" -msgstr "" +msgstr "El CRC no es válido" #. module: stock_request_kanban #: model:ir.actions.act_window,help:stock_request_kanban.stock_request_kanban_action msgid "Click to add a Stock Request Kanban." -msgstr "" +msgstr "Haz click para añadir un Kanban." #. module: stock_request_kanban #: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_request_kanban_form msgid "Close" -msgstr "" +msgstr "Cerrar" #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:32 #, python-format msgid "Company must be the same" -msgstr "" +msgstr "La Compañía debe ser la misma" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_create_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_create_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_create_uid msgid "Created by" -msgstr "" +msgstr "Creado por" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_create_date #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_create_date #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_create_date msgid "Created on" -msgstr "" +msgstr "Creado el" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_display_name @@ -91,12 +95,12 @@ msgstr "" #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_display_name #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_display_name msgid "Display Name" -msgstr "" +msgstr "Nombre mostrado" #. module: stock_request_kanban #: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Group By" -msgstr "" +msgstr "Agrupar por" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_5473 @@ -104,7 +108,7 @@ msgstr "" #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_id msgid "ID" -msgstr "" +msgstr "ID" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id @@ -112,12 +116,12 @@ msgstr "" #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_kanban_id msgid "Kanban" -msgstr "" +msgstr "Kanban" #. module: stock_request_kanban #: model:ir.ui.menu,name:stock_request_kanban.stock_request_kanban_menu msgid "Kanban cards" -msgstr "" +msgstr "Tarjetas Kanban" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban___last_update @@ -125,78 +129,78 @@ msgstr "" #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract___last_update #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban___last_update msgid "Last Modified on" -msgstr "" +msgstr "Última modificación el" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_write_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_write_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_write_uid msgid "Last Updated by" -msgstr "" +msgstr "Actualizado por última vez por" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_write_date #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_write_date #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_write_date msgid "Last Updated on" -msgstr "" +msgstr "Actualizado por última vez el" #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:27 #, python-format msgid "Lines only can be added on orders with draft state" -msgstr "" +msgstr "Sólo se pueden añadir líneas en ordenes en estado borrador" #. module: stock_request_kanban #: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Location" -msgstr "" +msgstr "Localización" #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:40 #, python-format msgid "Location must be the same" -msgstr "" +msgstr "La localización debe coincidir" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_order_id msgid "Order" -msgstr "" +msgstr "Pedido" #. module: stock_request_kanban #: model:ir.actions.report,name:stock_request_kanban.action_report_kanban msgid "Print kanban" -msgstr "" +msgstr "Imprimir kanban" #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:38 #, python-format msgid "Procurement group must be the same" -msgstr "" +msgstr "El grupo de reestablecimiento debe coincidir" #. module: stock_request_kanban #: model:ir.ui.menu,name:stock_request_kanban.menu_wizard_stock_request_kanban msgid "Request from Kanban cards" -msgstr "" +msgstr "Solicitar desde tarjetas Kanban" #. module: stock_request_kanban #: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_order_form msgid "Scan" -msgstr "" +msgstr "Escanear" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_status #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_status #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_status msgid "Status" -msgstr "" +msgstr "Status" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_status_state #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_status_state #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_status_state msgid "Status State" -msgstr "" +msgstr "Estado del Status" #. module: stock_request_kanban #: model:ir.model,name:stock_request_kanban.model_stock_request @@ -204,52 +208,52 @@ msgstr "" #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_stock_request_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_stock_request_id msgid "Stock Request" -msgstr "" +msgstr "Solicitud de existencias" #. module: stock_request_kanban #: model:ir.model,name:stock_request_kanban.model_stock_request_kanban #: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_request_kanban_form msgid "Stock Request Kanban" -msgstr "" +msgstr "Kanban de Solicitud de Existencias" #. module: stock_request_kanban #: model:ir.actions.act_window,name:stock_request_kanban.stock_request_kanban_action msgid "Stock Request Kanbans" -msgstr "" +msgstr "Kanbans de Solicitud de Existencias" #. module: stock_request_kanban #: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_request_kanban_form #: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_request_kanban_tree msgid "Stock Requests" -msgstr "" +msgstr "Solicitudes de existencias" #. module: stock_request_kanban #: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Stock Requests Kanban" -msgstr "" +msgstr "Kanban de Solicitudes de Existencias" #. module: stock_request_kanban #: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Warehouse" -msgstr "" +msgstr "Almacén" #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:42 #, python-format msgid "Warehouse must be the same" -msgstr "" +msgstr "El almacén debe coincidir" #. module: stock_request_kanban #: model:ir.model,name:stock_request_kanban.model_wizard_stock_request_kanban msgid "wizard.stock.request.kanban" -msgstr "" +msgstr "wizard.stock.request.kanban" #. module: stock_request_kanban #: model:ir.model,name:stock_request_kanban.model_wizard_stock_request_kanban_abstract msgid "wizard.stock.request.kanban.abstract" -msgstr "" +msgstr "wizard.stock.request.kanban.abstract" #. module: stock_request_kanban #: model:ir.model,name:stock_request_kanban.model_wizard_stock_request_order_kanban msgid "wizard.stock.request.order.kanban" -msgstr "" +msgstr "wizard.stock.request.order.kanban" diff --git a/stock_request_kanban/i18n/stock_request_kanban.pot b/stock_request_kanban/i18n/stock_request_kanban.pot index cde403e94..ed4d03791 100644 --- a/stock_request_kanban/i18n/stock_request_kanban.pot +++ b/stock_request_kanban/i18n/stock_request_kanban.pot @@ -98,7 +98,7 @@ msgid "Group By" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_5473 +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_5550 #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_id From 4fad4e0c1fd2bf66aa640cac04a2041d05994240 Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Sun, 16 Sep 2018 10:48:40 +0200 Subject: [PATCH 05/18] [IMP] Kanban: Add Inventory managament --- stock_request_kanban/__manifest__.py | 4 +- stock_request_kanban/models/__init__.py | 1 + .../models/stock_inventory_kanban.py | 140 ++++++++++++++++++ .../models/stock_request_kanban.py | 24 ++- .../security/ir.model.access.csv | 2 + stock_request_kanban/tests/__init__.py | 1 + stock_request_kanban/tests/base_test.py | 16 ++ .../tests/test_inventory_kanban.py | 102 +++++++++++++ stock_request_kanban/tests/test_kanban.py | 22 ++- .../views/stock_inventory_kanban_views.xml | 95 ++++++++++++ .../views/stock_request_menu.xml | 6 + stock_request_kanban/wizard/__init__.py | 1 + .../wizard/wizard_stock_inventory_kanban.py | 37 +++++ .../wizard_stock_inventory_kanban_views.xml | 51 +++++++ .../wizard/wizard_stock_request_kanban.py | 34 ++++- .../wizard_stock_request_kanban_abstract.py | 49 +----- .../wizard_stock_request_order_kanban.py | 5 +- 17 files changed, 527 insertions(+), 63 deletions(-) create mode 100644 stock_request_kanban/models/stock_inventory_kanban.py create mode 100644 stock_request_kanban/tests/base_test.py create mode 100644 stock_request_kanban/tests/test_inventory_kanban.py create mode 100644 stock_request_kanban/views/stock_inventory_kanban_views.xml create mode 100644 stock_request_kanban/wizard/wizard_stock_inventory_kanban.py create mode 100644 stock_request_kanban/wizard/wizard_stock_inventory_kanban_views.xml diff --git a/stock_request_kanban/__manifest__.py b/stock_request_kanban/__manifest__.py index 0b37bf2c4..cd71167fd 100644 --- a/stock_request_kanban/__manifest__.py +++ b/stock_request_kanban/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'Stock Request kanban', - 'version': '11.0.1.0.0', + 'version': '11.0.1.0.1', 'category': 'Reporting', 'website': 'https://github.com/OCA/stock-logistics-warehouse', 'author': 'Creu Blanca, Eficent, Odoo Community Association (OCA)', @@ -16,10 +16,12 @@ 'data': [ 'data/stock_request_sequence_data.xml', 'report/report_paper_format.xml', + 'wizard/wizard_stock_inventory_kanban_views.xml', 'wizard/wizard_stock_request_kanban_views.xml', 'wizard/wizard_stock_request_order_kanban_views.xml', 'views/stock_request_order_views.xml', 'views/stock_request_kanban_views.xml', + 'views/stock_inventory_kanban_views.xml', 'views/stock_request_menu.xml', 'report/stock_request_kanban_templates.xml', 'security/ir.model.access.csv', diff --git a/stock_request_kanban/models/__init__.py b/stock_request_kanban/models/__init__.py index 66d035730..9fe62b7f5 100644 --- a/stock_request_kanban/models/__init__.py +++ b/stock_request_kanban/models/__init__.py @@ -3,3 +3,4 @@ from . import stock_request from . import stock_request_kanban +from . import stock_inventory_kanban diff --git a/stock_request_kanban/models/stock_inventory_kanban.py b/stock_request_kanban/models/stock_inventory_kanban.py new file mode 100644 index 000000000..e73a88b7d --- /dev/null +++ b/stock_request_kanban/models/stock_inventory_kanban.py @@ -0,0 +1,140 @@ +# Copyright 2018 Creu Blanca +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from odoo import api, models, fields + + +class StockInventoryKanban(models.Model): + _name = 'stock.inventory.kanban' + _description = 'Inventory for Kanban' + _inherit = ['mail.thread', 'mail.activity.mixin'] + + name = fields.Char( + readonly=True, states={'draft': [('readonly', False)]}, copy=False, + ) + state = fields.Selection( + [ + ('draft', 'Draft'), + ('in_progress', 'In progress'), + ('finished', 'Finished'), + ('closed', 'Closed'), + ('cancelled', 'Cancelled') + ], + required=True, default='draft', readonly=True, copy=False, + track_visibility='onchange' + ) + warehouse_ids = fields.Many2many( + 'stock.warehouse', string='Warehouse', + ondelete="cascade", + readonly=True, states={'draft': [('readonly', False)]}, + ) + location_ids = fields.Many2many( + 'stock.location', string='Location', + domain=[('usage', 'in', ['internal', 'transit'])], + ondelete="cascade", + readonly=True, states={'draft': [('readonly', False)]}, + ) + product_ids = fields.Many2many( + 'product.product', string='Product', + domain=[('type', 'in', ['product', 'consu'])], + ondelete='cascade', + readonly=True, states={'draft': [('readonly', False)]}, + ) + kanban_ids = fields.Many2many( + 'stock.request.kanban', + relation='stock_inventory_kanban_kanban', + readonly=True, copy=False, + ) + scanned_kanban_ids = fields.Many2many( + 'stock.request.kanban', + relation='stock_inventory_kanban_scanned_kanban', + readonly=True, copy=False, + ) + missing_kanban_ids = fields.Many2many( + 'stock.request.kanban', + readonly=True, + compute='_compute_missing_kanban' + ) + + @api.depends('kanban_ids', 'scanned_kanban_ids') + def _compute_missing_kanban(self): + for rec in self: + rec.missing_kanban_ids = rec.kanban_ids.filtered( + lambda r: r.id not in rec.scanned_kanban_ids.ids + ) + + def _get_inventory_kanban_domain(self): + domain = [] + if self.warehouse_ids: + domain.append(('warehouse_id', 'in', self.warehouse_ids.ids)) + if self.product_ids: + domain.append(('product_id', 'in', self.product_ids.ids)) + if self.location_ids: + domain.append(('location_id', 'in', self.location_ids.ids)) + return domain + + def _start_inventory_values(self): + return { + 'state': 'in_progress' + } + + def _finish_inventory_values(self): + return { + 'state': 'finished' + } + + def _close_inventory_values(self): + return { + 'state': 'closed' + } + + @api.multi + def calculate_kanbans(self): + for rec in self: + if rec.state == 'draft': + rec.kanban_ids = self.env['stock.request.kanban'].search( + rec._get_inventory_kanban_domain() + ) + + @api.multi + def start_inventory(self): + self.calculate_kanbans() + self.write(self._start_inventory_values()) + + @api.multi + def finish_inventory(self): + self.write(self._finish_inventory_values()) + + @api.multi + def close_inventory(self): + self.write(self._close_inventory_values()) + + @api.multi + def print_missing_kanbans(self): + """ Print the missing kanban cards in order to restore them + """ + self.ensure_one() + return self.env.ref( + 'stock_request_kanban.action_report_kanban').report_action( + self.missing_kanban_ids + ) + + def _cancel_inventory_values(self): + return { + 'state': 'cancelled', + } + + @api.multi + def cancel(self): + self.write(self._cancel_inventory_values()) + + def _to_draft_inventory_values(self): + return { + 'state': 'draft', + 'kanban_ids': [(5, 0)], + 'scanned_kanban_ids': [(5, 0)], + } + + @api.multi + def to_draft(self): + self.write(self._to_draft_inventory_values()) diff --git a/stock_request_kanban/models/stock_request_kanban.py b/stock_request_kanban/models/stock_request_kanban.py index b91378e2c..a1969f369 100644 --- a/stock_request_kanban/models/stock_request_kanban.py +++ b/stock_request_kanban/models/stock_request_kanban.py @@ -1,7 +1,9 @@ # Copyright 2018 Creu Blanca # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). -from odoo import api, models, fields +from odoo import api, models, fields, _ +from odoo.exceptions import ValidationError +from reportlab.graphics.barcode import getCodes class StockRequestKanban(models.Model): @@ -17,3 +19,23 @@ class StockRequestKanban(models.Model): vals['name'] = self.env['ir.sequence'].next_by_code( 'stock.request.kanban') return super().create(vals) + + @api.model + def get_barcode_format(self): + return 'Standard39' + + @api.model + def _recompute_barcode(self, barcode): + bcc = getCodes()[self.get_barcode_format()](value=barcode[:-1]) + bcc.validate() + bcc.encode() + if bcc.encoded[1:-1] != barcode: + raise ValidationError(_('CRC is not valid')) + return barcode[:-1] + + @api.model + def search_barcode(self, barcode): + recomputed_barcode = self._recompute_barcode(barcode) + return self.env['stock.request.kanban'].search([ + ('name', '=', recomputed_barcode) + ]) diff --git a/stock_request_kanban/security/ir.model.access.csv b/stock_request_kanban/security/ir.model.access.csv index 2b0a2da15..7692d87fe 100644 --- a/stock_request_kanban/security/ir.model.access.csv +++ b/stock_request_kanban/security/ir.model.access.csv @@ -1,3 +1,5 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_stock_request_kanban_user,stock request kanban user,model_stock_request_kanban,stock_request.group_stock_request_user,1,1,1, access_stock_request_kanban_manager,stock request kanban manager,model_stock_request_kanban,stock_request.group_stock_request_manager,1,1,1,1 +access_stock_inventory_kanban_user,stock inventory kanban user,model_stock_inventory_kanban,stock_request.group_stock_request_user,1,1,1, +access_stock_inventory_kanban_manager,stock inventory kanban manager,model_stock_inventory_kanban,stock_request.group_stock_request_manager,1,1,1,1 diff --git a/stock_request_kanban/tests/__init__.py b/stock_request_kanban/tests/__init__.py index 6370893a8..4a5ebd197 100644 --- a/stock_request_kanban/tests/__init__.py +++ b/stock_request_kanban/tests/__init__.py @@ -1 +1,2 @@ from . import test_kanban +from . import test_inventory_kanban diff --git a/stock_request_kanban/tests/base_test.py b/stock_request_kanban/tests/base_test.py new file mode 100644 index 000000000..ff529bde3 --- /dev/null +++ b/stock_request_kanban/tests/base_test.py @@ -0,0 +1,16 @@ +# Copyright 2017 Creu Blanca +# Copyright 2017 Eficent Business and IT Consulting Services, S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from odoo.tests.common import TransactionCase +from reportlab.graphics.barcode import getCodes + + +class TestBaseKanban(TransactionCase): + + def pass_code(self, wizard, code): + bcc = getCodes()[ + self.env['stock.request.kanban'].get_barcode_format()](value=code) + bcc.validate() + bcc.encode() + wizard.on_barcode_scanned(bcc.encoded[1:-1]) diff --git a/stock_request_kanban/tests/test_inventory_kanban.py b/stock_request_kanban/tests/test_inventory_kanban.py new file mode 100644 index 000000000..e5d41be2f --- /dev/null +++ b/stock_request_kanban/tests/test_inventory_kanban.py @@ -0,0 +1,102 @@ +# Copyright 2017 Creu Blanca +# Copyright 2017 Eficent Business and IT Consulting Services, S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from .base_test import TestBaseKanban + + +class TestKanban(TestBaseKanban): + def setUp(self): + super().setUp() + self.main_company = self.env.ref('base.main_company') + self.route = self.env['stock.location.route'].create({ + 'name': 'Transfer', + 'product_categ_selectable': False, + 'product_selectable': True, + 'company_id': self.main_company.id, + 'sequence': 10, + }) + self.product = self.env['product.product'].create({ + 'name': 'Product', + 'route_ids': [(4, self.route.id)], + 'company_id': False, + }) + self.product_2 = self.env['product.product'].create({ + 'name': 'Product 2', + 'route_ids': [(4, self.route.id)], + 'company_id': False, + }) + self.kanban_1 = self.env['stock.request.kanban'].create({ + 'product_id': self.product.id, + 'product_uom_id': self.product.uom_id.id, + 'product_uom_qty': 1, + }) + self.kanban_2 = self.env['stock.request.kanban'].create({ + 'product_id': self.product.id, + 'product_uom_id': self.product.uom_id.id, + 'product_uom_qty': 1, + }) + self.kanban_3 = self.env['stock.request.kanban'].create({ + 'product_id': self.product_2.id, + 'product_uom_id': self.product.uom_id.id, + 'product_uom_qty': 1, + }) + + def test_inventory_warehouse(self): + inventory = self.env['stock.inventory.kanban'].create({ + 'warehouse_ids': [(4, self.kanban_1.warehouse_id.id)], + }) + inventory.start_inventory() + self.assertIn(self.kanban_1, inventory.kanban_ids) + self.assertIn(self.kanban_1, inventory.missing_kanban_ids) + + def test_inventory_location(self): + inventory = self.env['stock.inventory.kanban'].create({ + 'location_ids': [(4, self.kanban_1.location_id.id)], + }) + inventory.start_inventory() + self.assertIn(self.kanban_1, inventory.kanban_ids) + self.assertIn(self.kanban_1, inventory.missing_kanban_ids) + + def test_inventory_product(self): + inventory = self.env['stock.inventory.kanban'].create({ + 'product_ids': [(4, self.product.id)], + }) + inventory.start_inventory() + self.assertIn(self.kanban_1, inventory.kanban_ids) + self.assertNotIn(self.kanban_3, inventory.kanban_ids) + self.assertIn(self.kanban_1, inventory.missing_kanban_ids) + self.assertEqual(inventory.state, 'in_progress') + wizard = self.env['wizard.stock.inventory.kanban'].with_context( + default_inventory_kanban_id=inventory.id + ).create({}) + self.pass_code(wizard, self.kanban_3.name) + self.assertEqual(wizard.status_state, 1) + self.pass_code(wizard, self.kanban_1.name) + self.assertEqual(wizard.status_state, 0) + self.assertNotIn(self.kanban_1, inventory.missing_kanban_ids) + self.assertIn(self.kanban_1, inventory.scanned_kanban_ids) + self.pass_code(wizard, self.kanban_1.name) + self.assertEqual(wizard.status_state, 1) + self.assertNotIn(self.kanban_1, inventory.missing_kanban_ids) + self.assertIn(self.kanban_1, inventory.scanned_kanban_ids) + inventory.finish_inventory() + self.assertEqual(inventory.state, 'finished') + inventory.close_inventory() + self.assertEqual(inventory.state, 'closed') + + def test_cancel_inventory(self): + inventory = self.env['stock.inventory.kanban'].create({ + 'product_ids': [(4, self.product.id)], + }) + inventory.start_inventory() + self.assertIn(self.kanban_1, inventory.kanban_ids) + self.assertNotIn(self.kanban_3, inventory.kanban_ids) + self.assertIn(self.kanban_1, inventory.missing_kanban_ids) + self.assertEqual(inventory.state, 'in_progress') + inventory.cancel() + self.assertEqual(inventory.state, 'cancelled') + inventory.to_draft() + self.assertEqual(inventory.state, 'draft') + self.assertFalse(inventory.kanban_ids) + self.assertFalse(inventory.scanned_kanban_ids) diff --git a/stock_request_kanban/tests/test_kanban.py b/stock_request_kanban/tests/test_kanban.py index 38f8b2df6..3977788b2 100644 --- a/stock_request_kanban/tests/test_kanban.py +++ b/stock_request_kanban/tests/test_kanban.py @@ -2,12 +2,11 @@ # Copyright 2017 Eficent Business and IT Consulting Services, S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). -from odoo.tests.common import TransactionCase from odoo.exceptions import ValidationError -from reportlab.graphics.barcode import getCodes +from .base_test import TestBaseKanban -class TestKanban(TransactionCase): +class TestKanban(TestBaseKanban): def setUp(self): super().setUp() @@ -21,6 +20,11 @@ class TestKanban(TransactionCase): }) self.wh2 = self.env['stock.warehouse'].search( [('company_id', '=', self.company_2.id)], limit=1) + self.wh3 = self.env['stock.warehouse'].create({ + 'name': 'Warehouse TEst', + 'code': 'WH-TEST', + 'company_id': self.main_company.id, + }) self.ressuply_loc = self.env['stock.location'].create({ 'name': 'Ressuply', @@ -97,9 +101,9 @@ class TestKanban(TransactionCase): 'product_id': self.product.id, 'product_uom_id': self.product.uom_id.id, 'product_uom_qty': 1, - 'company_id': self.company_2.id, - 'warehouse_id': self.wh2.id, - 'location_id': self.wh2.lot_stock_id.id, + 'company_id': self.main_company.id, + 'warehouse_id': self.wh3.id, + 'location_id': self.wh3.lot_stock_id.id, }) order = self.env['stock.request.order'].create({ 'company_id': self.main_company.id, @@ -158,9 +162,3 @@ class TestKanban(TransactionCase): self.assertTrue(self.env['stock.request'].search( [('kanban_id', '=', kanban_2.id)]) ) - - def pass_code(self, wizard, code): - bcc = getCodes()[wizard.get_barcode_format()](value=code) - bcc.validate() - bcc.encode() - wizard.on_barcode_scanned(bcc.encoded[1:-1]) diff --git a/stock_request_kanban/views/stock_inventory_kanban_views.xml b/stock_request_kanban/views/stock_inventory_kanban_views.xml new file mode 100644 index 000000000..850e5bee4 --- /dev/null +++ b/stock_request_kanban/views/stock_inventory_kanban_views.xml @@ -0,0 +1,95 @@ + + + + + stock.inventory.kanban.tree + stock.inventory.kanban + + + + + + + + + stock.inventory.kanban.form + stock.inventory.kanban + +
+
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+ + + Stock Inventory Kanbans + stock.inventory.kanban + ir.actions.act_window + form + tree,form + +

+ Click to add a Stock Inventory Kanban. +

+
+
+ +
diff --git a/stock_request_kanban/views/stock_request_menu.xml b/stock_request_kanban/views/stock_request_menu.xml index c54ef5599..6b89f0e93 100644 --- a/stock_request_kanban/views/stock_request_menu.xml +++ b/stock_request_kanban/views/stock_request_menu.xml @@ -13,4 +13,10 @@ parent="stock_request.menu_stock_request_operations" action="wizard_stock_request_kanban_action" sequence="40"/> + + diff --git a/stock_request_kanban/wizard/__init__.py b/stock_request_kanban/wizard/__init__.py index 1fe7798c3..c260008bf 100644 --- a/stock_request_kanban/wizard/__init__.py +++ b/stock_request_kanban/wizard/__init__.py @@ -4,3 +4,4 @@ from . import wizard_stock_request_kanban_abstract from . import wizard_stock_request_kanban from . import wizard_stock_request_order_kanban +from . import wizard_stock_inventory_kanban diff --git a/stock_request_kanban/wizard/wizard_stock_inventory_kanban.py b/stock_request_kanban/wizard/wizard_stock_inventory_kanban.py new file mode 100644 index 000000000..9cbfda980 --- /dev/null +++ b/stock_request_kanban/wizard/wizard_stock_inventory_kanban.py @@ -0,0 +1,37 @@ +# Copyright 2017 Creu Blanca +# Copyright 2017 Eficent Business and IT Consulting Services, S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from odoo import fields, models, _ + + +class WizardStockRequestOrderKanbanAbstract(models.TransientModel): + _name = "wizard.stock.inventory.kanban" + _inherit = "wizard.stock.request.kanban.abstract" + + inventory_kanban_id = fields.Many2one( + 'stock.inventory.kanban', + readonly=True, + ) + + def barcode_ending(self): + super().barcode_ending() + self.inventory_kanban_id.write({ + 'scanned_kanban_ids': [(4, self.kanban_id.id)] + }) + + def validate_kanban(self, barcode): + res = super().validate_kanban(barcode) + if not self.inventory_kanban_id.kanban_ids.filtered( + lambda r: r == self.kanban_id + ): + self.status = _("Barcode %s is not in the inventory") % barcode + self.status_state = 1 + return False + if self.inventory_kanban_id.scanned_kanban_ids.filtered( + lambda r: r == self.kanban_id + ): + self.status = _("Barcode %s is already scanned") % barcode + self.status_state = 1 + return False + return res diff --git a/stock_request_kanban/wizard/wizard_stock_inventory_kanban_views.xml b/stock_request_kanban/wizard/wizard_stock_inventory_kanban_views.xml new file mode 100644 index 000000000..bcf7c28ae --- /dev/null +++ b/stock_request_kanban/wizard/wizard_stock_inventory_kanban_views.xml @@ -0,0 +1,51 @@ + + + + + + + + wizard.stock.inventory.kanban.form + wizard.stock.inventory.kanban + +
+ + + + + + +
+
+ +
+
+ + + +
diff --git a/stock_request_kanban/wizard/wizard_stock_request_kanban.py b/stock_request_kanban/wizard/wizard_stock_request_kanban.py index 7ea0c22c6..38c7d63d0 100644 --- a/stock_request_kanban/wizard/wizard_stock_request_kanban.py +++ b/stock_request_kanban/wizard/wizard_stock_request_kanban.py @@ -2,13 +2,43 @@ # Copyright 2017 Eficent Business and IT Consulting Services, S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). -from odoo import models +from odoo import fields, models, _ class WizardStockRequestOrderKanbanAbstract(models.TransientModel): _name = "wizard.stock.request.kanban" _inherit = "wizard.stock.request.kanban.abstract" + stock_request_id = fields.Many2one( + 'stock.request', + readonly=True, + ) + def barcode_ending(self): + super().barcode_ending() + self.stock_request_id = self.env['stock.request'].create( + self.stock_request_kanban_values() + ) + self.status_state = 0 + self.status = _('Added kanban %s for product %s' % ( + self.stock_request_id.kanban_id.name, + self.stock_request_id.product_id.display_name + )) + self.stock_request_ending() + + def stock_request_ending(self): self.stock_request_id.action_confirm() - return + + def stock_request_kanban_values(self): + return { + 'company_id': self.kanban_id.company_id.id, + 'procurement_group_id': + self.kanban_id.procurement_group_id.id or False, + 'location_id': self.kanban_id.location_id.id or False, + 'warehouse_id': self.kanban_id.warehouse_id.id or False, + 'product_id': self.kanban_id.product_id.id, + 'product_uom_id': self.kanban_id.product_uom_id.id or False, + 'route_id': self.kanban_id.route_id.id or False, + 'product_uom_qty': self.kanban_id.product_uom_qty, + 'kanban_id': self.kanban_id.id, + } diff --git a/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py b/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py index 56c9352ef..577b87a21 100644 --- a/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py +++ b/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py @@ -3,8 +3,6 @@ # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from odoo import fields, models, _ -from odoo.exceptions import ValidationError -from reportlab.graphics.barcode import getCodes class WizardStockRequestOrderKanbanAbstract(models.AbstractModel): @@ -15,10 +13,6 @@ class WizardStockRequestOrderKanbanAbstract(models.AbstractModel): 'stock.request.kanban', readonly=True, ) - stock_request_id = fields.Many2one( - 'stock.request', - readonly=True, - ) status = fields.Text( readonly=True, default="Start scanning", @@ -28,23 +22,9 @@ class WizardStockRequestOrderKanbanAbstract(models.AbstractModel): readonly=True, ) - def get_barcode_format(self): - return 'Standard39' - - def validate_barcode(self, barcode): - bcc = getCodes()[self.get_barcode_format()](value=barcode[:-1]) - bcc.validate() - bcc.encode() - if bcc.encoded[1:-1] != barcode: - raise ValidationError(_('CRC is not valid')) - return barcode[:-1] - def on_barcode_scanned(self, barcode): - barcode = self.validate_barcode(barcode) - - self.kanban_id = self.env['stock.request.kanban'].search([ - ('name', '=', barcode) - ]) + self.kanban_id = self.env['stock.request.kanban'].search_barcode( + barcode) if not self.kanban_id: self.status = _("Barcode %s does not correspond to any " "Kanban. Try with another barcode or " @@ -52,20 +32,11 @@ class WizardStockRequestOrderKanbanAbstract(models.AbstractModel): self.status_state = 1 return if self.validate_kanban(barcode): - self.stock_request_id = self.env['stock.request'].create( - self.stock_request_kanban_values() - ) self.status_state = 0 - - self.status = _('Added kanban %s for product %s' % ( - self.stock_request_id.kanban_id.name, - self.stock_request_id.product_id.display_name - )) self.barcode_ending() - return def barcode_ending(self): - return + pass def validate_kanban(self, barcode): ''' @@ -74,17 +45,3 @@ class WizardStockRequestOrderKanbanAbstract(models.AbstractModel): :return: ''' return True - - def stock_request_kanban_values(self): - return { - 'company_id': self.kanban_id.company_id.id, - 'procurement_group_id': - self.kanban_id.procurement_group_id.id or False, - 'location_id': self.kanban_id.location_id.id or False, - 'warehouse_id': self.kanban_id.warehouse_id.id or False, - 'product_id': self.kanban_id.product_id.id, - 'product_uom_id': self.kanban_id.product_uom_id.id or False, - 'route_id': self.kanban_id.route_id.id or False, - 'product_uom_qty': self.kanban_id.product_uom_qty, - 'kanban_id': self.kanban_id.id, - } diff --git a/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py b/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py index 392c97b9a..0c0416d17 100644 --- a/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py +++ b/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py @@ -8,7 +8,7 @@ from odoo.exceptions import ValidationError class WizardStockRequestOrderKanban(models.TransientModel): _name = "wizard.stock.request.order.kanban" - _inherit = "wizard.stock.request.kanban.abstract" + _inherit = "wizard.stock.request.kanban" order_id = fields.Many2one( 'stock.request.order', @@ -48,6 +48,9 @@ class WizardStockRequestOrderKanban(models.TransientModel): res['expected_date'] = self.order_id.expected_date, return res + def stock_request_ending(self): + return + def barcode_ending(self): super().barcode_ending() self.order_id = self.stock_request_id.order_id From 96d7854e2363c327c3d56cd1c1e9eb45b9dcf474 Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Tue, 2 Oct 2018 17:48:59 +0200 Subject: [PATCH 06/18] Fixes --- .../data/stock_request_sequence_data.xml | 8 + .../i18n/stock_request_kanban.pot | 172 +++++++++++++++++- .../models/stock_inventory_kanban.py | 29 ++- .../views/stock_inventory_kanban_views.xml | 2 + 4 files changed, 203 insertions(+), 8 deletions(-) diff --git a/stock_request_kanban/data/stock_request_sequence_data.xml b/stock_request_kanban/data/stock_request_sequence_data.xml index 33931ab67..d3ead8e74 100644 --- a/stock_request_kanban/data/stock_request_sequence_data.xml +++ b/stock_request_kanban/data/stock_request_sequence_data.xml @@ -10,5 +10,13 @@ + + Stock Inventory Kanban + stock.inventory.kanban + IKB + 5 + + + diff --git a/stock_request_kanban/i18n/stock_request_kanban.pot b/stock_request_kanban/i18n/stock_request_kanban.pot index ed4d03791..2c07d7cb3 100644 --- a/stock_request_kanban/i18n/stock_request_kanban.pot +++ b/stock_request_kanban/i18n/stock_request_kanban.pot @@ -19,14 +19,16 @@ msgid "Active" msgstr "" #. module: stock_request_kanban +#: model:ir.actions.act_window,name:stock_request_kanban.wizard_stock_inventory_kanban_action #: model:ir.actions.act_window,name:stock_request_kanban.wizard_stock_request_kanban_action #: model:ir.actions.act_window,name:stock_request_kanban.wizard_stock_request_order_kanban_action +#: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_inventory_kanban_form #: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_request_kanban_form msgid "Add Kanban" msgstr "" #. module: stock_request_kanban -#: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py:60 +#: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban.py:23 #, python-format msgid "Added kanban %s for product %s" msgstr "" @@ -37,11 +39,23 @@ msgid "Archived" msgstr "" #. module: stock_request_kanban -#: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py:49 +#: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py:29 #, python-format msgid "Barcode %s does not correspond to any Kanban. Try with another barcode or press Close to finish scanning." msgstr "" +#. module: stock_request_kanban +#: code:addons/stock_request_kanban/wizard/wizard_stock_inventory_kanban.py:34 +#, python-format +msgid "Barcode %s is already scanned" +msgstr "" + +#. module: stock_request_kanban +#: code:addons/stock_request_kanban/wizard/wizard_stock_inventory_kanban.py:28 +#, python-format +msgid "Barcode %s is not in the inventory" +msgstr "" + #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:23 #, python-format @@ -49,21 +63,43 @@ msgid "Barcode %s is on the order" msgstr "" #. module: stock_request_kanban -#: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py:39 +#: code:addons/stock_request_kanban/models/stock_request_kanban.py:33 #, python-format msgid "CRC is not valid" msgstr "" +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +msgid "Cancel" +msgstr "" + +#. module: stock_request_kanban +#: selection:stock.inventory.kanban,state:0 +msgid "Cancelled" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.actions.act_window,help:stock_request_kanban.stock_inventory_kanban_action +msgid "Click to add a Stock Inventory Kanban." +msgstr "" + #. module: stock_request_kanban #: model:ir.actions.act_window,help:stock_request_kanban.stock_request_kanban_action msgid "Click to add a Stock Request Kanban." msgstr "" #. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_inventory_kanban_form #: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_request_kanban_form msgid "Close" msgstr "" +#. module: stock_request_kanban +#: selection:stock.inventory.kanban,state:0 +msgid "Closed" +msgstr "" + #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:32 #, python-format @@ -71,34 +107,57 @@ msgid "Company must be the same" msgstr "" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_create_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_create_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_create_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_create_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_create_uid msgid "Created by" msgstr "" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_create_date #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_create_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_create_date #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_create_date #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_create_date msgid "Created on" msgstr "" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_display_name #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_display_name +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_display_name #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_display_name #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_display_name #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_display_name msgid "Display Name" msgstr "" +#. module: stock_request_kanban +#: selection:stock.inventory.kanban,state:0 +msgid "Draft" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +msgid "Finish" +msgstr "" + +#. module: stock_request_kanban +#: selection:stock.inventory.kanban,state:0 +msgid "Finished" +msgstr "" + #. module: stock_request_kanban #: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Group By" msgstr "" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_5550 +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_id @@ -106,10 +165,34 @@ msgid "ID" msgstr "" #. module: stock_request_kanban +#: selection:stock.inventory.kanban,state:0 +msgid "In progress" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.menu,name:stock_request_kanban.menu_wizard_stock_inventory_kanban +msgid "Inventory" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_inventory_kanban_id +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +msgid "Inventory Kanban" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model,name:stock_request_kanban.model_stock_inventory_kanban +msgid "Inventory for Kanban" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_kanban_ids #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_kanban_id +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form msgid "Kanban" msgstr "" @@ -119,7 +202,9 @@ msgid "Kanban cards" msgstr "" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban___last_update #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban___last_update +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban___last_update #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban___last_update #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract___last_update #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban___last_update @@ -127,14 +212,18 @@ msgid "Last Modified on" msgstr "" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_write_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_write_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_write_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_write_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_write_uid msgid "Last Updated by" msgstr "" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_write_date #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_write_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_write_date #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_write_date #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_write_date msgid "Last Updated on" @@ -147,6 +236,7 @@ msgid "Lines only can be added on orders with draft state" msgstr "" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_location_ids #: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Location" msgstr "" @@ -157,6 +247,26 @@ msgstr "" msgid "Location must be the same" msgstr "" +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +msgid "Missing" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_missing_kanban_ids +msgid "Missing Kanban" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_count_missing_kanbans +msgid "Missing Kanbans" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_name +msgid "Name" +msgstr "" + #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_order_id msgid "Order" @@ -167,12 +277,22 @@ msgstr "" msgid "Print kanban" msgstr "" +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +msgid "Print missing" +msgstr "" + #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:38 #, python-format msgid "Procurement group must be the same" msgstr "" +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_product_ids +msgid "Products" +msgstr "" + #. module: stock_request_kanban #: model:ir.ui.menu,name:stock_request_kanban.menu_wizard_stock_request_kanban msgid "Request from Kanban cards" @@ -180,10 +300,37 @@ msgstr "" #. module: stock_request_kanban #: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_order_form +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form msgid "Scan" msgstr "" #. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +msgid "Scanned" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_scanned_kanban_ids +msgid "Scanned Kanban" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +msgid "Set to draft" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +msgid "Start" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_state +msgid "State" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_status #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_status #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_status #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_status @@ -191,15 +338,26 @@ msgid "Status" msgstr "" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_status_state #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_status_state #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_status_state #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_status_state msgid "Status State" msgstr "" +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_tree +msgid "Stock Inventories" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.actions.act_window,name:stock_request_kanban.stock_inventory_kanban_action +msgid "Stock Inventory Kanbans" +msgstr "" + #. module: stock_request_kanban #: model:ir.model,name:stock_request_kanban.model_stock_request -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_stock_request_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_stock_request_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_stock_request_id msgid "Stock Request" @@ -228,6 +386,7 @@ msgid "Stock Requests Kanban" msgstr "" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_warehouse_ids #: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Warehouse" msgstr "" @@ -238,6 +397,11 @@ msgstr "" msgid "Warehouse must be the same" msgstr "" +#. module: stock_request_kanban +#: model:ir.model,name:stock_request_kanban.model_wizard_stock_inventory_kanban +msgid "wizard.stock.inventory.kanban" +msgstr "" + #. module: stock_request_kanban #: model:ir.model,name:stock_request_kanban.model_wizard_stock_request_kanban msgid "wizard.stock.request.kanban" diff --git a/stock_request_kanban/models/stock_inventory_kanban.py b/stock_request_kanban/models/stock_inventory_kanban.py index e73a88b7d..3652af740 100644 --- a/stock_request_kanban/models/stock_inventory_kanban.py +++ b/stock_request_kanban/models/stock_inventory_kanban.py @@ -2,6 +2,7 @@ # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). from odoo import api, models, fields +from odoo.osv import expression class StockInventoryKanban(models.Model): @@ -35,7 +36,7 @@ class StockInventoryKanban(models.Model): readonly=True, states={'draft': [('readonly', False)]}, ) product_ids = fields.Many2many( - 'product.product', string='Product', + 'product.product', string='Products', domain=[('type', 'in', ['product', 'consu'])], ondelete='cascade', readonly=True, states={'draft': [('readonly', False)]}, @@ -56,21 +57,34 @@ class StockInventoryKanban(models.Model): compute='_compute_missing_kanban' ) + count_missing_kanbans = fields.Integer( + 'Missing Kanbans', + readonly=True, + compute='_compute_missing_kanban', + ) + @api.depends('kanban_ids', 'scanned_kanban_ids') def _compute_missing_kanban(self): for rec in self: rec.missing_kanban_ids = rec.kanban_ids.filtered( lambda r: r.id not in rec.scanned_kanban_ids.ids ) + rec.count_missing_kanbans = len(rec.missing_kanban_ids) def _get_inventory_kanban_domain(self): domain = [] if self.warehouse_ids: - domain.append(('warehouse_id', 'in', self.warehouse_ids.ids)) + expression.AND(( + domain, [('warehouse_id', 'in', self.warehouse_ids.ids)] + )) if self.product_ids: - domain.append(('product_id', 'in', self.product_ids.ids)) + expression.AND(( + domain, [('product_id', 'in', self.product_ids.ids)] + )) if self.location_ids: - domain.append(('location_id', 'in', self.location_ids.ids)) + expression.AND(( + domain, [('location_id', 'in', self.location_ids.ids)] + )) return domain def _start_inventory_values(self): @@ -88,6 +102,13 @@ class StockInventoryKanban(models.Model): 'state': 'closed' } + @api.model + def create(self, vals): + if vals.get('name', '/') == '/': + vals['name'] = self.env['ir.sequence'].next_by_code( + 'stock.inventory.kanban') + return super().create(vals) + @api.multi def calculate_kanbans(self): for rec in self: diff --git a/stock_request_kanban/views/stock_inventory_kanban_views.xml b/stock_request_kanban/views/stock_inventory_kanban_views.xml index 850e5bee4..879134b44 100644 --- a/stock_request_kanban/views/stock_inventory_kanban_views.xml +++ b/stock_request_kanban/views/stock_inventory_kanban_views.xml @@ -7,6 +7,8 @@ + + From 10c8d0791e880a44509340fca75446d84279afe3 Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Tue, 30 Oct 2018 10:40:44 +0100 Subject: [PATCH 07/18] [stock_request_kanban][FIX] _get_inventory_kanban_domain --- stock_request_kanban/i18n/stock_request_kanban.pot | 2 +- stock_request_kanban/models/stock_inventory_kanban.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stock_request_kanban/i18n/stock_request_kanban.pot b/stock_request_kanban/i18n/stock_request_kanban.pot index 2c07d7cb3..53b231909 100644 --- a/stock_request_kanban/i18n/stock_request_kanban.pot +++ b/stock_request_kanban/i18n/stock_request_kanban.pot @@ -156,7 +156,7 @@ msgstr "" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_id -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_5550 +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_5579 #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_id diff --git a/stock_request_kanban/models/stock_inventory_kanban.py b/stock_request_kanban/models/stock_inventory_kanban.py index 3652af740..36b8ccb8e 100644 --- a/stock_request_kanban/models/stock_inventory_kanban.py +++ b/stock_request_kanban/models/stock_inventory_kanban.py @@ -74,15 +74,15 @@ class StockInventoryKanban(models.Model): def _get_inventory_kanban_domain(self): domain = [] if self.warehouse_ids: - expression.AND(( + domain = expression.AND(( domain, [('warehouse_id', 'in', self.warehouse_ids.ids)] )) if self.product_ids: - expression.AND(( + domain = expression.AND(( domain, [('product_id', 'in', self.product_ids.ids)] )) if self.location_ids: - expression.AND(( + domain = expression.AND(( domain, [('location_id', 'in', self.location_ids.ids)] )) return domain From 8e1bc8cd7a3f59ad37313ea8e71b467d2a621d9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Gil=20Sorribes?= Date: Wed, 28 Nov 2018 16:58:57 +0100 Subject: [PATCH 08/18] [11.0][FIX] Fix for stock_request_kanban fixup! --- stock_request_kanban/i18n/es.po | 189 +++++++++++++++++- .../i18n/stock_request_kanban.pot | 2 +- .../report/stock_request_kanban_templates.xml | 89 +++++---- 3 files changed, 235 insertions(+), 45 deletions(-) diff --git a/stock_request_kanban/i18n/es.po b/stock_request_kanban/i18n/es.po index 7020741c7..ceb8fbf34 100644 --- a/stock_request_kanban/i18n/es.po +++ b/stock_request_kanban/i18n/es.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * stock_request_kanban +# * stock_request_kanban # msgid "" msgstr "" @@ -22,14 +22,16 @@ msgid "Active" msgstr "Activo" #. module: stock_request_kanban +#: model:ir.actions.act_window,name:stock_request_kanban.wizard_stock_inventory_kanban_action #: model:ir.actions.act_window,name:stock_request_kanban.wizard_stock_request_kanban_action #: model:ir.actions.act_window,name:stock_request_kanban.wizard_stock_request_order_kanban_action +#: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_inventory_kanban_form #: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_request_kanban_form msgid "Add Kanban" msgstr "Añadir Kanban" #. module: stock_request_kanban -#: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py:60 +#: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban.py:23 #, python-format msgid "Added kanban %s for product %s" msgstr "Se ha añadido el kanban %s para el product %s" @@ -40,13 +42,27 @@ msgid "Archived" msgstr "Archivado" #. module: stock_request_kanban -#: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py:49 +#: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py:29 #, python-format -msgid "Barcode %s does not correspond to any Kanban. Try with another barcode or press Close to finish scanning." +msgid "" +"Barcode %s does not correspond to any Kanban. Try with another barcode or " +"press Close to finish scanning." msgstr "" "El código de barras %s no corresponde a ningún Kanban. Prueba otro código de " "barras o haz click en Cerrar para acabar de escanear." +#. module: stock_request_kanban +#: code:addons/stock_request_kanban/wizard/wizard_stock_inventory_kanban.py:34 +#, fuzzy, python-format +msgid "Barcode %s is already scanned" +msgstr "El código %s ya está en la petición" + +#. module: stock_request_kanban +#: code:addons/stock_request_kanban/wizard/wizard_stock_inventory_kanban.py:28 +#, fuzzy, python-format +msgid "Barcode %s is not in the inventory" +msgstr "El código %s ya está en la petición" + #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:23 #, python-format @@ -54,21 +70,45 @@ msgid "Barcode %s is on the order" msgstr "El código %s ya está en la petición" #. module: stock_request_kanban -#: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py:39 +#: code:addons/stock_request_kanban/models/stock_request_kanban.py:33 #, python-format msgid "CRC is not valid" msgstr "El CRC no es válido" +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +msgid "Cancel" +msgstr "" + +#. module: stock_request_kanban +#: selection:stock.inventory.kanban,state:0 +msgid "Cancelled" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.actions.act_window,help:stock_request_kanban.stock_inventory_kanban_action +#, fuzzy +msgid "Click to add a Stock Inventory Kanban." +msgstr "Haz click para añadir un Kanban." + #. module: stock_request_kanban #: model:ir.actions.act_window,help:stock_request_kanban.stock_request_kanban_action msgid "Click to add a Stock Request Kanban." msgstr "Haz click para añadir un Kanban." #. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_inventory_kanban_form #: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_request_kanban_form msgid "Close" msgstr "Cerrar" +#. module: stock_request_kanban +#: selection:stock.inventory.kanban,state:0 +#, fuzzy +msgid "Closed" +msgstr "Cerrar" + #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:32 #, python-format @@ -76,34 +116,57 @@ msgid "Company must be the same" msgstr "La Compañía debe ser la misma" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_create_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_create_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_create_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_create_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_create_uid msgid "Created by" msgstr "Creado por" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_create_date #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_create_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_create_date #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_create_date #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_create_date msgid "Created on" msgstr "Creado el" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_display_name #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_display_name +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_display_name #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_display_name #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_display_name #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_display_name msgid "Display Name" msgstr "Nombre mostrado" +#. module: stock_request_kanban +#: selection:stock.inventory.kanban,state:0 +msgid "Draft" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +msgid "Finish" +msgstr "" + +#. module: stock_request_kanban +#: selection:stock.inventory.kanban,state:0 +msgid "Finished" +msgstr "" + #. module: stock_request_kanban #: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Group By" msgstr "Agrupar por" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_5473 +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_6240 +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_id @@ -111,10 +174,34 @@ msgid "ID" msgstr "ID" #. module: stock_request_kanban +#: selection:stock.inventory.kanban,state:0 +msgid "In progress" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.menu,name:stock_request_kanban.menu_wizard_stock_inventory_kanban +msgid "Inventory" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_inventory_kanban_id +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +msgid "Inventory Kanban" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model,name:stock_request_kanban.model_stock_inventory_kanban +msgid "Inventory for Kanban" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_kanban_ids #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_kanban_id +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form msgid "Kanban" msgstr "Kanban" @@ -124,7 +211,9 @@ msgid "Kanban cards" msgstr "Tarjetas Kanban" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban___last_update #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban___last_update +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban___last_update #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban___last_update #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract___last_update #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban___last_update @@ -132,14 +221,18 @@ msgid "Last Modified on" msgstr "Última modificación el" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_write_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_write_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_write_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_write_uid #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_write_uid msgid "Last Updated by" msgstr "Actualizado por última vez por" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_write_date #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_write_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_write_date #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_write_date #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_write_date msgid "Last Updated on" @@ -152,6 +245,7 @@ msgid "Lines only can be added on orders with draft state" msgstr "Sólo se pueden añadir líneas en ordenes en estado borrador" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_location_ids #: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Location" msgstr "Localización" @@ -162,6 +256,27 @@ msgstr "Localización" msgid "Location must be the same" msgstr "La localización debe coincidir" +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +msgid "Missing" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_missing_kanban_ids +#, fuzzy +msgid "Missing Kanban" +msgstr "Imprimir kanban" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_count_missing_kanbans +msgid "Missing Kanbans" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_name +msgid "Name" +msgstr "" + #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_order_id msgid "Order" @@ -172,12 +287,22 @@ msgstr "Pedido" msgid "Print kanban" msgstr "Imprimir kanban" +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +msgid "Print missing" +msgstr "" + #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:38 #, python-format msgid "Procurement group must be the same" msgstr "El grupo de reestablecimiento debe coincidir" +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_product_ids +msgid "Products" +msgstr "" + #. module: stock_request_kanban #: model:ir.ui.menu,name:stock_request_kanban.menu_wizard_stock_request_kanban msgid "Request from Kanban cards" @@ -185,10 +310,40 @@ msgstr "Solicitar desde tarjetas Kanban" #. module: stock_request_kanban #: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_order_form +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form msgid "Scan" msgstr "Escanear" #. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#, fuzzy +msgid "Scanned" +msgstr "Escanear" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_scanned_kanban_ids +#, fuzzy +msgid "Scanned Kanban" +msgstr "Añadir Kanban" + +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +msgid "Set to draft" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +msgid "Start" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_state +#, fuzzy +msgid "State" +msgstr "Status" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_status #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_status #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_status #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_status @@ -196,15 +351,28 @@ msgid "Status" msgstr "Status" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_status_state #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_status_state #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_status_state #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_status_state msgid "Status State" msgstr "Estado del Status" +#. module: stock_request_kanban +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_tree +#, fuzzy +msgid "Stock Inventories" +msgstr "Solicitud de existencias" + +#. module: stock_request_kanban +#: model:ir.actions.act_window,name:stock_request_kanban.stock_inventory_kanban_action +#, fuzzy +msgid "Stock Inventory Kanbans" +msgstr "Kanbans de Solicitud de Existencias" + #. module: stock_request_kanban #: model:ir.model,name:stock_request_kanban.model_stock_request -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_stock_request_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_stock_request_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_stock_request_id msgid "Stock Request" @@ -233,6 +401,7 @@ msgid "Stock Requests Kanban" msgstr "Kanban de Solicitudes de Existencias" #. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_warehouse_ids #: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Warehouse" msgstr "Almacén" @@ -243,6 +412,12 @@ msgstr "Almacén" msgid "Warehouse must be the same" msgstr "El almacén debe coincidir" +#. module: stock_request_kanban +#: model:ir.model,name:stock_request_kanban.model_wizard_stock_inventory_kanban +#, fuzzy +msgid "wizard.stock.inventory.kanban" +msgstr "wizard.stock.request.kanban" + #. module: stock_request_kanban #: model:ir.model,name:stock_request_kanban.model_wizard_stock_request_kanban msgid "wizard.stock.request.kanban" diff --git a/stock_request_kanban/i18n/stock_request_kanban.pot b/stock_request_kanban/i18n/stock_request_kanban.pot index 53b231909..31f0b6a6a 100644 --- a/stock_request_kanban/i18n/stock_request_kanban.pot +++ b/stock_request_kanban/i18n/stock_request_kanban.pot @@ -156,7 +156,7 @@ msgstr "" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_id -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_5579 +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_6240 #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_id diff --git a/stock_request_kanban/report/stock_request_kanban_templates.xml b/stock_request_kanban/report/stock_request_kanban_templates.xml index 2bcff8ff6..e85e66bbb 100644 --- a/stock_request_kanban/report/stock_request_kanban_templates.xml +++ b/stock_request_kanban/report/stock_request_kanban_templates.xml @@ -3,50 +3,65 @@ License LGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> From 9f5128741d58385470b9877a2f152f924d34060b Mon Sep 17 00:00:00 2001 From: Enric Tobella Date: Fri, 26 Apr 2019 09:44:16 +0200 Subject: [PATCH 09/18] [IMP] Stock_request_kanban: Set barcode configuration on parameters --- stock_request_kanban/README.rst | 94 +++- stock_request_kanban/__manifest__.py | 2 +- stock_request_kanban/i18n/es.po | 4 +- .../i18n/stock_request_kanban.pot | 4 +- .../models/stock_request_kanban.py | 8 +- stock_request_kanban/readme/CONFIGURE.rst | 12 + stock_request_kanban/readme/CONTRIBUTORS.rst | 1 + stock_request_kanban/readme/DESCRIPTION.rst | 8 + stock_request_kanban/readme/USAGE.rst | 28 + .../report/stock_request_kanban_templates.xml | 2 +- .../static/description/index.html | 482 ++++++++++++++++++ stock_request_kanban/tests/test_kanban.py | 19 + 12 files changed, 633 insertions(+), 31 deletions(-) create mode 100644 stock_request_kanban/readme/CONFIGURE.rst create mode 100644 stock_request_kanban/readme/CONTRIBUTORS.rst create mode 100644 stock_request_kanban/readme/DESCRIPTION.rst create mode 100644 stock_request_kanban/readme/USAGE.rst create mode 100644 stock_request_kanban/static/description/index.html diff --git a/stock_request_kanban/README.rst b/stock_request_kanban/README.rst index b998d251f..472815c46 100644 --- a/stock_request_kanban/README.rst +++ b/stock_request_kanban/README.rst @@ -1,10 +1,29 @@ -.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg - :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html - :alt: License: LGPL-3 +==================== +Stock Request kanban +==================== -==================== -Stock Request Kanban -==================== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-warehouse/tree/11.0/stock_request_kanban + :alt: OCA/stock-logistics-warehouse +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-11-0/stock-logistics-warehouse-11-0-stock_request_kanban + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/153/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| On most companies there is products that must be purchased often but cannot be stored as a usual product because no consumption moves are made. @@ -15,18 +34,40 @@ products. It is created following the concept of lean kanban cards. +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +If you don't need to check the CRC of the kanban card, you should: + +* Access on Development mode +* Access 'Settings / Technical / Parameters / System Parameters' +* Create a parameter with name 'stock_request_kanban.crc' and set it value to 0 + +If you want to change the format of the QR, you should: + +* Access on Development mode +* Access 'Settings / Technical / Parameters / System Parameters' +* Create a parameter with name 'stock_request_kanban.barcode_format' and set + the format of the barcode + Usage ===== Creation --------- +~~~~~~~~ + * Go to 'Stock Requests / Stock Requests Kanban' and create a new Kanban. * Indicate a product, quantity and location. * Press 'Save'. * Print the kanban and put it in the storage of the product Request kanban --------------- +~~~~~~~~~~~~~~ This should be used if you want to create the kanban when the card is consumed. @@ -36,7 +77,7 @@ This should be used if you want to create the kanban when the card is consumed. * The stock request is created Request kanban batch --------------------- +~~~~~~~~~~~~~~~~~~~~ This should be used when you will store the cards and create request orders for kanbans later. @@ -46,38 +87,43 @@ for kanbans later. * Press the scan button * Scan all the pending kanban cards -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/153/11.0 - - Bug Tracker =========== -Bugs are tracked on `GitHub 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. +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* Creu Blanca +* Eficent + Contributors ------------- +~~~~~~~~~~~~ * Enric Tobella -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_request_kanban/__manifest__.py b/stock_request_kanban/__manifest__.py index cd71167fd..0a3eb4813 100644 --- a/stock_request_kanban/__manifest__.py +++ b/stock_request_kanban/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'Stock Request kanban', - 'version': '11.0.1.0.1', + 'version': '11.0.1.2.0', 'category': 'Reporting', 'website': 'https://github.com/OCA/stock-logistics-warehouse', 'author': 'Creu Blanca, Eficent, Odoo Community Association (OCA)', diff --git a/stock_request_kanban/i18n/es.po b/stock_request_kanban/i18n/es.po index ceb8fbf34..0b4aef1b8 100644 --- a/stock_request_kanban/i18n/es.po +++ b/stock_request_kanban/i18n/es.po @@ -70,7 +70,7 @@ msgid "Barcode %s is on the order" msgstr "El código %s ya está en la petición" #. module: stock_request_kanban -#: code:addons/stock_request_kanban/models/stock_request_kanban.py:33 +#: code:addons/stock_request_kanban/models/stock_request_kanban.py:39 #, python-format msgid "CRC is not valid" msgstr "El CRC no es válido" @@ -165,7 +165,7 @@ msgstr "Agrupar por" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_id -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_6240 +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_6246 #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_id diff --git a/stock_request_kanban/i18n/stock_request_kanban.pot b/stock_request_kanban/i18n/stock_request_kanban.pot index 31f0b6a6a..3f9cea7de 100644 --- a/stock_request_kanban/i18n/stock_request_kanban.pot +++ b/stock_request_kanban/i18n/stock_request_kanban.pot @@ -63,7 +63,7 @@ msgid "Barcode %s is on the order" msgstr "" #. module: stock_request_kanban -#: code:addons/stock_request_kanban/models/stock_request_kanban.py:33 +#: code:addons/stock_request_kanban/models/stock_request_kanban.py:39 #, python-format msgid "CRC is not valid" msgstr "" @@ -156,7 +156,7 @@ msgstr "" #. module: stock_request_kanban #: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_id -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_6240 +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_6246 #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_id #: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_id diff --git a/stock_request_kanban/models/stock_request_kanban.py b/stock_request_kanban/models/stock_request_kanban.py index a1969f369..1c0fc0cc9 100644 --- a/stock_request_kanban/models/stock_request_kanban.py +++ b/stock_request_kanban/models/stock_request_kanban.py @@ -22,10 +22,16 @@ class StockRequestKanban(models.Model): @api.model def get_barcode_format(self): - return 'Standard39' + return self.env['ir.config_parameter'].sudo().get_param( + 'stock_request_kanban.barcode_format', default='Standard39' + ) @api.model def _recompute_barcode(self, barcode): + if self.env['ir.config_parameter'].sudo().get_param( + 'stock_request_kanban.crc', default='1' + ) == '0': + return barcode bcc = getCodes()[self.get_barcode_format()](value=barcode[:-1]) bcc.validate() bcc.encode() diff --git a/stock_request_kanban/readme/CONFIGURE.rst b/stock_request_kanban/readme/CONFIGURE.rst new file mode 100644 index 000000000..e6216f228 --- /dev/null +++ b/stock_request_kanban/readme/CONFIGURE.rst @@ -0,0 +1,12 @@ +If you don't need to check the CRC of the kanban card, you should: + +* Access on Development mode +* Access 'Settings / Technical / Parameters / System Parameters' +* Create a parameter with name 'stock_request_kanban.crc' and set it value to 0 + +If you want to change the format of the QR, you should: + +* Access on Development mode +* Access 'Settings / Technical / Parameters / System Parameters' +* Create a parameter with name 'stock_request_kanban.barcode_format' and set + the format of the barcode diff --git a/stock_request_kanban/readme/CONTRIBUTORS.rst b/stock_request_kanban/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..93ec993e0 --- /dev/null +++ b/stock_request_kanban/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Enric Tobella diff --git a/stock_request_kanban/readme/DESCRIPTION.rst b/stock_request_kanban/readme/DESCRIPTION.rst new file mode 100644 index 000000000..2d6f42c31 --- /dev/null +++ b/stock_request_kanban/readme/DESCRIPTION.rst @@ -0,0 +1,8 @@ +On most companies there is products that must be purchased often but cannot be +stored as a usual product because no consumption moves are made. +Usually, they are stored as consumables or putaway rules are defined. +In both cases, reordering rules cannot be used. +This module allows to use stock request as reordering rules for this kind of +products. + +It is created following the concept of lean kanban cards. diff --git a/stock_request_kanban/readme/USAGE.rst b/stock_request_kanban/readme/USAGE.rst new file mode 100644 index 000000000..446f62544 --- /dev/null +++ b/stock_request_kanban/readme/USAGE.rst @@ -0,0 +1,28 @@ +Creation +~~~~~~~~ + +* Go to 'Stock Requests / Stock Requests Kanban' and create a new Kanban. +* Indicate a product, quantity and location. +* Press 'Save'. +* Print the kanban and put it in the storage of the product + +Request kanban +~~~~~~~~~~~~~~ + +This should be used if you want to create the kanban when the card is consumed. + +* Once the product is consumed, take the card +* Go to 'Stock Requests / Order Kanban Card' +* Scan the card +* The stock request is created + +Request kanban batch +~~~~~~~~~~~~~~~~~~~~ + +This should be used when you will store the cards and create request orders +for kanbans later. + +* Once the product is consumed, take the card and store it +* Create a store request order +* Press the scan button +* Scan all the pending kanban cards diff --git a/stock_request_kanban/report/stock_request_kanban_templates.xml b/stock_request_kanban/report/stock_request_kanban_templates.xml index e85e66bbb..7ba023505 100644 --- a/stock_request_kanban/report/stock_request_kanban_templates.xml +++ b/stock_request_kanban/report/stock_request_kanban_templates.xml @@ -57,7 +57,7 @@
-
diff --git a/stock_request_kanban/static/description/index.html b/stock_request_kanban/static/description/index.html new file mode 100644 index 000000000..f8c6feb48 --- /dev/null +++ b/stock_request_kanban/static/description/index.html @@ -0,0 +1,482 @@ + + + + + + +Stock Request kanban + + + +
+

Stock Request kanban

+ + +

Beta License: AGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

+

On most companies there is products that must be purchased often but cannot be +stored as a usual product because no consumption moves are made. +Usually, they are stored as consumables or putaway rules are defined. +In both cases, reordering rules cannot be used. +This module allows to use stock request as reordering rules for this kind of +products.

+

It is created following the concept of lean kanban cards.

+

Table of contents

+ +
+

Configuration

+

If you don’t need to check the CRC of the kanban card, you should:

+
    +
  • Access on Development mode
  • +
  • Access ‘Settings / Technical / Parameters / System Parameters’
  • +
  • Create a parameter with name ‘stock_request_kanban.crc’ and set it value to 0
  • +
+

If you want to change the format of the QR, you should:

+
    +
  • Access on Development mode
  • +
  • Access ‘Settings / Technical / Parameters / System Parameters’
  • +
  • Create a parameter with name ‘stock_request_kanban.barcode_format’ and set +the format of the barcode
  • +
+
+
+

Usage

+
+

Creation

+
    +
  • Go to ‘Stock Requests / Stock Requests Kanban’ and create a new Kanban.
  • +
  • Indicate a product, quantity and location.
  • +
  • Press ‘Save’.
  • +
  • Print the kanban and put it in the storage of the product
  • +
+
+
+

Request kanban

+

This should be used if you want to create the kanban when the card is consumed.

+
    +
  • Once the product is consumed, take the card
  • +
  • Go to ‘Stock Requests / Order Kanban Card’
  • +
  • Scan the card
  • +
  • The stock request is created
  • +
+
+
+

Request kanban batch

+

This should be used when you will store the cards and create request orders +for kanbans later.

+
    +
  • Once the product is consumed, take the card and store it
  • +
  • Create a store request order
  • +
  • Press the scan button
  • +
  • Scan all the pending kanban cards
  • +
+
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Creu Blanca
  • +
  • Eficent
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/stock-logistics-warehouse project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/stock_request_kanban/tests/test_kanban.py b/stock_request_kanban/tests/test_kanban.py index 3977788b2..4a44eac64 100644 --- a/stock_request_kanban/tests/test_kanban.py +++ b/stock_request_kanban/tests/test_kanban.py @@ -61,6 +61,8 @@ class TestKanban(TestBaseKanban): 'company_id': self.main_company.id, 'propagate': 'False', }) + self.env['ir.config_parameter'].set_param( + 'stock_request_kanban.crc', '1') def test_onchanges(self): kanban = self.env['stock.request.kanban'].new({}) @@ -143,6 +145,11 @@ class TestKanban(TestBaseKanban): 'product_uom_id': self.product.uom_id.id, 'product_uom_qty': 1, }) + kanban_3 = self.env['stock.request.kanban'].create({ + 'product_id': self.product.id, + 'product_uom_id': self.product.uom_id.id, + 'product_uom_qty': 1, + }) wizard = self.env['wizard.stock.request.kanban'].with_context( ).create({}) with self.assertRaises(ValidationError): @@ -162,3 +169,15 @@ class TestKanban(TestBaseKanban): self.assertTrue(self.env['stock.request'].search( [('kanban_id', '=', kanban_2.id)]) ) + with self.assertRaises(ValidationError): + wizard.on_barcode_scanned(kanban_3.name) + self.assertFalse(self.env['stock.request'].search( + [('kanban_id', '=', kanban_3.id)]) + ) + self.env['ir.config_parameter'].set_param( + 'stock_request_kanban.crc', '0') + wizard.on_barcode_scanned(kanban_3.name) + self.assertEqual(wizard.status_state, 0) + self.assertTrue(self.env['stock.request'].search( + [('kanban_id', '=', kanban_3.id)]) + ) From 6ed136d4527f358ef563a053db82992aa5ab8a16 Mon Sep 17 00:00:00 2001 From: Kitti U Date: Thu, 27 Jun 2019 17:21:46 +0700 Subject: [PATCH 10/18] [12.0][MIG] stock_request_kanban --- stock_request_kanban/README.rst | 11 +- stock_request_kanban/__manifest__.py | 2 +- .../i18n/stock_request_kanban.pot | 461 ++++++++++++++---- stock_request_kanban/readme/CONTRIBUTORS.rst | 1 + .../static/description/index.html | 7 +- stock_request_kanban/tests/test_kanban.py | 8 +- .../views/stock_inventory_kanban_views.xml | 2 +- .../views/stock_request_kanban_views.xml | 8 +- .../wizard_stock_request_order_kanban.py | 3 +- 9 files changed, 390 insertions(+), 113 deletions(-) diff --git a/stock_request_kanban/README.rst b/stock_request_kanban/README.rst index 472815c46..1a4eb5697 100644 --- a/stock_request_kanban/README.rst +++ b/stock_request_kanban/README.rst @@ -14,13 +14,13 @@ Stock Request kanban :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github - :target: https://github.com/OCA/stock-logistics-warehouse/tree/11.0/stock_request_kanban + :target: https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_request_kanban :alt: OCA/stock-logistics-warehouse .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-11-0/stock-logistics-warehouse-11-0-stock_request_kanban + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_request_kanban :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/153/11.0 + :target: https://runbot.odoo-community.org/runbot/153/12.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -93,7 +93,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -110,6 +110,7 @@ Contributors ~~~~~~~~~~~~ * Enric Tobella +* Kitti Upariphutthiphong Maintainers ~~~~~~~~~~~ @@ -124,6 +125,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub. +This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_request_kanban/__manifest__.py b/stock_request_kanban/__manifest__.py index 0a3eb4813..162355651 100644 --- a/stock_request_kanban/__manifest__.py +++ b/stock_request_kanban/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'Stock Request kanban', - 'version': '11.0.1.2.0', + 'version': '12.0.1.0.0', 'category': 'Reporting', 'website': 'https://github.com/OCA/stock-logistics-warehouse', 'author': 'Creu Blanca, Eficent, Odoo Community Association (OCA)', diff --git a/stock_request_kanban/i18n/stock_request_kanban.pot b/stock_request_kanban/i18n/stock_request_kanban.pot index 3f9cea7de..4c716bffa 100644 --- a/stock_request_kanban/i18n/stock_request_kanban.pot +++ b/stock_request_kanban/i18n/stock_request_kanban.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -14,16 +14,34 @@ msgstr "" "Plural-Forms: \n" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_active +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__message_needaction +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__message_needaction +msgid "Action Needed" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__active msgid "Active" msgstr "" +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__activity_ids +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__activity_ids +msgid "Activities" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__activity_state +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__activity_state +msgid "Activity State" +msgstr "" + #. module: stock_request_kanban #: model:ir.actions.act_window,name:stock_request_kanban.wizard_stock_inventory_kanban_action #: model:ir.actions.act_window,name:stock_request_kanban.wizard_stock_request_kanban_action #: model:ir.actions.act_window,name:stock_request_kanban.wizard_stock_request_order_kanban_action -#: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_inventory_kanban_form -#: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_request_kanban_form +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_inventory_kanban_form +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_request_kanban_form msgid "Add Kanban" msgstr "" @@ -34,10 +52,21 @@ msgid "Added kanban %s for product %s" msgstr "" #. module: stock_request_kanban -#: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__allow_virtual_location +msgid "Allow Virtual locations on Stock Requests" +msgstr "" + +#. module: stock_request_kanban +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Archived" msgstr "" +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__message_attachment_count +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__message_attachment_count +msgid "Attachment Count" +msgstr "" + #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_kanban_abstract.py:29 #, python-format @@ -62,6 +91,14 @@ msgstr "" msgid "Barcode %s is on the order" msgstr "" +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban___barcode_scanned +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban___barcode_scanned +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract___barcode_scanned +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban___barcode_scanned +msgid "Barcode Scanned" +msgstr "" + #. module: stock_request_kanban #: code:addons/stock_request_kanban/models/stock_request_kanban.py:39 #, python-format @@ -69,7 +106,7 @@ msgid "CRC is not valid" msgstr "" #. module: stock_request_kanban -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form msgid "Cancel" msgstr "" @@ -79,19 +116,19 @@ msgid "Cancelled" msgstr "" #. module: stock_request_kanban -#: model:ir.actions.act_window,help:stock_request_kanban.stock_inventory_kanban_action +#: model_terms:ir.actions.act_window,help:stock_request_kanban.stock_inventory_kanban_action msgid "Click to add a Stock Inventory Kanban." msgstr "" #. module: stock_request_kanban -#: model:ir.actions.act_window,help:stock_request_kanban.stock_request_kanban_action +#: model_terms:ir.actions.act_window,help:stock_request_kanban.stock_request_kanban_action msgid "Click to add a Stock Request Kanban." msgstr "" #. module: stock_request_kanban -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form -#: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_inventory_kanban_form -#: model:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_request_kanban_form +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_inventory_kanban_form +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.wizard_stock_request_kanban_form msgid "Close" msgstr "" @@ -100,6 +137,11 @@ msgstr "" msgid "Closed" msgstr "" +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__company_id +msgid "Company" +msgstr "" + #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:32 #, python-format @@ -107,30 +149,30 @@ msgid "Company must be the same" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_create_uid -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_create_uid -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_create_uid -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_create_uid -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_create_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__create_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__create_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban__create_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban__create_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban__create_uid msgid "Created by" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_create_date -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_create_date -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_create_date -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_create_date -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_create_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__create_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__create_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban__create_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban__create_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban__create_date msgid "Created on" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_display_name -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_display_name -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_display_name -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_display_name -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_display_name -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_display_name +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__display_name +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__display_name +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban__display_name +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban__display_name +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract__display_name +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban__display_name msgid "Display Name" msgstr "" @@ -140,7 +182,7 @@ msgid "Draft" msgstr "" #. module: stock_request_kanban -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form msgid "Finish" msgstr "" @@ -150,20 +192,56 @@ msgid "Finished" msgstr "" #. module: stock_request_kanban -#: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__message_follower_ids +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__message_follower_ids +msgid "Followers" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__message_channel_ids +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__message_channel_ids +msgid "Followers (Channels)" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__message_partner_ids +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__message_partner_ids +msgid "Followers (Partners)" +msgstr "" + +#. module: stock_request_kanban +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Group By" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_id -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id_6246 -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_id -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_id -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_id -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__id +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban__id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban__id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract__id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban__id msgid "ID" msgstr "" +#. module: stock_request_kanban +#: model:ir.model.fields,help:stock_request_kanban.field_stock_inventory_kanban__message_unread +#: model:ir.model.fields,help:stock_request_kanban.field_stock_request_kanban__message_unread +msgid "If checked new messages require your attention." +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,help:stock_request_kanban.field_stock_inventory_kanban__message_needaction +#: model:ir.model.fields,help:stock_request_kanban.field_stock_request_kanban__message_needaction +msgid "If checked, new messages require your attention." +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,help:stock_request_kanban.field_stock_inventory_kanban__message_has_error +#: model:ir.model.fields,help:stock_request_kanban.field_stock_request_kanban__message_has_error +msgid "If checked, some messages have a delivery error." +msgstr "" + #. module: stock_request_kanban #: selection:stock.inventory.kanban,state:0 msgid "In progress" @@ -175,8 +253,8 @@ msgid "Inventory" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_inventory_kanban_id -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban__inventory_kanban_id +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form msgid "Inventory Kanban" msgstr "" @@ -186,46 +264,57 @@ msgid "Inventory for Kanban" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_kanban_ids -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_id -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_kanban_id -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_kanban_id -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_kanban_id -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_kanban_id -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__message_is_follower +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__message_is_follower +msgid "Is Follower" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__kanban_ids +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request__kanban_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban__kanban_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban__kanban_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract__kanban_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban__kanban_id +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form msgid "Kanban" msgstr "" +#. module: stock_request_kanban +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_kanban_view +msgid "Kanban Image" +msgstr "" + #. module: stock_request_kanban #: model:ir.ui.menu,name:stock_request_kanban.stock_request_kanban_menu msgid "Kanban cards" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban___last_update -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban___last_update -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban___last_update -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban___last_update -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract___last_update -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban___last_update +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban____last_update +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban____last_update +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban____last_update +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban____last_update +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract____last_update +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban____last_update msgid "Last Modified on" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_write_uid -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_write_uid -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_write_uid -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_write_uid -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_write_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__write_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__write_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban__write_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban__write_uid +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban__write_uid msgid "Last Updated by" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_write_date -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban_write_date -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_write_date -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_write_date -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_write_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__write_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__write_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban__write_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban__write_date +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban__write_date msgid "Last Updated on" msgstr "" @@ -236,8 +325,9 @@ msgid "Lines only can be added on orders with draft state" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_location_ids -#: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__location_ids +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__location_id +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Location" msgstr "" @@ -248,40 +338,129 @@ msgid "Location must be the same" msgstr "" #. module: stock_request_kanban -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__message_main_attachment_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__message_main_attachment_id +msgid "Main Attachment" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__message_has_error +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__message_has_error +msgid "Message Delivery error" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__message_ids +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__message_ids +msgid "Messages" +msgstr "" + +#. module: stock_request_kanban +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form msgid "Missing" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_missing_kanban_ids +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__missing_kanban_ids msgid "Missing Kanban" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_count_missing_kanbans +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__count_missing_kanbans msgid "Missing Kanbans" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_name +#: model:ir.model.fields,help:stock_request_kanban.field_stock_request_kanban__procurement_group_id +msgid "Moves created through this stock request will be put in this procurement group. If none is given, the moves generated by procurement rules will be grouped into one big picking." +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__name +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__name msgid "Name" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_order_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__activity_date_deadline +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__activity_date_deadline +msgid "Next Activity Deadline" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__activity_summary +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__activity_summary +msgid "Next Activity Summary" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__activity_type_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__activity_type_id +msgid "Next Activity Type" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__message_needaction_counter +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__message_needaction_counter +msgid "Number of Actions" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__message_has_error_counter +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__message_has_error_counter +msgid "Number of error" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,help:stock_request_kanban.field_stock_inventory_kanban__message_needaction_counter +#: model:ir.model.fields,help:stock_request_kanban.field_stock_request_kanban__message_needaction_counter +msgid "Number of messages which requires an action" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,help:stock_request_kanban.field_stock_inventory_kanban__message_has_error_counter +#: model:ir.model.fields,help:stock_request_kanban.field_stock_request_kanban__message_has_error_counter +msgid "Number of messages with delivery error" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,help:stock_request_kanban.field_stock_inventory_kanban__message_unread_counter +#: model:ir.model.fields,help:stock_request_kanban.field_stock_request_kanban__message_unread_counter +msgid "Number of unread messages" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban__order_id msgid "Order" msgstr "" +#. module: stock_request_kanban +#: selection:stock.inventory.kanban,activity_state:0 +#: selection:stock.request.kanban,activity_state:0 +msgid "Overdue" +msgstr "" + +#. module: stock_request_kanban +#: selection:stock.inventory.kanban,activity_state:0 +#: selection:stock.request.kanban,activity_state:0 +msgid "Planned" +msgstr "" + #. module: stock_request_kanban #: model:ir.actions.report,name:stock_request_kanban.action_report_kanban msgid "Print kanban" msgstr "" #. module: stock_request_kanban -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form msgid "Print missing" msgstr "" +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__procurement_group_id +msgid "Procurement Group" +msgstr "" + #. module: stock_request_kanban #: code:addons/stock_request_kanban/wizard/wizard_stock_request_order_kanban.py:38 #, python-format @@ -289,65 +468,120 @@ msgid "Procurement group must be the same" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_product_ids +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__product_id +msgid "Product" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__product_uom_id +msgid "Product Unit of Measure" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__product_ids msgid "Products" msgstr "" +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__product_uom_qty +msgid "Quantity" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,help:stock_request_kanban.field_stock_request_kanban__product_qty +msgid "Quantity in the default UoM of the product" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,help:stock_request_kanban.field_stock_request_kanban__product_uom_qty +msgid "Quantity, specified in the unit of measure indicated in the request." +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__product_qty +msgid "Real Quantity" +msgstr "" + #. module: stock_request_kanban #: model:ir.ui.menu,name:stock_request_kanban.menu_wizard_stock_request_kanban msgid "Request from Kanban cards" msgstr "" #. module: stock_request_kanban -#: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_order_form -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__activity_user_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__activity_user_id +msgid "Responsible User" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__route_id +msgid "Route" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__route_ids +msgid "Routes" +msgstr "" + +#. module: stock_request_kanban +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.stock_request_order_form +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form msgid "Scan" msgstr "" #. module: stock_request_kanban -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form msgid "Scanned" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_scanned_kanban_ids +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__scanned_kanban_ids msgid "Scanned Kanban" msgstr "" #. module: stock_request_kanban -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form msgid "Set to draft" msgstr "" #. module: stock_request_kanban -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form msgid "Start" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_state +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__state msgid "State" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_status -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_status -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_status -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_status +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban__status +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban__status +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract__status +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban__status msgid "Status" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban_status_state -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract_status_state -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_status_state -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_status_state +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_inventory_kanban__status_state +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban__status_state +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_abstract__status_state +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban__status_state msgid "Status State" msgstr "" #. module: stock_request_kanban -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_tree +#: model:ir.model.fields,help:stock_request_kanban.field_stock_inventory_kanban__activity_state +#: model:ir.model.fields,help:stock_request_kanban.field_stock_request_kanban__activity_state +msgid "Status based on activities\n" +"Overdue: Due date is already passed\n" +"Today: Activity date is today\n" +"Planned: Future activities." +msgstr "" + +#. module: stock_request_kanban +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_form +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_inventory_kanban_tree msgid "Stock Inventories" msgstr "" @@ -358,14 +592,14 @@ msgstr "" #. module: stock_request_kanban #: model:ir.model,name:stock_request_kanban.model_stock_request -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban_stock_request_id -#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban_stock_request_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_kanban__stock_request_id +#: model:ir.model.fields,field_description:stock_request_kanban.field_wizard_stock_request_order_kanban__stock_request_id msgid "Stock Request" msgstr "" #. module: stock_request_kanban #: model:ir.model,name:stock_request_kanban.model_stock_request_kanban -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_request_kanban_form +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_request_kanban_form msgid "Stock Request Kanban" msgstr "" @@ -375,19 +609,46 @@ msgid "Stock Request Kanbans" msgstr "" #. module: stock_request_kanban -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_request_kanban_form -#: model:ir.ui.view,arch_db:stock_request_kanban.view_stock_request_kanban_tree +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_request_kanban_form +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.view_stock_request_kanban_tree msgid "Stock Requests" msgstr "" #. module: stock_request_kanban -#: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Stock Requests Kanban" msgstr "" #. module: stock_request_kanban -#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban_warehouse_ids -#: model:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search +#: selection:stock.inventory.kanban,activity_state:0 +#: selection:stock.request.kanban,activity_state:0 +msgid "Today" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__message_unread +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__message_unread +msgid "Unread Messages" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__message_unread_counter +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__message_unread_counter +msgid "Unread Messages Counter" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,help:stock_request_kanban.field_wizard_stock_inventory_kanban___barcode_scanned +#: model:ir.model.fields,help:stock_request_kanban.field_wizard_stock_request_kanban___barcode_scanned +#: model:ir.model.fields,help:stock_request_kanban.field_wizard_stock_request_kanban_abstract___barcode_scanned +#: model:ir.model.fields,help:stock_request_kanban.field_wizard_stock_request_order_kanban___barcode_scanned +msgid "Value of the last barcode scanned." +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__warehouse_ids +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__warehouse_id +#: model_terms:ir.ui.view,arch_db:stock_request_kanban.stock_request_kanban_search msgid "Warehouse" msgstr "" @@ -397,6 +658,18 @@ msgstr "" msgid "Warehouse must be the same" msgstr "" +#. module: stock_request_kanban +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_inventory_kanban__website_message_ids +#: model:ir.model.fields,field_description:stock_request_kanban.field_stock_request_kanban__website_message_ids +msgid "Website Messages" +msgstr "" + +#. module: stock_request_kanban +#: model:ir.model.fields,help:stock_request_kanban.field_stock_inventory_kanban__website_message_ids +#: model:ir.model.fields,help:stock_request_kanban.field_stock_request_kanban__website_message_ids +msgid "Website communication history" +msgstr "" + #. module: stock_request_kanban #: model:ir.model,name:stock_request_kanban.model_wizard_stock_inventory_kanban msgid "wizard.stock.inventory.kanban" diff --git a/stock_request_kanban/readme/CONTRIBUTORS.rst b/stock_request_kanban/readme/CONTRIBUTORS.rst index 93ec993e0..ed1b3be4a 100644 --- a/stock_request_kanban/readme/CONTRIBUTORS.rst +++ b/stock_request_kanban/readme/CONTRIBUTORS.rst @@ -1 +1,2 @@ * Enric Tobella +* Kitti Upariphutthiphong diff --git a/stock_request_kanban/static/description/index.html b/stock_request_kanban/static/description/index.html index f8c6feb48..ffa2995d3 100644 --- a/stock_request_kanban/static/description/index.html +++ b/stock_request_kanban/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

On most companies there is products that must be purchased often but cannot be stored as a usual product because no consumption moves are made. Usually, they are stored as consumables or putaway rules are defined. @@ -448,7 +448,7 @@ for kanbans later.

Bugs are tracked on GitHub 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.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -464,6 +464,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

Contributors

@@ -473,7 +474,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/stock-logistics-warehouse project on GitHub.

+

This module is part of the OCA/stock-logistics-warehouse project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/stock_request_kanban/tests/test_kanban.py b/stock_request_kanban/tests/test_kanban.py index 4a44eac64..5c28639f0 100644 --- a/stock_request_kanban/tests/test_kanban.py +++ b/stock_request_kanban/tests/test_kanban.py @@ -12,7 +12,7 @@ class TestKanban(TestBaseKanban): super().setUp() self.main_company = self.env.ref('base.main_company') self.warehouse = self.env.ref('stock.warehouse0') - self.categ_unit = self.env.ref('product.product_uom_categ_unit') + self.categ_unit = self.env.ref('uom.product_uom_categ_unit') # common data self.company_2 = self.env['res.company'].create({ @@ -42,19 +42,19 @@ class TestKanban(TestBaseKanban): 'route_ids': [(4, self.route.id)], 'company_id': False, }) - self.uom_dozen = self.env['product.uom'].create({ + self.uom_dozen = self.env['uom.uom'].create({ 'name': 'Test-DozenA', 'category_id': self.categ_unit.id, 'factor_inv': 12, 'uom_type': 'bigger', 'rounding': 0.001}) - self.env['procurement.rule'].create({ + self.env['stock.rule'].create({ 'name': 'Transfer', 'route_id': self.route.id, 'location_src_id': self.ressuply_loc.id, 'location_id': self.warehouse.lot_stock_id.id, - 'action': 'move', + 'action': 'pull_push', 'picking_type_id': self.warehouse.int_type_id.id, 'procure_method': 'make_to_stock', 'warehouse_id': self.warehouse.id, diff --git a/stock_request_kanban/views/stock_inventory_kanban_views.xml b/stock_request_kanban/views/stock_inventory_kanban_views.xml index 879134b44..6833dbc1c 100644 --- a/stock_request_kanban/views/stock_inventory_kanban_views.xml +++ b/stock_request_kanban/views/stock_inventory_kanban_views.xml @@ -50,7 +50,7 @@ />
-