From 516051978fc077a4b339a8440d22bac6978a3a79 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sat, 7 Nov 2015 14:36:51 +0100 Subject: [PATCH 1/5] contract_recurring_plans ============================================== Analytic plans for contract recurring invoices ============================================== This module allows to include an analytic plan on each recurring invoice line, so if you set it, this will be taken to be transferred to the invoice instead of the analytic account of the contract. Usage ===== On the contract view, select or create an analytic distribution for the invoice recurring lines that you want. --- contract_recurring_plans/README.rst | 62 +++ contract_recurring_plans/__init__.py | 5 + contract_recurring_plans/__openerp__.py | 20 + contract_recurring_plans/i18n/es.po | 36 ++ contract_recurring_plans/models/__init__.py | 5 + .../models/account_analytic_invoice_line.py | 26 + .../static/description/icon.png | Bin 0 -> 6278 bytes .../static/description/icon.svg | 463 ++++++++++++++++++ contract_recurring_plans/tests/__init__.py | 5 + .../tests/test_contract_recurring_plans.py | 47 ++ .../account_analytic_invoice_line_view.xml | 17 + 11 files changed, 686 insertions(+) create mode 100644 contract_recurring_plans/README.rst create mode 100644 contract_recurring_plans/__init__.py create mode 100644 contract_recurring_plans/__openerp__.py create mode 100644 contract_recurring_plans/i18n/es.po create mode 100644 contract_recurring_plans/models/__init__.py create mode 100644 contract_recurring_plans/models/account_analytic_invoice_line.py create mode 100644 contract_recurring_plans/static/description/icon.png create mode 100644 contract_recurring_plans/static/description/icon.svg create mode 100644 contract_recurring_plans/tests/__init__.py create mode 100644 contract_recurring_plans/tests/test_contract_recurring_plans.py create mode 100644 contract_recurring_plans/views/account_analytic_invoice_line_view.xml diff --git a/contract_recurring_plans/README.rst b/contract_recurring_plans/README.rst new file mode 100644 index 00000000..abb1ee5a --- /dev/null +++ b/contract_recurring_plans/README.rst @@ -0,0 +1,62 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +============================================== +Analytic plans for contract recurring invoices +============================================== + +This module allows to include an analytic plan on each recurring invoice line, +so if you set it, this will be taken to be transferred to the invoice instead +of the analytic account of the contract. + +Usage +===== + +On the contract view, select or create an analytic distribution for the +invoice recurring lines that you want. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/110/8.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 smashing it by providing a detailed and welcomed feedback `here `_. + +Credits +======= + +Contributors +------------ + +* Pedro M. Baeza + +Icon +---- + +* https://openclipart.org/detail/125071/pie-graph +* Subicon made by `Freepik _ from + www.flaticon.com + +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 http://odoo-community.org. diff --git a/contract_recurring_plans/__init__.py b/contract_recurring_plans/__init__.py new file mode 100644 index 00000000..721dbe49 --- /dev/null +++ b/contract_recurring_plans/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# (c) 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import models diff --git a/contract_recurring_plans/__openerp__.py b/contract_recurring_plans/__openerp__.py new file mode 100644 index 00000000..739bedc6 --- /dev/null +++ b/contract_recurring_plans/__openerp__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# (c) 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +{ + 'name': 'Analytic plans on contracts recurring invoices', + 'version': '8.0.1.0.0', + 'category': 'Contract Management', + 'author': 'Serv. Tecnolog. Avanzados - Pedro M. Baeza, ' + 'Odoo Community Association (OCA)', + 'website': 'http://www.serviciosbaeza.com', + 'depends': [ + 'account_analytic_plans', + 'account_analytic_analysis', + ], + 'data': [ + 'views/account_analytic_invoice_line_view.xml', + ], + 'installable': True, +} diff --git a/contract_recurring_plans/i18n/es.po b/contract_recurring_plans/i18n/es.po new file mode 100644 index 00000000..240ddd74 --- /dev/null +++ b/contract_recurring_plans/i18n/es.po @@ -0,0 +1,36 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * account_analytic_analysis_recurring_plans +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-11-01 01:39+0000\n" +"PO-Revision-Date: 2014-11-01 01:39+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_analytic_analysis_recurring_plans +#: code:_description:0 +#: model:ir.model,name:account_analytic_analysis_recurring_plans.model_account_analytic_account +#, python-format +msgid "Analytic Account" +msgstr "Cuenta analítica" + +#. module: account_analytic_analysis_recurring_plans +#: field:account.analytic.invoice.line,analytics_id:0 +msgid "Analytic Distribution" +msgstr "Distribución analítica" + +#. module: account_analytic_analysis_recurring_plans +#: code:_description:0 +#: model:ir.model,name:account_analytic_analysis_recurring_plans.model_account_analytic_invoice_line +#, python-format +msgid "account.analytic.invoice.line" +msgstr "account.analytic.invoice.line" + diff --git a/contract_recurring_plans/models/__init__.py b/contract_recurring_plans/models/__init__.py new file mode 100644 index 00000000..5c3342b8 --- /dev/null +++ b/contract_recurring_plans/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# (c) 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import account_analytic_invoice_line diff --git a/contract_recurring_plans/models/account_analytic_invoice_line.py b/contract_recurring_plans/models/account_analytic_invoice_line.py new file mode 100644 index 00000000..3b0660a6 --- /dev/null +++ b/contract_recurring_plans/models/account_analytic_invoice_line.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# (c) 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from openerp import models, fields, api + + +class AccountAnalyticAccount(models.Model): + _inherit = "account.analytic.account" + + @api.model + def _prepare_invoice_line(self, line, invoice_id): + res = super(AccountAnalyticAccount, self)._prepare_invoice_line( + line, invoice_id) + if line.analytics_id: + res.update({'account_analytic_id': False, + 'analytics_id': line.analytics_id.id}) + return res + + +class AccountAnalyticInvoiceLine(models.Model): + _inherit = "account.analytic.invoice.line" + + analytics_id = fields.Many2one( + comodel_name='account.analytic.plan.instance', + string='Analytic Distribution') diff --git a/contract_recurring_plans/static/description/icon.png b/contract_recurring_plans/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..0fab733da56d27421211828457a1181253090f21 GIT binary patch literal 6278 zcmaiYcQjmI^zWT97<~i@(MB6Y4-wtyr06YCNAEL?PMFbaL6{?yLixeqOE!NkOMerri+>Qt&lv~`3KDns z@x(h~aL(dbKiB+irOP1G<#Q%ecYiNuz|h^x8Hsg4>R`Q`oPCfQSa%Bi?tja13&COi-JJd19Wh== z*Z&dfcrH{F>EwqA@J9KGCe7(f4WFD0Cu{W0!d z5;D^Avhot=mWg3q#Qw(^vHy$_a|jXhu*00YbfZdg3>0hmpAA@Ch@ZQwn?InTA&E2$ zaPV?>L~3HaF`&_!&Q73D|5#>P zYbkN<7OVPesz-+Kaf+ji7`>9WXp@p$^{Z6xl8y6dmY{K2i2c`DIw6nB>FVpFy-%~8 z?|f74`V%jDC(S0rnV;S2&s$giEw19fTPK}A{}d{R{Yp@y7|9l6H?p=q{Sr%a33ayH z$MEUPm%F8I)Ocs%+kzh?5b!qOo`HJ~qFzWKGY{ z&zB27#)a|g>)tFaALI(#%x{vT5#fqF-K*vG<-O}+=a4cPMNYHwO3f;`F8pLaOzh&# z^5Vwq@DD#GpLj+|U*h_aoSbau?dE1UD(U@2Cgt)qYS5icc-UhK0RaIyza{usk+MkJ z*;Ivza<-V&ujFfi|taodsIlxa*JB^ET&CwIEueX%+`Ybtp z@9^-DF|94?!&=rXMmC@Co)?{1ou%l@87-qM?}G0!h&3{|*KMU#$l?DVF@CDhDUSFp zOwS>Q7~^f@unk=kNMV(F-0;pYwT^mz2HQ38soJXVj#Exwrh&@zQ&>qXK`0*ee@Vwu zk(ij6I5ac_cTKmUudlB!^j6n}R|4i$mP8g2^Oy!*I>xw*(8nBk!2e5_4(j6#yR)Qw ze}2U_4AnXAEex<;^DuSI_az~#pmM$ou)xjFjAOig_a8~SdO&xhE<)7_{Cbuzov64% zmePIjGi{DJylV@=I~_;6EBRO`(0RN-llAZ+4-ZdiW_7Ey8y6C`w7MFmqR2rnq--($ zuq1?ll*6ykn%7t--pmnKt0gVINo6m(S5Z-+tEac7xzQV4M_po3Ynzm&Feg@bxBA7; zv0_#3!TX$N7xjKNehFT9$eguthBAI&@<`|~g8a__f}Fe59gWRhJZ=c`w*IPGnY zOQ_J0QtOpe5LY1~A(r(HNJIf_!D+|jeY@ZL()03?PEW(jo;~9g5fSOl zj^)k+PH}q+T3OlIFNX6A3sZ-OZxkqnTu}YHX3%3v`g1$A?mmo5Ih0w@porEr9W!{a z_F=LsGIHQAsAv8{x9Zu60dB0#>6EfplrY;Cv{>EzjryE#z9+hm7wE7}i{}c3-^><; z07|F3ecvT(`$}U03EhksiOyqnvv2i|gO7F6xQ52Z2PaB3CY!NyaH~sfZqVJ{L?%H) zlP5lp{%vl0F|)9I|MJSy=H<~&914(#xqLQjL6ZlxQcY2Jd&w^LP;zTVM5r8uDx(aF zI4~o;l(zvfH!m;K_M@G&y~V*kd&zlFdQm6ZLd&ui`l;$p^xWCMqwk_uHw{BWNy-J4 z6ySsjiHQv;AASAcEOGV~M0$$0V@?~}g0|3J(o+2ODSGu-kxP z0wdoFV=}3N;LdXaDC<<%-tUFM`EA_CK1qN=#rAQ&TYo1st1mU2_fIzc!}}1NnrdrJ3-n zV*_7X@H~1K^ovzeL2!j1ezZ8=ACZvqThi?x7zjx6<|NYJQ~J8*{~iPn6_Cn){r+Xa1O+KKNVP{^RXOd(_x^FlJ$%ZK%@fa@ao$V&doMWcal$G92+lXd z4@EStY##3|e(t=d`10jTLv!=ELdBrRB_+U}J9j>};LBI_?}8Ykpt}s??LGOqs;t`Z zYj2R-ajZc8b9;z%1XxZNK}-z|5ARn^d@MKM4*z>d3f_7}+C5n17z&*rcwndrVDDAyFs_78aJGk#-B)5P_wTRDoX?!cF$B zbqcG-(OkPUAu6w?Ij@N{1iruI#jP^vevPyfVB}oshKTP*$2QP(F}$@@jrm9xe!4gK zxzRmyHSE?c+KZx=1aJ*-Tvhf8zp9U5-0nECWjNVs|4DyQ!Zw9L^%NoPG78LJpay8c z)=R3f>BC0+Wam%{Mu457|KHy~QUU9x09r$X%r^Ktxz}7LXa04pwyiA}m=MZ?o?yvJ zS*z{(r;sgflSCw=beMdsm3tjq^a5Xv%W~X#r!05(pFk3O(mlPO5pN$*LlckgfN6sXuuc@vMmG$~eSS<>p54~5pb}^ZJ zrpddH$v}yC^ev3R%*-rF79}9SBQHPw^WRdYL6lS+86`bZTDsvKUdb+uzWCwhoBI7) zq@NK{4#p!R)RJ_PH4Oa`;o#o|Ut@5$dLMX$zgps6lj$K-D~1l@A>}g4dft23ulw|a zX}SyMkmGofa;_vM%AgbMODWu{T-UB$3tq1%-))=wt8Z?|NfbG>s9Rn~71YY__>OqD zVRL9Kz6}1|4`~t!rr*vnC>7;hD2DS_i=NabReBd%l&8R4oSf#D-e%^iMykAj{~q^a zf+vMd8ilkoHa0Fd=&13o8Tg~M;}AK0*7}B8NsQEdc%?ZI7DqmP>8`5qtH1!;XvXit z=`jUas;E_8MX_pY#A{;*r&p+Uz-xlP<#*MEL5ImvsWn%e5!GJvN4b##Ndg6$UuU3dk&8# z`}4!8%+<6dbJ+bx8NT_=P_wE8^1TK=IQHji5l{etb~X{XZ_eRfK4OOYXaR$N6`$!a z`EeX8)Gh11bf6^LT}B0TlO9(0wU)M7H#W)&7%y8%Fe{~G02;i_bP`hwMj8IETD@)q zz!<53M%^DCt$ekNA_>LpH^YP8VeW4OU=*@OOaQ@H$NfRm`b}+I&de{}q9B#0FQKsK zx-U`yvfofO82oa{Uk_Fwtbva|XGYd{Sd3J4ov&wtN!taDZ%9DN;XXu2zXm41gwF7x zLl^=3uVu}5tDPFAq2}_P0UPEzKPTKJ{W^w|Oi07Gqo|Z=mF)@1OEZVfzE9REd}e$! zm<1YTEP?K048x0q%UhR9jG-|u_l%7*+#057|2_0O-o+$5{(+zCXyd(qXsA;|8WCbm zx7Q^wqU7=mo;R5-#^+fH)rb>kF+nVwT8-nbwL7W$VN112P^F}efrBb-Rr_wjd$7v8 z9$O5bC)4TA@x`s?Idki~)oo~h9AXto5p0p8KfyN*`jkX$s9=+Aqg%eVEc8N1{pnVq zNX3-|^WWAcc4RJ?B&g{HNJ$MIEUQDwT3AVHFR)ItH~Y-~E-+pOJ3OYF0Fh*c7HA&z z@WcQ+^L`M(J{A-$%)O&;DoLpO8H}2)Hl$gxYY^+Xdl+5{5GS4vetU9*PV|1@qOfJ%<7v>dEAR67c&`zb$!}6 z6m}EEihQGd6JDr~O>1~_4X;ZD+YWKl+H46|_{XU!r!QVjnrL~fMLa%B zx>K}i)Y{aj>^ig?B+iOIgadJkU1(=`*U!`o&u zF4M}mq_F9);&g{#d!tddo365N<(uqSn#&Xdc+y3Stv6#Jxg>e)K3BlNxqWGa4Ao zUXa_%cD>NzdJ1sNX~qJEmY*5c*3$Sobt1KTo!)xYQo5bkQ7pSo0f3TTizjK{IN=2T zd1d&LXNp+b^+6J`Uah*nnVRrK3pP(~nba`J1E9+m9EfzU6nb){!Zk-uxsOi56?2U) zxC#Rn$fs^O@e5?K7zsmX344XGK8;jr}nY+KbFy^I`W zy9N<9b^;Y02-@z`js+$bAYXYA-c4co9HjAq@?Wb`Jiq>e@^s^6x|MSXh`?KdaCM9u5QLeRXxZ?Pe$AI_G&F#atN4C4?d zbm9tBJW2J%l};n)4#5iK8!xVJJ{i#=(+%63{BY{jxwtSJ; zN*&J+@153cV535rTr`>8qd~wS&&^-HU53Emw}7DLh#)u;P*F!7ai3}sf+D*$R91^` zW;7y3eCw-Q6Z66#EZqo-f()Rc3od7Uee1NDSpQzGqf~U#ZPR;l?f1(Gg``(0KVbr4 zx3G^W(lsqufAY;OpZ4VD=b3ZQuS0|BD42-zMe76XR9S-53&p!u*5+0cM&BU-lI^uM zeLK3_ZV86IIwNOPJo9c$W%->xu4IfKP6}Q3pE8*^Y?92rf~ZGwA)o)jdU!;YFm)r* z$ZzlWXA4!EF9D~~gs|YxTU7jyc`1HtE-ffpMr9ao2zbB%K)Acf*d75HS%T-VsBQc@ zrWn&9;qPy_Y2PgCs&K7RqQ_l^^uT|l5+*g79icvr&J2R|2+AX$zbTOZcI$>Npj+)A zvf$XY;FwEvU|O*v^Z5k;IDlkFGUUqD)p7Ff>O(1i%P0Q+II?<1f8~4Ns+iq;X>re3 zw|Mk-X2A$*j`I0#_od#z^22%UDJlSXPn@$Q>qOa$K&bqj=1S!zRv0Gl8q!l19ZqYz z!3=Md822xrE|!cbA2SJS-WD{Zk40-s@20~}Eo+#bPsy7;3L1=r8U$^!#oiYxf>1j_ zucvf7K`%m{o6fYFg(eKi&Psy61pt5y7}T9-pzB6M|K*b%1}*&V7?@;1971u6gXq~v zpwbJS1UtO}-JcPG9{s8TZUYgyv~pZ9l|tawLxL~NYpMHHU~rUpDe-wbwPA8RVG$>= zMD~ay_eQrVeaZ^@Ec<2;!01o4Vuko<0SSt_M|ew5yWEYSr+r9ZhGxh;7$rCX@ve}r gEic8H-ZL_ZJeBvD*du!I-#4JArLS3|ZXfl(09{gd3;+NC literal 0 HcmV?d00001 diff --git a/contract_recurring_plans/static/description/icon.svg b/contract_recurring_plans/static/description/icon.svg new file mode 100644 index 00000000..b52aec86 --- /dev/null +++ b/contract_recurring_plans/static/description/icon.svg @@ -0,0 +1,463 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + Pile of Golden Coins + 2010-04-09T03:27:45 + A pile of hypothetical golden coins, drawn in Inkscape. + https://openclipart.org/detail/43969/pile-of-golden-coins-by-j_alves + + + J_Alves + + + + + coin + currency + gold + money + thaler + + + + + + + + + + + diff --git a/contract_recurring_plans/tests/__init__.py b/contract_recurring_plans/tests/__init__.py new file mode 100644 index 00000000..d8b9e1ae --- /dev/null +++ b/contract_recurring_plans/tests/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# (c) 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import test_contract_recurring_plans diff --git a/contract_recurring_plans/tests/test_contract_recurring_plans.py b/contract_recurring_plans/tests/test_contract_recurring_plans.py new file mode 100644 index 00000000..3f248053 --- /dev/null +++ b/contract_recurring_plans/tests/test_contract_recurring_plans.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# (c) 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +import openerp.tests.common as common + + +class TestContractRecurringPlans(common.TransactionCase): + + def setUp(self): + super(TestContractRecurringPlans, self).setUp() + self.partner = self.env['res.partner'].create({'name': 'Test'}) + self.product = self.env.ref('product.product_product_consultant') + self.uom = self.env.ref('product.product_uom_hour') + self.contract = self.env['account.analytic.account'].create({ + 'name': 'Test contract', + 'partner_id': self.partner.id, + 'type': 'contract', + 'recurring_invoices': 1, + 'recurring_interval': 1, + 'recurring_invoice_line_ids': [ + (0, 0, {'quantity': 2.0, + 'price_unit': 100.0, + 'name': 'Test', + 'product_id': self.product.id, + 'uom_id': self.uom.id})], + }) + plan = self.env['account.analytic.plan'].create({'name': 'Test'}) + self.analytics = self.env['account.analytic.plan.instance'].create( + {'plan_id': plan.id}) + + def test_invoice_without_plans(self): + self.contract.recurring_create_invoice() + invoice = self.env['account.invoice'].search( + [('partner_id', '=', self.partner.id)]) + self.assertEqual( + invoice.invoice_line[0].account_analytic_id, self.contract) + + def test_invoice_with_plans(self): + self.contract.recurring_invoice_line_ids.analytics_id = ( + self.analytics.id) + self.contract.recurring_create_invoice() + invoice = self.env['account.invoice'].search( + [('partner_id', '=', self.partner.id)]) + self.assertFalse(invoice.invoice_line[0].account_analytic_id) + self.assertEqual( + invoice.invoice_line[0].analytics_id, self.analytics) diff --git a/contract_recurring_plans/views/account_analytic_invoice_line_view.xml b/contract_recurring_plans/views/account_analytic_invoice_line_view.xml new file mode 100644 index 00000000..4d164ffd --- /dev/null +++ b/contract_recurring_plans/views/account_analytic_invoice_line_view.xml @@ -0,0 +1,17 @@ + + + + + + Contract form (with plans) + account.analytic.account + + + + + + + + + + From bc4ec2437bed0e6cf0fd49926c18c129993accf8 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sun, 29 Nov 2015 21:23:22 -0500 Subject: [PATCH 2/5] OCA Transbot updated translations from Transifex --- contract_recurring_plans/i18n/en.po | 28 ++++++++++++++++++++++ contract_recurring_plans/i18n/es.po | 36 +++++++++++------------------ contract_recurring_plans/i18n/sl.po | 29 +++++++++++++++++++++++ 3 files changed, 71 insertions(+), 22 deletions(-) create mode 100644 contract_recurring_plans/i18n/en.po create mode 100644 contract_recurring_plans/i18n/sl.po diff --git a/contract_recurring_plans/i18n/en.po b/contract_recurring_plans/i18n/en.po new file mode 100644 index 00000000..d248f99f --- /dev/null +++ b/contract_recurring_plans/i18n/en.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_plans +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-11-30 01:38+0000\n" +"PO-Revision-Date: 2015-11-29 23:23+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: English (http://www.transifex.com/oca/OCA-contract-8-0/language/en/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: contract_recurring_plans +#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +msgid "Analytic Account" +msgstr "Analytic Account" + +#. module: contract_recurring_plans +#: field:account.analytic.invoice.line,analytics_id:0 +msgid "Analytic Distribution" +msgstr "Analytic Distribution" diff --git a/contract_recurring_plans/i18n/es.po b/contract_recurring_plans/i18n/es.po index 240ddd74..494fc31d 100644 --- a/contract_recurring_plans/i18n/es.po +++ b/contract_recurring_plans/i18n/es.po @@ -1,36 +1,28 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: -# * account_analytic_analysis_recurring_plans -# +# * contract_recurring_plans +# +# Translators: msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: contract (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-11-01 01:39+0000\n" -"PO-Revision-Date: 2014-11-01 01:39+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" +"POT-Creation-Date: 2015-11-30 01:38+0000\n" +"PO-Revision-Date: 2015-11-29 23:23+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-contract-8-0/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. module: account_analytic_analysis_recurring_plans -#: code:_description:0 -#: model:ir.model,name:account_analytic_analysis_recurring_plans.model_account_analytic_account -#, python-format +#. module: contract_recurring_plans +#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account msgid "Analytic Account" msgstr "Cuenta analítica" -#. module: account_analytic_analysis_recurring_plans +#. module: contract_recurring_plans #: field:account.analytic.invoice.line,analytics_id:0 msgid "Analytic Distribution" msgstr "Distribución analítica" - -#. module: account_analytic_analysis_recurring_plans -#: code:_description:0 -#: model:ir.model,name:account_analytic_analysis_recurring_plans.model_account_analytic_invoice_line -#, python-format -msgid "account.analytic.invoice.line" -msgstr "account.analytic.invoice.line" - diff --git a/contract_recurring_plans/i18n/sl.po b/contract_recurring_plans/i18n/sl.po new file mode 100644 index 00000000..2f513dbd --- /dev/null +++ b/contract_recurring_plans/i18n/sl.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_plans +# +# Translators: +# Matjaž Mozetič , 2015 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-11-30 04:18+0000\n" +"PO-Revision-Date: 2015-11-30 07:24+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-contract-8-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: contract_recurring_plans +#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +msgid "Analytic Account" +msgstr "Analitični konto" + +#. module: contract_recurring_plans +#: field:account.analytic.invoice.line,analytics_id:0 +msgid "Analytic Distribution" +msgstr "Analitična distribucija" From 94a3f11d7e37f7bb4115561c096d64f4caf483a8 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 8 Dec 2015 09:29:02 +0100 Subject: [PATCH 3/5] contract_recurring_plans: Author --- contract_recurring_plans/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contract_recurring_plans/__openerp__.py b/contract_recurring_plans/__openerp__.py index 739bedc6..f5dadd36 100644 --- a/contract_recurring_plans/__openerp__.py +++ b/contract_recurring_plans/__openerp__.py @@ -6,7 +6,7 @@ 'name': 'Analytic plans on contracts recurring invoices', 'version': '8.0.1.0.0', 'category': 'Contract Management', - 'author': 'Serv. Tecnolog. Avanzados - Pedro M. Baeza, ' + 'author': 'Serv. Tecnol. Avanzados - Pedro M. Baeza, ' 'Odoo Community Association (OCA)', 'website': 'http://www.serviciosbaeza.com', 'depends': [ From 891e4fd20a8eb4e11f7094111e2755cea83d952e Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sat, 23 Jan 2016 02:35:01 -0500 Subject: [PATCH 4/5] OCA Transbot updated translations from Transifex --- .../i18n/{en.po => ca.po} | 12 ++++---- contract_recurring_plans/i18n/de.po | 29 +++++++++++++++++++ contract_recurring_plans/i18n/el_GR.po | 28 ++++++++++++++++++ contract_recurring_plans/i18n/es_MX.po | 28 ++++++++++++++++++ contract_recurring_plans/i18n/fi.po | 29 +++++++++++++++++++ contract_recurring_plans/i18n/fr.po | 29 +++++++++++++++++++ contract_recurring_plans/i18n/pt_BR.po | 29 +++++++++++++++++++ contract_recurring_plans/i18n/sk_SK.po | 28 ++++++++++++++++++ 8 files changed, 206 insertions(+), 6 deletions(-) rename contract_recurring_plans/i18n/{en.po => ca.po} (71%) create mode 100644 contract_recurring_plans/i18n/de.po create mode 100644 contract_recurring_plans/i18n/el_GR.po create mode 100644 contract_recurring_plans/i18n/es_MX.po create mode 100644 contract_recurring_plans/i18n/fi.po create mode 100644 contract_recurring_plans/i18n/fr.po create mode 100644 contract_recurring_plans/i18n/pt_BR.po create mode 100644 contract_recurring_plans/i18n/sk_SK.po diff --git a/contract_recurring_plans/i18n/en.po b/contract_recurring_plans/i18n/ca.po similarity index 71% rename from contract_recurring_plans/i18n/en.po rename to contract_recurring_plans/i18n/ca.po index d248f99f..e64c80ac 100644 --- a/contract_recurring_plans/i18n/en.po +++ b/contract_recurring_plans/i18n/ca.po @@ -7,22 +7,22 @@ msgid "" msgstr "" "Project-Id-Version: contract (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-11-30 01:38+0000\n" +"POT-Creation-Date: 2017-01-20 18:39+0000\n" "PO-Revision-Date: 2015-11-29 23:23+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: English (http://www.transifex.com/oca/OCA-contract-8-0/language/en/)\n" +"Last-Translator: <>\n" +"Language-Team: Catalan (http://www.transifex.com/oca/OCA-contract-8-0/language/ca/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: en\n" +"Language: ca\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: contract_recurring_plans #: model:ir.model,name:contract_recurring_plans.model_account_analytic_account msgid "Analytic Account" -msgstr "Analytic Account" +msgstr "Compte analític" #. module: contract_recurring_plans #: field:account.analytic.invoice.line,analytics_id:0 msgid "Analytic Distribution" -msgstr "Analytic Distribution" +msgstr "" diff --git a/contract_recurring_plans/i18n/de.po b/contract_recurring_plans/i18n/de.po new file mode 100644 index 00000000..97a1cd02 --- /dev/null +++ b/contract_recurring_plans/i18n/de.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_plans +# +# Translators: +# Rudolf Schnapka , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-12-08 08:38+0000\n" +"PO-Revision-Date: 2016-01-14 14:23+0000\n" +"Last-Translator: Rudolf Schnapka \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-contract-8-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: contract_recurring_plans +#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +msgid "Analytic Account" +msgstr "Kostenstelle" + +#. module: contract_recurring_plans +#: field:account.analytic.invoice.line,analytics_id:0 +msgid "Analytic Distribution" +msgstr "Kostenumlage" diff --git a/contract_recurring_plans/i18n/el_GR.po b/contract_recurring_plans/i18n/el_GR.po new file mode 100644 index 00000000..a1692713 --- /dev/null +++ b/contract_recurring_plans/i18n/el_GR.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_plans +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-11-07 03:42+0000\n" +"PO-Revision-Date: 2015-11-29 23:23+0000\n" +"Last-Translator: <>\n" +"Language-Team: Greek (Greece) (http://www.transifex.com/oca/OCA-contract-8-0/language/el_GR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: el_GR\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: contract_recurring_plans +#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +msgid "Analytic Account" +msgstr "Αναλυτικός Λογαριασμός" + +#. module: contract_recurring_plans +#: field:account.analytic.invoice.line,analytics_id:0 +msgid "Analytic Distribution" +msgstr "" diff --git a/contract_recurring_plans/i18n/es_MX.po b/contract_recurring_plans/i18n/es_MX.po new file mode 100644 index 00000000..a075c460 --- /dev/null +++ b/contract_recurring_plans/i18n/es_MX.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_plans +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-12-03 01:11+0000\n" +"PO-Revision-Date: 2015-11-29 23:23+0000\n" +"Last-Translator: <>\n" +"Language-Team: Spanish (Mexico) (http://www.transifex.com/oca/OCA-contract-8-0/language/es_MX/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es_MX\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: contract_recurring_plans +#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +msgid "Analytic Account" +msgstr "Cuenta analítica" + +#. module: contract_recurring_plans +#: field:account.analytic.invoice.line,analytics_id:0 +msgid "Analytic Distribution" +msgstr "" diff --git a/contract_recurring_plans/i18n/fi.po b/contract_recurring_plans/i18n/fi.po new file mode 100644 index 00000000..d1bcd45d --- /dev/null +++ b/contract_recurring_plans/i18n/fi.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_plans +# +# Translators: +# Jarmo Kortetjärvi , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-05-28 11:00+0000\n" +"PO-Revision-Date: 2016-07-08 10:45+0000\n" +"Last-Translator: Jarmo Kortetjärvi \n" +"Language-Team: Finnish (http://www.transifex.com/oca/OCA-contract-8-0/language/fi/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fi\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: contract_recurring_plans +#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +msgid "Analytic Account" +msgstr "Analyyttinen tili" + +#. module: contract_recurring_plans +#: field:account.analytic.invoice.line,analytics_id:0 +msgid "Analytic Distribution" +msgstr "Analyyttinen jakelu" diff --git a/contract_recurring_plans/i18n/fr.po b/contract_recurring_plans/i18n/fr.po new file mode 100644 index 00000000..c58eb417 --- /dev/null +++ b/contract_recurring_plans/i18n/fr.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_plans +# +# Translators: +# Christophe CHAUVET , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-30 10:34+0000\n" +"PO-Revision-Date: 2016-05-19 16:11+0000\n" +"Last-Translator: Christophe CHAUVET \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-contract-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: contract_recurring_plans +#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +msgid "Analytic Account" +msgstr "Compte analytique" + +#. module: contract_recurring_plans +#: field:account.analytic.invoice.line,analytics_id:0 +msgid "Analytic Distribution" +msgstr "Distribution analytique" diff --git a/contract_recurring_plans/i18n/pt_BR.po b/contract_recurring_plans/i18n/pt_BR.po new file mode 100644 index 00000000..ffe69f1b --- /dev/null +++ b/contract_recurring_plans/i18n/pt_BR.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_plans +# +# Translators: +# danimaribeiro , 2016 +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-08 01:39+0000\n" +"PO-Revision-Date: 2016-03-05 18:19+0000\n" +"Last-Translator: danimaribeiro \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-contract-8-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: contract_recurring_plans +#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +msgid "Analytic Account" +msgstr "Conta analítica" + +#. module: contract_recurring_plans +#: field:account.analytic.invoice.line,analytics_id:0 +msgid "Analytic Distribution" +msgstr "Distribuição analítica" diff --git a/contract_recurring_plans/i18n/sk_SK.po b/contract_recurring_plans/i18n/sk_SK.po new file mode 100644 index 00000000..ab2c7c13 --- /dev/null +++ b/contract_recurring_plans/i18n/sk_SK.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * contract_recurring_plans +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: contract (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-05-21 10:53+0000\n" +"PO-Revision-Date: 2015-11-29 23:23+0000\n" +"Last-Translator: <>\n" +"Language-Team: Slovak (Slovakia) (http://www.transifex.com/oca/OCA-contract-8-0/language/sk_SK/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sk_SK\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: contract_recurring_plans +#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +msgid "Analytic Account" +msgstr "Analytický účet" + +#. module: contract_recurring_plans +#: field:account.analytic.invoice.line,analytics_id:0 +msgid "Analytic Distribution" +msgstr "" From ef113db033576d17a4a98e8fbcf642bc10d594a6 Mon Sep 17 00:00:00 2001 From: cubells Date: Thu, 27 Apr 2017 23:04:44 +0200 Subject: [PATCH 5/5] [MIG][9.0] contract_recurring_plans module --- .../README.rst | 24 +++--- .../__init__.py | 2 +- .../__openerp__.py | 14 ++-- .../i18n/ca.po | 8 +- .../i18n/de.po | 8 +- .../i18n/el_GR.po | 8 +- .../i18n/es.po | 8 +- .../i18n/es_MX.po | 8 +- .../i18n/fi.po | 8 +- .../i18n/fr.po | 8 +- .../i18n/pt_BR.po | 8 +- .../i18n/sk_SK.po | 8 +- .../i18n/sl.po | 8 +- .../models/__init__.py | 5 ++ .../models/account_analytic_invoice_line.py | 18 +++-- .../static/description/icon.png | Bin .../static/description/icon.svg | 0 .../tests}/__init__.py | 2 +- .../test_contract_recurring_distribution.py | 69 ++++++++++++++++++ .../account_analytic_invoice_line_view.xml | 15 ++++ contract_recurring_plans/tests/__init__.py | 5 -- .../tests/test_contract_recurring_plans.py | 47 ------------ .../account_analytic_invoice_line_view.xml | 17 ----- oca_dependencies.txt | 1 + 24 files changed, 162 insertions(+), 137 deletions(-) rename {contract_recurring_plans => contract_recurring_analytic_distribution}/README.rst (60%) rename {contract_recurring_plans => contract_recurring_analytic_distribution}/__init__.py (68%) rename {contract_recurring_plans => contract_recurring_analytic_distribution}/__openerp__.py (57%) rename {contract_recurring_plans => contract_recurring_analytic_distribution}/i18n/ca.po (74%) rename {contract_recurring_plans => contract_recurring_analytic_distribution}/i18n/de.po (76%) rename {contract_recurring_plans => contract_recurring_analytic_distribution}/i18n/el_GR.po (75%) rename {contract_recurring_plans => contract_recurring_analytic_distribution}/i18n/es.po (75%) rename {contract_recurring_plans => contract_recurring_analytic_distribution}/i18n/es_MX.po (74%) rename {contract_recurring_plans => contract_recurring_analytic_distribution}/i18n/fi.po (77%) rename {contract_recurring_plans => contract_recurring_analytic_distribution}/i18n/fr.po (77%) rename {contract_recurring_plans => contract_recurring_analytic_distribution}/i18n/pt_BR.po (77%) rename {contract_recurring_plans => contract_recurring_analytic_distribution}/i18n/sk_SK.po (75%) rename {contract_recurring_plans => contract_recurring_analytic_distribution}/i18n/sl.po (78%) create mode 100644 contract_recurring_analytic_distribution/models/__init__.py rename {contract_recurring_plans => contract_recurring_analytic_distribution}/models/account_analytic_invoice_line.py (52%) rename {contract_recurring_plans => contract_recurring_analytic_distribution}/static/description/icon.png (100%) rename {contract_recurring_plans => contract_recurring_analytic_distribution}/static/description/icon.svg (100%) rename {contract_recurring_plans/models => contract_recurring_analytic_distribution/tests}/__init__.py (73%) create mode 100644 contract_recurring_analytic_distribution/tests/test_contract_recurring_distribution.py create mode 100644 contract_recurring_analytic_distribution/views/account_analytic_invoice_line_view.xml delete mode 100644 contract_recurring_plans/tests/__init__.py delete mode 100644 contract_recurring_plans/tests/test_contract_recurring_plans.py delete mode 100644 contract_recurring_plans/views/account_analytic_invoice_line_view.xml diff --git a/contract_recurring_plans/README.rst b/contract_recurring_analytic_distribution/README.rst similarity index 60% rename from contract_recurring_plans/README.rst rename to contract_recurring_analytic_distribution/README.rst index abb1ee5a..5ea404e3 100644 --- a/contract_recurring_plans/README.rst +++ b/contract_recurring_analytic_distribution/README.rst @@ -6,9 +6,9 @@ Analytic plans for contract recurring invoices ============================================== -This module allows to include an analytic plan on each recurring invoice line, -so if you set it, this will be taken to be transferred to the invoice instead -of the analytic account of the contract. +This module allows to include an analytic distribution on each recurring +invoice line, so if you set it, this will be taken to be transferred to the +invoice instead of the analytic account of the contract. Usage ===== @@ -18,18 +18,15 @@ invoice recurring lines that you want. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/110/8.0 + :target: https://runbot.odoo-community.org/runbot/110/9.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 smashing it by providing a detailed and welcomed feedback `here `_. +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 ======= @@ -37,7 +34,8 @@ Credits Contributors ------------ -* Pedro M. Baeza +* Pedro M. Baeza +* Vicent Cubells Icon ---- @@ -59,4 +57,4 @@ 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 http://odoo-community.org. +To contribute to this module, please visit https://odoo-community.org. diff --git a/contract_recurring_plans/__init__.py b/contract_recurring_analytic_distribution/__init__.py similarity index 68% rename from contract_recurring_plans/__init__.py rename to contract_recurring_analytic_distribution/__init__.py index 721dbe49..6af6a042 100644 --- a/contract_recurring_plans/__init__.py +++ b/contract_recurring_analytic_distribution/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (c) 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza +# Copyright 2015 Tecnativa - Pedro M. Baeza # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from . import models diff --git a/contract_recurring_plans/__openerp__.py b/contract_recurring_analytic_distribution/__openerp__.py similarity index 57% rename from contract_recurring_plans/__openerp__.py rename to contract_recurring_analytic_distribution/__openerp__.py index f5dadd36..df9e40f7 100644 --- a/contract_recurring_plans/__openerp__.py +++ b/contract_recurring_analytic_distribution/__openerp__.py @@ -1,17 +1,19 @@ # -*- coding: utf-8 -*- -# (c) 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza +# Copyright 2015 Tecnativa - Pedro M. Baeza +# Copyright 2017 Tecnativa - Vicent Cubells # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { 'name': 'Analytic plans on contracts recurring invoices', - 'version': '8.0.1.0.0', + 'version': '9.0.1.0.0', 'category': 'Contract Management', - 'author': 'Serv. Tecnol. Avanzados - Pedro M. Baeza, ' + 'author': 'Tecnativa, ' 'Odoo Community Association (OCA)', - 'website': 'http://www.serviciosbaeza.com', + 'website': 'http://www.tecnativa.com', + 'license': 'AGPL-3', 'depends': [ - 'account_analytic_plans', - 'account_analytic_analysis', + 'account_analytic_distribution', + 'contract', ], 'data': [ 'views/account_analytic_invoice_line_view.xml', diff --git a/contract_recurring_plans/i18n/ca.po b/contract_recurring_analytic_distribution/i18n/ca.po similarity index 74% rename from contract_recurring_plans/i18n/ca.po rename to contract_recurring_analytic_distribution/i18n/ca.po index e64c80ac..2efebf77 100644 --- a/contract_recurring_plans/i18n/ca.po +++ b/contract_recurring_analytic_distribution/i18n/ca.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * contract_recurring_plans +# * contract_recurring_analytic_distribution # # Translators: msgid "" @@ -17,12 +17,12 @@ msgstr "" "Language: ca\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. module: contract_recurring_plans -#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +#. module: contract_recurring_analytic_distribution +#: model:ir.model,name:contract_recurring_analytic_distribution.model_account_analytic_account msgid "Analytic Account" msgstr "Compte analític" -#. module: contract_recurring_plans +#. module: contract_recurring_analytic_distribution #: field:account.analytic.invoice.line,analytics_id:0 msgid "Analytic Distribution" msgstr "" diff --git a/contract_recurring_plans/i18n/de.po b/contract_recurring_analytic_distribution/i18n/de.po similarity index 76% rename from contract_recurring_plans/i18n/de.po rename to contract_recurring_analytic_distribution/i18n/de.po index 97a1cd02..494851a2 100644 --- a/contract_recurring_plans/i18n/de.po +++ b/contract_recurring_analytic_distribution/i18n/de.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * contract_recurring_plans +# * contract_recurring_analytic_distribution # # Translators: # Rudolf Schnapka , 2016 @@ -18,12 +18,12 @@ msgstr "" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. module: contract_recurring_plans -#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +#. module: contract_recurring_analytic_distribution +#: model:ir.model,name:contract_recurring_analytic_distribution.model_account_analytic_account msgid "Analytic Account" msgstr "Kostenstelle" -#. module: contract_recurring_plans +#. module: contract_recurring_analytic_distribution #: field:account.analytic.invoice.line,analytics_id:0 msgid "Analytic Distribution" msgstr "Kostenumlage" diff --git a/contract_recurring_plans/i18n/el_GR.po b/contract_recurring_analytic_distribution/i18n/el_GR.po similarity index 75% rename from contract_recurring_plans/i18n/el_GR.po rename to contract_recurring_analytic_distribution/i18n/el_GR.po index a1692713..5598e3fd 100644 --- a/contract_recurring_plans/i18n/el_GR.po +++ b/contract_recurring_analytic_distribution/i18n/el_GR.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * contract_recurring_plans +# * contract_recurring_analytic_distribution # # Translators: msgid "" @@ -17,12 +17,12 @@ msgstr "" "Language: el_GR\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. module: contract_recurring_plans -#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +#. module: contract_recurring_analytic_distribution +#: model:ir.model,name:contract_recurring_analytic_distribution.model_account_analytic_account msgid "Analytic Account" msgstr "Αναλυτικός Λογαριασμός" -#. module: contract_recurring_plans +#. module: contract_recurring_analytic_distribution #: field:account.analytic.invoice.line,analytics_id:0 msgid "Analytic Distribution" msgstr "" diff --git a/contract_recurring_plans/i18n/es.po b/contract_recurring_analytic_distribution/i18n/es.po similarity index 75% rename from contract_recurring_plans/i18n/es.po rename to contract_recurring_analytic_distribution/i18n/es.po index 494fc31d..5b39583b 100644 --- a/contract_recurring_plans/i18n/es.po +++ b/contract_recurring_analytic_distribution/i18n/es.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * contract_recurring_plans +# * contract_recurring_analytic_distribution # # Translators: msgid "" @@ -17,12 +17,12 @@ msgstr "" "Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. module: contract_recurring_plans -#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +#. module: contract_recurring_analytic_distribution +#: model:ir.model,name:contract_recurring_analytic_distribution.model_account_analytic_account msgid "Analytic Account" msgstr "Cuenta analítica" -#. module: contract_recurring_plans +#. module: contract_recurring_analytic_distribution #: field:account.analytic.invoice.line,analytics_id:0 msgid "Analytic Distribution" msgstr "Distribución analítica" diff --git a/contract_recurring_plans/i18n/es_MX.po b/contract_recurring_analytic_distribution/i18n/es_MX.po similarity index 74% rename from contract_recurring_plans/i18n/es_MX.po rename to contract_recurring_analytic_distribution/i18n/es_MX.po index a075c460..22e52dea 100644 --- a/contract_recurring_plans/i18n/es_MX.po +++ b/contract_recurring_analytic_distribution/i18n/es_MX.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * contract_recurring_plans +# * contract_recurring_analytic_distribution # # Translators: msgid "" @@ -17,12 +17,12 @@ msgstr "" "Language: es_MX\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. module: contract_recurring_plans -#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +#. module: contract_recurring_analytic_distribution +#: model:ir.model,name:contract_recurring_analytic_distribution.model_account_analytic_account msgid "Analytic Account" msgstr "Cuenta analítica" -#. module: contract_recurring_plans +#. module: contract_recurring_analytic_distribution #: field:account.analytic.invoice.line,analytics_id:0 msgid "Analytic Distribution" msgstr "" diff --git a/contract_recurring_plans/i18n/fi.po b/contract_recurring_analytic_distribution/i18n/fi.po similarity index 77% rename from contract_recurring_plans/i18n/fi.po rename to contract_recurring_analytic_distribution/i18n/fi.po index d1bcd45d..39f0dcb0 100644 --- a/contract_recurring_plans/i18n/fi.po +++ b/contract_recurring_analytic_distribution/i18n/fi.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * contract_recurring_plans +# * contract_recurring_analytic_distribution # # Translators: # Jarmo Kortetjärvi , 2016 @@ -18,12 +18,12 @@ msgstr "" "Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. module: contract_recurring_plans -#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +#. module: contract_recurring_analytic_distribution +#: model:ir.model,name:contract_recurring_analytic_distribution.model_account_analytic_account msgid "Analytic Account" msgstr "Analyyttinen tili" -#. module: contract_recurring_plans +#. module: contract_recurring_analytic_distribution #: field:account.analytic.invoice.line,analytics_id:0 msgid "Analytic Distribution" msgstr "Analyyttinen jakelu" diff --git a/contract_recurring_plans/i18n/fr.po b/contract_recurring_analytic_distribution/i18n/fr.po similarity index 77% rename from contract_recurring_plans/i18n/fr.po rename to contract_recurring_analytic_distribution/i18n/fr.po index c58eb417..abd6b50c 100644 --- a/contract_recurring_plans/i18n/fr.po +++ b/contract_recurring_analytic_distribution/i18n/fr.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * contract_recurring_plans +# * contract_recurring_analytic_distribution # # Translators: # Christophe CHAUVET , 2016 @@ -18,12 +18,12 @@ msgstr "" "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#. module: contract_recurring_plans -#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +#. module: contract_recurring_analytic_distribution +#: model:ir.model,name:contract_recurring_analytic_distribution.model_account_analytic_account msgid "Analytic Account" msgstr "Compte analytique" -#. module: contract_recurring_plans +#. module: contract_recurring_analytic_distribution #: field:account.analytic.invoice.line,analytics_id:0 msgid "Analytic Distribution" msgstr "Distribution analytique" diff --git a/contract_recurring_plans/i18n/pt_BR.po b/contract_recurring_analytic_distribution/i18n/pt_BR.po similarity index 77% rename from contract_recurring_plans/i18n/pt_BR.po rename to contract_recurring_analytic_distribution/i18n/pt_BR.po index ffe69f1b..348d49c4 100644 --- a/contract_recurring_plans/i18n/pt_BR.po +++ b/contract_recurring_analytic_distribution/i18n/pt_BR.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * contract_recurring_plans +# * contract_recurring_analytic_distribution # # Translators: # danimaribeiro , 2016 @@ -18,12 +18,12 @@ msgstr "" "Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#. module: contract_recurring_plans -#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +#. module: contract_recurring_analytic_distribution +#: model:ir.model,name:contract_recurring_analytic_distribution.model_account_analytic_account msgid "Analytic Account" msgstr "Conta analítica" -#. module: contract_recurring_plans +#. module: contract_recurring_analytic_distribution #: field:account.analytic.invoice.line,analytics_id:0 msgid "Analytic Distribution" msgstr "Distribuição analítica" diff --git a/contract_recurring_plans/i18n/sk_SK.po b/contract_recurring_analytic_distribution/i18n/sk_SK.po similarity index 75% rename from contract_recurring_plans/i18n/sk_SK.po rename to contract_recurring_analytic_distribution/i18n/sk_SK.po index ab2c7c13..f3d63f5c 100644 --- a/contract_recurring_plans/i18n/sk_SK.po +++ b/contract_recurring_analytic_distribution/i18n/sk_SK.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * contract_recurring_plans +# * contract_recurring_analytic_distribution # # Translators: msgid "" @@ -17,12 +17,12 @@ msgstr "" "Language: sk_SK\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -#. module: contract_recurring_plans -#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +#. module: contract_recurring_analytic_distribution +#: model:ir.model,name:contract_recurring_analytic_distribution.model_account_analytic_account msgid "Analytic Account" msgstr "Analytický účet" -#. module: contract_recurring_plans +#. module: contract_recurring_analytic_distribution #: field:account.analytic.invoice.line,analytics_id:0 msgid "Analytic Distribution" msgstr "" diff --git a/contract_recurring_plans/i18n/sl.po b/contract_recurring_analytic_distribution/i18n/sl.po similarity index 78% rename from contract_recurring_plans/i18n/sl.po rename to contract_recurring_analytic_distribution/i18n/sl.po index 2f513dbd..15d523c2 100644 --- a/contract_recurring_plans/i18n/sl.po +++ b/contract_recurring_analytic_distribution/i18n/sl.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * contract_recurring_plans +# * contract_recurring_analytic_distribution # # Translators: # Matjaž Mozetič , 2015 @@ -18,12 +18,12 @@ msgstr "" "Language: sl\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" -#. module: contract_recurring_plans -#: model:ir.model,name:contract_recurring_plans.model_account_analytic_account +#. module: contract_recurring_analytic_distribution +#: model:ir.model,name:contract_recurring_analytic_distribution.model_account_analytic_account msgid "Analytic Account" msgstr "Analitični konto" -#. module: contract_recurring_plans +#. module: contract_recurring_analytic_distribution #: field:account.analytic.invoice.line,analytics_id:0 msgid "Analytic Distribution" msgstr "Analitična distribucija" diff --git a/contract_recurring_analytic_distribution/models/__init__.py b/contract_recurring_analytic_distribution/models/__init__.py new file mode 100644 index 00000000..4c204bd9 --- /dev/null +++ b/contract_recurring_analytic_distribution/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2015 Tecnativa - Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from . import account_analytic_invoice_line diff --git a/contract_recurring_plans/models/account_analytic_invoice_line.py b/contract_recurring_analytic_distribution/models/account_analytic_invoice_line.py similarity index 52% rename from contract_recurring_plans/models/account_analytic_invoice_line.py rename to contract_recurring_analytic_distribution/models/account_analytic_invoice_line.py index 3b0660a6..13ebe390 100644 --- a/contract_recurring_plans/models/account_analytic_invoice_line.py +++ b/contract_recurring_analytic_distribution/models/account_analytic_invoice_line.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- -# (c) 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza +# Copyright 2015 Tecnativa - Pedro M. Baeza +# Copyright 2017 Tecnativa - Vicent Cubells # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, fields, api @@ -12,15 +13,18 @@ class AccountAnalyticAccount(models.Model): def _prepare_invoice_line(self, line, invoice_id): res = super(AccountAnalyticAccount, self)._prepare_invoice_line( line, invoice_id) - if line.analytics_id: - res.update({'account_analytic_id': False, - 'analytics_id': line.analytics_id.id}) + if line.analytic_distribution_id: + res.update({ + 'account_analytic_id': False, + 'analytic_distribution_id': line.analytic_distribution_id.id, + }) return res class AccountAnalyticInvoiceLine(models.Model): _inherit = "account.analytic.invoice.line" - analytics_id = fields.Many2one( - comodel_name='account.analytic.plan.instance', - string='Analytic Distribution') + analytic_distribution_id = fields.Many2one( + comodel_name='account.analytic.distribution', + string='Analytic Distribution', oldname='analytics_id', + ) diff --git a/contract_recurring_plans/static/description/icon.png b/contract_recurring_analytic_distribution/static/description/icon.png similarity index 100% rename from contract_recurring_plans/static/description/icon.png rename to contract_recurring_analytic_distribution/static/description/icon.png diff --git a/contract_recurring_plans/static/description/icon.svg b/contract_recurring_analytic_distribution/static/description/icon.svg similarity index 100% rename from contract_recurring_plans/static/description/icon.svg rename to contract_recurring_analytic_distribution/static/description/icon.svg diff --git a/contract_recurring_plans/models/__init__.py b/contract_recurring_analytic_distribution/tests/__init__.py similarity index 73% rename from contract_recurring_plans/models/__init__.py rename to contract_recurring_analytic_distribution/tests/__init__.py index 5c3342b8..55df91fd 100644 --- a/contract_recurring_plans/models/__init__.py +++ b/contract_recurring_analytic_distribution/tests/__init__.py @@ -2,4 +2,4 @@ # (c) 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -from . import account_analytic_invoice_line +from . import test_contract_recurring_distribution diff --git a/contract_recurring_analytic_distribution/tests/test_contract_recurring_distribution.py b/contract_recurring_analytic_distribution/tests/test_contract_recurring_distribution.py new file mode 100644 index 00000000..d76196fc --- /dev/null +++ b/contract_recurring_analytic_distribution/tests/test_contract_recurring_distribution.py @@ -0,0 +1,69 @@ +# -*- coding: utf-8 -*- +# Copyright 2015 Tecnativa - Pedro M. Baeza +# Copyright 2017 Tecnativa - Vicent Cubells +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +import openerp.tests.common as common + + +class TestContractRecurringDistribution(common.SavepointCase): + @classmethod + def setUpClass(cls): + super(TestContractRecurringDistribution, cls).setUpClass() + cls.partner = cls.env['res.partner'].create({'name': 'Test'}) + cls.product = cls.env['product.product'].create({ + 'name': 'Test product', + }) + cls.account1 = cls.env['account.analytic.account'].create({ + 'name': 'Test account #1', + }) + cls.account2 = cls.env['account.analytic.account'].create({ + 'name': 'Test account #2', + }) + cls.uom = cls.env.ref('product.product_uom_hour') + cls.contract = cls.env['account.analytic.account'].create({ + 'name': 'Test contract', + 'partner_id': cls.partner.id, + 'type': 'contract', + 'recurring_invoices': 1, + 'recurring_interval': 1, + 'recurring_invoice_line_ids': [ + (0, 0, {'quantity': 2.0, + 'price_unit': 100.0, + 'name': 'Test', + 'product_id': cls.product.id, + 'uom_id': cls.uom.id})], + }) + cls.distribution = cls.env['account.analytic.distribution'].create({ + 'name': 'Test distribution', + 'rule_ids': [ + (0, 0, { + 'sequence': 10, + 'percent': 75.00, + 'analytic_account_id': cls.account1.id, + }), + (0, 0, { + 'sequence': 20, + 'percent': 25.00, + 'analytic_account_id': cls.account2.id, + }), + ] + }) + + def test_invoice_without_distribution(self): + self.contract.recurring_create_invoice() + invoice = self.env['account.invoice'].search( + [('partner_id', '=', self.partner.id)]) + self.assertEqual( + invoice.invoice_line_ids[0].account_analytic_id, self.contract) + + def test_invoice_with_distribution(self): + self.contract.recurring_invoice_line_ids.analytic_distribution_id = ( + self.distribution.id) + self.contract.recurring_create_invoice() + invoice = self.env['account.invoice'].search( + [('partner_id', '=', self.partner.id)]) + self.assertFalse(invoice.invoice_line_ids[0].account_analytic_id) + self.assertEqual( + invoice.invoice_line_ids[0].analytic_distribution_id, + self.distribution) diff --git a/contract_recurring_analytic_distribution/views/account_analytic_invoice_line_view.xml b/contract_recurring_analytic_distribution/views/account_analytic_invoice_line_view.xml new file mode 100644 index 00000000..bcc75fd5 --- /dev/null +++ b/contract_recurring_analytic_distribution/views/account_analytic_invoice_line_view.xml @@ -0,0 +1,15 @@ + + + + + Contract form (with plans) + account.analytic.account + + + + + + + + + diff --git a/contract_recurring_plans/tests/__init__.py b/contract_recurring_plans/tests/__init__.py deleted file mode 100644 index d8b9e1ae..00000000 --- a/contract_recurring_plans/tests/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# -*- coding: utf-8 -*- -# (c) 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza -# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html - -from . import test_contract_recurring_plans diff --git a/contract_recurring_plans/tests/test_contract_recurring_plans.py b/contract_recurring_plans/tests/test_contract_recurring_plans.py deleted file mode 100644 index 3f248053..00000000 --- a/contract_recurring_plans/tests/test_contract_recurring_plans.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -# (c) 2015 Serv. Tecnol. Avanzados - Pedro M. Baeza -# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html - -import openerp.tests.common as common - - -class TestContractRecurringPlans(common.TransactionCase): - - def setUp(self): - super(TestContractRecurringPlans, self).setUp() - self.partner = self.env['res.partner'].create({'name': 'Test'}) - self.product = self.env.ref('product.product_product_consultant') - self.uom = self.env.ref('product.product_uom_hour') - self.contract = self.env['account.analytic.account'].create({ - 'name': 'Test contract', - 'partner_id': self.partner.id, - 'type': 'contract', - 'recurring_invoices': 1, - 'recurring_interval': 1, - 'recurring_invoice_line_ids': [ - (0, 0, {'quantity': 2.0, - 'price_unit': 100.0, - 'name': 'Test', - 'product_id': self.product.id, - 'uom_id': self.uom.id})], - }) - plan = self.env['account.analytic.plan'].create({'name': 'Test'}) - self.analytics = self.env['account.analytic.plan.instance'].create( - {'plan_id': plan.id}) - - def test_invoice_without_plans(self): - self.contract.recurring_create_invoice() - invoice = self.env['account.invoice'].search( - [('partner_id', '=', self.partner.id)]) - self.assertEqual( - invoice.invoice_line[0].account_analytic_id, self.contract) - - def test_invoice_with_plans(self): - self.contract.recurring_invoice_line_ids.analytics_id = ( - self.analytics.id) - self.contract.recurring_create_invoice() - invoice = self.env['account.invoice'].search( - [('partner_id', '=', self.partner.id)]) - self.assertFalse(invoice.invoice_line[0].account_analytic_id) - self.assertEqual( - invoice.invoice_line[0].analytics_id, self.analytics) diff --git a/contract_recurring_plans/views/account_analytic_invoice_line_view.xml b/contract_recurring_plans/views/account_analytic_invoice_line_view.xml deleted file mode 100644 index 4d164ffd..00000000 --- a/contract_recurring_plans/views/account_analytic_invoice_line_view.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - Contract form (with plans) - account.analytic.account - - - - - - - - - - diff --git a/oca_dependencies.txt b/oca_dependencies.txt index 2435958d..3e754256 100644 --- a/oca_dependencies.txt +++ b/oca_dependencies.txt @@ -14,5 +14,6 @@ # To provide both the URL and a branch, use: # sale-workflow https://github.com/OCA/sale-workflow branchname +account-analytic account-invoicing bank-payment