muralikrishnareddy / website_account

0 stars 3 forks source link

Integer and Date format problems. #1

Open AizenL opened 8 years ago

AizenL commented 8 years ago

Hi. Im getting this errors.

TypeError: unsupported operand type(s) for +: 'bool' and 'str' 

DataError: Hours value is out of range: «3-30-2016»
LINE 1: ...016'))  AND  ("account_fiscalyear"."date_stop" >= '3-30-2016...

Odoo Version: 8.0-20160304

muralikrishnareddy commented 8 years ago

Give me some more details

AizenL commented 8 years ago

Hi. I go to Accounting - Reports - Balance Sheet - Generate a Balance from 01/12/2015 to 12/12/2015 and I get this error:

Traceback (most recent call last):
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_20160322-py2.7.egg/openerp/http.py", line 539, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_20160322-py2.7.egg/openerp/http.py", line 576, in dispatch
    result = self._call_function(**self.params)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_20160322-py2.7.egg/openerp/http.py", line 312, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_20160322-py2.7.egg/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_20160322-py2.7.egg/openerp/http.py", line 309, in checked_call
    return self.endpoint(*a, **kw)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_20160322-py2.7.egg/openerp/http.py", line 805, in __call__
    return self.method(*args, **kw)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_20160322-py2.7.egg/openerp/http.py", line 405, in response_wrap
    response = f(*args, **kw)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/addons/web/controllers/main.py", line 949, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/addons/web/controllers/main.py", line 941, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_20160322-py2.7.egg/openerp/api.py", line 268, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/addons/website_account/account.py", line 684, in get_lines_balance_sheet
    parents = self.get_parents(cr, uid, lines, context=data['form']['used_context'])
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_20160322-py2.7.egg/openerp/api.py", line 268, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/addons/website_account/account.py", line 98, in get_parents
    'parent_name':account.parent_id.code + ' ' + account.parent_id.name,
TypeError: unsupported operand type(s) for +: 'bool' and 'str' 

Im using latest Odoo version. Im Running on Ubuntu. All reports works well except "Balance Sheet"

muralikrishnareddy commented 8 years ago

Balance sheet won't have two dates selection, for Balance Sheet always As of Date selection will be there. for other reports we can select the Date Range, but not for Balance sheet.

muralikrishnareddy commented 8 years ago

got it, don't select two dates, just click on a date and then click on apply

AizenL commented 8 years ago

Thanks for your answer.

Im trying selecting 31/12/2015 and Im getting same error.

muralikrishnareddy commented 8 years ago

one more thing, i forgot to inform, if you click on any account which don't have child, will open Journal Items for that Account

muralikrishnareddy commented 8 years ago

just now i generated the Balance Sheet. I am not able to upload the screen shot here. Other wise i should have shared with you.

muralikrishnareddy commented 8 years ago

check this link https://drive.google.com/file/d/0B80ryDfrAuGpdXU5aVgwRWpjTzQ/view?usp=sharing

muralikrishnareddy commented 8 years ago

Can you just change the date format under Settings --> Translations --> Languages , Date format as %m/%d/%Y and Try...

AizenL commented 8 years ago

Ok. im trying.

AizenL commented 8 years ago

Please see:

http://imgur.com/fKR9BSR

muralikrishnareddy commented 8 years ago

ok, may be some changes happened in latest odoo-8.0, actually i am using very old odoo-8.0. Sorry i am not able to help you any more.

AizenL commented 8 years ago

Thanks anyway. Im going to fix it and I will give you a PR.

muralikrishnareddy commented 8 years ago

yes sure.

DayssamAgora commented 8 years ago

Hi @muralikrishnareddy

I got this error when i want to generate the cashflow statement

