Tryton - Issues

 

Issue7630

Title @classmethod with 1st argument self (instead of cls)
Priority bug Status resolved
Superseder Nosy List ced, fgui, pokoli, reviewbot, roundup-bot
Type feature request Components
Assigned To ced Keywords easy, review
Reviews 74341002
View: 74341002

Created on 2018-08-17.09:34:07 by fgui, last changed by roundup-bot.

Messages
New changeset f9cceec543d1 by Cédric Krier in branch 'default':
Replace self by cls in classmethod
https://hg.tryton.org/tryton-env/rev/f9cceec543d1
New changeset 4e3e824f0180 by Cédric Krier in branch 'default':
Replace self by cls in classmethod
https://hg.tryton.org/tryton/rev/4e3e824f0180
New changeset 5fc431b7ef34 by Cédric Krier in branch 'default':
Replace self by cls in classmethod
https://hg.tryton.org/modules/timesheet/rev/5fc431b7ef34
New changeset cc41ddb9ee52 by Cédric Krier in branch 'default':
Replace self by cls in classmethod
https://hg.tryton.org/modules/stock_forecast/rev/cc41ddb9ee52
New changeset 43e75d632820 by Cédric Krier in branch 'default':
Replace self by cls in classmethod
https://hg.tryton.org/modules/stock/rev/43e75d632820
New changeset 90c610ed5b3e by Cédric Krier in branch 'default':
Replace self by cls in classmethod
https://hg.tryton.org/modules/sale_subscription/rev/90c610ed5b3e
New changeset aeab560c0b23 by Cédric Krier in branch 'default':
Replace self by cls in classmethod
https://hg.tryton.org/modules/production/rev/aeab560c0b23
New changeset d96abda94c84 by Cédric Krier in branch 'default':
Replace self by cls in classmethod
https://hg.tryton.org/modules/currency/rev/d96abda94c84
New changeset 716db8ac55d7 by Cédric Krier in branch 'default':
Replace self by cls in classmethod
https://hg.tryton.org/modules/account_payment_sepa/rev/716db8ac55d7
New changeset 766737a10c05 by Cédric Krier in branch 'default':
Replace self by cls in classmethod
https://hg.tryton.org/modules/account_invoice/rev/766737a10c05
review74341002 updated at https://codereview.tryton.org/74341002/#ps1
msg43924 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-09-17.18:13:28
Here is review74341002
msg42935 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-08-17.17:35:49
Hi Francesc,

Thanks for reporting. It will be great to submit a patch for it following: 

http://www.tryton.org/how-to-contribute.html
msg42933 (view) Author: [hidden] (fgui) Date: 2018-08-17.09:34:07
There a few places where @classmethods have a first argument named self instead of cls.

https://www.python.org/dev/peps/pep-0008/#function-and-method-arguments

ag @classmethod -A2 | grep self -B1
trytond/modules/stock_forecast/forecast.py:234:    @classmethod
trytond/modules/stock_forecast/forecast.py:235-    def delete(self, forecasts):
--
trytond/modules/currency/currency.py:246:    @classmethod
trytond/modules/currency/currency.py:247-    def check_xml_record(self, records, values):
--
trytond/modules/timesheet/line.py:280:    @classmethod
trytond/modules/timesheet/line.py:281-    def search_week(self, name, domain):
--
trytond/modules/timesheet/line.py:334:    @classmethod
trytond/modules/timesheet/line.py:335-    def search_month(self, name, domain):
--
trytond/modules/stock/shipment.py:1386:    @classmethod
trytond/modules/stock/shipment.py:1387-    def _set_move_planned_date(self, shipments):
--
trytond/modules/stock/location.py:276:    @classmethod
trytond/modules/stock/location.py:277-    def check_xml_record(self, records, values):
--
trytond/modules/production/production.py:605-    @ModelView.button_action('production.wizard_assign')
trytond/modules/production/production.py:606-    def assign_wizard(self, productions):
--
trytond/modules/sale_subscription/service.py:29:    @classmethod
trytond/modules/sale_subscription/service.py:30-    def search_rec_name(self, name, clause):
--
trytond/modules/account_payment_sepa/payment.py:550:    @classmethod
trytond/modules/account_payment_sepa/payment.py:551-    def has_payments(self, mandates, name):
--
trytond/modules/account_invoice/invoice.py:476:    @classmethod
trytond/modules/account_invoice/invoice.py:477-    def get_type_name(self, invoices, name):
History
Date User Action Args
2018-09-19 00:16:54roundup-botsetmessages: + msg43962
2018-09-19 00:16:52roundup-botsetmessages: + msg43961
2018-09-19 00:16:48roundup-botsetmessages: + msg43960
2018-09-19 00:16:46roundup-botsetmessages: + msg43959
2018-09-19 00:16:43roundup-botsetmessages: + msg43958
2018-09-19 00:16:40roundup-botsetmessages: + msg43957
2018-09-19 00:16:37roundup-botsetmessages: + msg43956
2018-09-19 00:16:33roundup-botsetmessages: + msg43955
2018-09-19 00:16:26roundup-botsetmessages: + msg43954
2018-09-19 00:16:19roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg43953

Showing 10 items. Show all history (warning: this could be VERY long)