File "/opt/odoo/custom/inovativ/website_account/account.py", line 1011, in get_lines_cashflow_statement fiscalyear_id = self.get_fiscal_year(cr, uid, data['form']['chart_account_id'], data['form']['date_from'], data['form']['date_to']) File "/opt/odoo/odoo-server/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/opt/odoo/custom/inovativ/website_account/account.py", line 154, in get_fiscal_year fiscals = self.pool.get('account.fiscalyear').search(cr, uid, [('company_id','=',company_id), ('date_start','<=',from_dt), ('date_stop','>=',to_dt)]) File "/opt/odoo/odoo-server/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 1645, in search return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count) File "/opt/odoo/odoo-server/openerp/api.py", line 250, in wrapper return old_api(self, _args, _kwargs) File "/opt/odoo/odoo-server/openerp/models.py", line 4690, in _search cr.execute(query_str, where_clause_params) File "/opt/odoo/custom/inovativ/smile_base/models/sql_db.py", line 35, in detective_execute result = dispatch_func(self, query, params, log_exceptions) File "/opt/odoo/odoo-server/openerp/sql_db.py", line 158, in wrapper return f(self, _args, _kwargs) File "/opt/odoo/odoo-server/openerp/sql_db.py", line 234, in execute res = self._obj.execute(query, params) DataError: date/time field value out of range: "11-30-2015" LINE 1: ... = 1) AND ("account_fiscalyear"."date_start" <= '11-30-201... ^ HINT: Perhaps you need a different "datestyle" setting.

AizenL commented 8 years ago

12 days and I cant get this module working :/

File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/addons/website_account/account.py", line 798, in get_lines_balance_sheet net = copy.deepcopy(chld[0]) IndexError: list index out of range

AizenL commented 8 years ago

File "/opt/bitnami/apps/odoo/lib/odoo-8.0_a2115ef-py2.7.egg/openerp/addons/website_account/account.py", line 798, in get_lines_balance_sheet net = copy.deepcopy(chld[0]) IndexError: list index out of range

AizenL commented 8 years ago

Hi @muralikrishnareddy Maybe could you give us which Odoo version are you using with this module. Thaks

muralikrishnareddy commented 8 years ago

I will upload my odoo-8.0 today to my repository , you can download it once i uploaded it. Its not a generic module actually, its made for one of our customers. According to their requirement we did it. Most of the code in it is not required for every one. So, you can comment the lines where you get the error and continue... Did you modified any code? because i didn't find any thing like above at line 798

muralikrishnareddy commented 8 years ago

My odoo added to the repository, download odoo-8.0 and if you already modified some code in the website_account module, then download new copy and try.

AizenL commented 8 years ago

Hi Thanks for your help. The part of code causing us trouble is this one.


        if pl:
            net  = copy.deepcopy(chld[0])
            net['name'] = 'Total Net Profit / Loss'
            net['type'] = 'not report'
            net['has_childs'] = False
            net['level'] = -1
            net['balance'] = pl
            net['parent_name'] = False
            finals.append(net)
            net1  = copy.deepcopy(chld[0])
            net1['name'] = 'Total Net Equity'
            net1['type'] = 'not report'
            net1['has_childs'] = False
            net1['level'] = -1
            net1['balance'] = abs(total_equity)+pl
            net1['parent_name'] = False
            finals.append(net1)
            net2  = copy.deepcopy(chld[0])
            net2['name'] = 'Total Liabilities & Equity'
            net2['type'] = 'not report'
            net2['has_childs'] = False
            net2['level'] = -1
            net2['balance'] = abs(total_liab) + (abs(total_equity)+pl)
            net2['parent_name'] = False
            finals.append(net2)

        level_finals = []
        if data['form']['report_type'] and data['form']['report_type'][:5] == 'level':
            for dtrec in finals:               
                if int(dtrec['level']) <= int(data['form']['report_type'][5:]):
                    level_finals.append(copy.deepcopy(dtrec))
            self.final_results_bs = level_finals

            return level_finals

Im going to try with your Odoo Version. Thanks.

AizenL commented 8 years ago

Hi @DayssamAgora

You have to change postgresql.conf to

datestyle = 'iso, mdy'
#intervalstyle = 'postgres'
timezone = 'UTC'
DayssamAgora commented 8 years ago

@urbandesignec :

i had already this configuration