dhanasingh / redmine_wktime

ERPmine is an open source free ERP for Service Industries. It runs within Redmine
https://erpmine.org/
Other
120 stars 78 forks source link

Could not save Expense: can't write unknown attribute `cost` #287

Closed BRUTEF0RCE closed 1 year ago

BRUTEF0RCE commented 1 year ago

Hi, I hope you can help me even if I am using an old version of your super plugin, since I am stuck with version 3.4 of Redmine for many legacy reasons.

Trying to enter an expense in any expense week sheet result in all the same error message in Redmine :

Could not save Expense: can't write unknown attribute cost<

Would you have any idea how to resolve that? I have not seen any mention of the attribute 'cost' anywhere in the wk... db tables or in the expense section of the code...

Thank you for your help! :)

My Redmine setup : Environment: Redmine version 3.4.10.stable Ruby version 2.4.5-p335 (2018-10-18) [x86_64-linux] Rails version 4.2.11.1 Environment production Database adapter Mysql2 SCM: Subversion 1.9.3 Git 2.7.4 Filesystem
Redmine plugins: redmine_wktime 3.2.1 redmine_xlsx_format_issue_exporter 0.1.6

cdhana17 commented 1 year ago

Have you created any custom field called 'cost' ?

BRUTEF0RCE commented 1 year ago

No I did not. I already checked for that.

Thierry Brochu


From: cdhana17 @.> Sent: Wednesday, April 12, 2023 7:10:28 AM To: dhanasingh/redmine_wktime @.> Cc: BRUTEF0RCE @.>; Author @.> Subject: Re: [dhanasingh/redmine_wktime] Could not save Expense: can't write unknown attribute cost (Issue #287)

Have you created any custom field called 'cost' ?

— Reply to this email directly, view it on GitHubhttps://github.com/dhanasingh/redmine_wktime/issues/287#issuecomment-1505087595, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABSCNVHV4N2TKSZSVFB65S3XA2ESJANCNFSM6AAAAAAW3ASUGQ. You are receiving this because you authored the thread.Message ID: @.***>

cdhana17 commented 1 year ago

Can you find the error detail in the log post it here ?

BRUTEF0RCE commented 1 year ago

Started GET "/wkexpense/edit?startday=2023-04-10&tab=wkexpense&user_id=47" for 192.168.10.5http://192.168.10.5/ at 2023-04-12 12:44:23 -0400 Processing by WkexpenseController#edit as HTML Parameters: {"startday"=>"2023-04-10", "tab"=>"wkexpense", "user_id"=>"47"} Current user: brochuth (id=47) Rendered plugins/redmine_wktime/app/views/wkexpense/_wkexpense_currency.html.erb (16.1ms) Rendered plugins/redmine_wktime/app/views/wkexpense/_wkexpense_cf_in_row.erb (0.5ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues2.html.erb (23.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (14.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_row_template.html.erb (39.5ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_header.html.erb (3.8ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_options.html.erb (1.0ms) Rendered plugins/redmine_wktime/app/views/wkexpense/_wkexpense_cf_in_row_header.html.erb (0.5ms) Rendered plugins/redmine_wktime/app/views/wktime/_issue_header.html.erb (3.2ms) Rendered plugins/redmine_wktime/app/views/wkexpense/_wkexpense_currency.html.erb (15.8ms) Rendered plugins/redmine_wktime/app/views/wkexpense/_wkexpense_cf_in_row.erb (0.5ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues2.html.erb (18.2ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (13.2ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues.html.erb (42.3ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_footer.html.erb (4.3ms) Rendered plugins/redmine_wktime/app/views/wkexpense/edit.html.erb within layouts/base (95.9ms) Rendered plugins/redmine_contacts/app/views/contacts_issues/_additional_assets.html.erb (1.6ms) Rendered plugins/redmine_sudo/app/views/sudo/_sudo_styles.html.erb (0.7ms) Rendered inline template (2.2ms) Rendered plugins/clipboard_image_paste/app/views/clipboard_image_paste/_headers.html.erb (1.3ms) Rendered plugins/additionals/app/views/additionals/_html_head.html.slim (70.4ms) Rendered plugins/redmine_privacy_terms/app/views/redmine_privacy_terms/_html_head.html.slim (1.7ms) Rendered plugins/redmine_wktime/app/views/wktime/_attendance_widget.html.erb (2.1ms) Rendered plugins/additionals/app/views/additionals/_content.html.slim (0.8ms) Rendered plugins/redmine_contacts/app/views/common/_contacts_select2_data.html.erb (1.5ms) Rendered plugins/redmine_drawio/app/views/redmine_drawio/_macro_dialog.html.erb (0.8ms) Rendered plugins/clipboard_image_paste/app/views/clipboard_image_paste/_add_form.html.erb (7.2ms) Rendered plugins/additionals/app/views/additionals/_body_bottom.html.slim (17.7ms) Completed 200 OK in 438ms (Views: 313.2ms | ActiveRecord: 68.8ms) Started GET "/users/47/avatar" for 192.168.10.5http://192.168.10.5/ at 2023-04-12 12:44:24 -0400 Processing by AvatarController#show as HTML Parameters: {"id"=>"47"} Current user: brochuth (id=47) Sent file /data/redmine/redmine-3.4.10/files/2015/09/150929091742_img20150929-7984-ye0s1l.jpg (0.1ms) Completed 200 OK in 22ms (ActiveRecord: 5.4ms) Started GET "/issue_badge" for 192.168.10.5http://192.168.10.5/ at 2023-04-12 12:44:24 -0400 Processing by IssueBadgeController#index as / Current user: brochuth (id=47) Rendered plugins/redmine_issue_badge/app/views/issue_badge/_issue_badge.html.erb (1.0ms) Completed 200 OK in 41ms (Views: 2.0ms | ActiveRecord: 24.1ms) Started POST "/wkexpense/update" for 192.168.10.5http://192.168.10.5/ at 2023-04-12 12:44:39 -0400 Processing by WkexpenseController#update as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"OzV7vzLUEwFNQ9gtasgMcBMbYxhlgbFCIx+ulT9PdIR1rAHDGGi9UZmGHbpBeGVl6QcyAHZi1wcM6NOo6mXxvA==", "tab"=>"wkexpense", "back_url"=>"https://radi.xst.ca/wkexpense/index?tab=wkexpense", "getissues_url"=>"/wkexpense/getissues", "getactivities_url"=>"/wkexpense/getactivities", "deleterow_url"=>"/wkexpense/deleterow", "user_id"=>"47", "startday"=>"2023-04-10", "time_entry"=>[{"project_id"=>"475", "issue_id"=>"22978", "activity_id"=>"316", "currency"=>"$"}], "hours1"=>["71.00", "", "", "", "", "", ""], "ids1"=>["", "", "", "", "", "", ""], "disabled1"=>["false", "false", "false", "false", "false", "false", "false"], "comments1"=>["", "", "", "", "", "", ""], "total"=>"71", "unit"=>"$", "hidden_clock_in_out"=>"", "wktime_save"=>"Save"} Current user: brochuth (id=47) Redirected to https://radi.xst.ca/wkexpense/edit?isError=true&startday=2023-04-10&user_id=47 Completed 302 Found in 101ms (ActiveRecord: 19.7ms) Started GET "/wkexpense/edit?isError=true&startday=2023-04-10&user_id=47" for 192.168.10.5http://192.168.10.5/ at 2023-04-12 12:44:39 -0400 Processing by WkexpenseController#edit as HTML Parameters: {"isError"=>"true", "startday"=>"2023-04-10", "user_id"=>"47"} Current user: brochuth (id=47) Rendered plugins/redmine_wktime/app/views/wkexpense/_wkexpense_currency.html.erb (16.3ms) Rendered plugins/redmine_wktime/app/views/wkexpense/_wkexpense_cf_in_row.erb (0.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues2.html.erb (21.0ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (14.5ms) Rendered plugins/redmine_wktime/app/views/wktime/_row_template.html.erb (38.2ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_header.html.erb (29.7ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_options.html.erb (1.2ms) Rendered plugins/redmine_wktime/app/views/wkexpense/_wkexpense_cf_in_row_header.html.erb (0.5ms) Rendered plugins/redmine_wktime/app/views/wktime/_issue_header.html.erb (3.5ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.6ms) Rendered plugins/redmine_wktime/app/views/wkexpense/_wkexpense_currency.html.erb (17.1ms) Rendered plugins/redmine_wktime/app/views/wkexpense/_wkexpense_cf_in_row.erb (0.5ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues2.html.erb (20.1ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (0.6ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (8.2ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_hours.html.erb (12.4ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_issues.html.erb (61.5ms) Rendered plugins/redmine_wktime/app/views/wktime/_edit_footer.html.erb (4.3ms) Rendered plugins/redmine_wktime/app/views/wkexpense/edit.html.erb within layouts/base (140.4ms) Rendered plugins/redmine_contacts/app/views/contacts_issues/_additional_assets.html.erb (1.5ms) Rendered plugins/redmine_sudo/app/views/sudo/_sudo_styles.html.erb (0.8ms) Rendered inline template (1.9ms) Rendered plugins/clipboard_image_paste/app/views/clipboard_image_paste/_headers.html.erb (1.4ms) Rendered plugins/additionals/app/views/additionals/_html_head.html.slim (73.3ms) Rendered plugins/redmine_privacy_terms/app/views/redmine_privacy_terms/_html_head.html.slim (1.9ms) Rendered plugins/redmine_wktime/app/views/wktime/_attendance_widget.html.erb (2.2ms) Rendered plugins/additionals/app/views/additionals/_content.html.slim (1.0ms) Rendered plugins/redmine_contacts/app/views/common/_contacts_select2_data.html.erb (1.7ms) Rendered plugins/redmine_drawio/app/views/redmine_drawio/_macro_dialog.html.erb (0.9ms) Rendered plugins/clipboard_image_paste/app/views/clipboard_image_paste/_add_form.html.erb (7.7ms) Rendered plugins/additionals/app/views/additionals/_body_bottom.html.slim (18.2ms) Completed 200 OK in 493ms (Views: 367.1ms | ActiveRecord: 67.8ms) Started GET "/issue_badge" for 192.168.10.5http://192.168.10.5/ at 2023-04-12 12:44:40 -0400 Processing by IssueBadgeController#index as / Started GET "/users/47/avatar" for 192.168.10.5http://192.168.10.5/ at 2023-04-12 12:44:40 -0400 Processing by AvatarController#show as HTML Parameters: {"id"=>"47"} Current user: brochuth (id=47) Current user: brochuth (id=47) Sent file /data/redmine/redmine-3.4.10/files/2015/09/150929091742_img20150929-7984-ye0s1l.jpg (0.1ms) Completed 200 OK in 25ms (ActiveRecord: 4.2ms) Rendered plugins/redmine_issue_badge/app/views/issue_badge/_issue_badge.html.erb (1.3ms) Completed 200 OK in 50ms (Views: 2.7ms | ActiveRecord: 27.8ms)

Thierry Brochu


From: cdhana17 @.> Sent: Wednesday, April 12, 2023 8:29:47 AM To: dhanasingh/redmine_wktime @.> Cc: BRUTEF0RCE @.>; Author @.> Subject: Re: [dhanasingh/redmine_wktime] Could not save Expense: can't write unknown attribute cost (Issue #287)

Can you find the error detail in the log post it here ?

— Reply to this email directly, view it on GitHubhttps://github.com/dhanasingh/redmine_wktime/issues/287#issuecomment-1505191740, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABSCNVCUIFG7Q5AYWL5B6PLXA2N3XANCNFSM6AAAAAAW3ASUGQ. You are receiving this because you authored the thread.Message ID: @.***>

BRUTEF0RCE commented 1 year ago

Ok... I found that there is a column "cost" in the time_entries table of Redmine, added from a plugin rate and budget... image

How can this column bothers an entry for expenses?

Thanks for your help!

dhanasingh commented 1 year ago

Is that a mandatory field ?DhanasinghOn 13-Apr-2023, at 8:34 AM, BRUTEF0RCE @.***> wrote: Ok... I found that there is a column "cost" in the time_entries table of Redmine, added from a plugin rate and budget...

How can this column bothers an entry for expenses? Thanks for your help!

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

cdhana17 commented 1 year ago

Can you create that cost column in wk_expense_entries and see if that fix the problem for you ?

BRUTEF0RCE commented 1 year ago

That was a great idea to try! And it works! Thank you very much for your help on this! I can now use your great expense module!

Regards

Thierry Brochu


From: cdhana17 @.> Sent: Thursday, April 13, 2023 7:38:18 AM To: dhanasingh/redmine_wktime @.> Cc: BRUTEF0RCE @.>; Author @.> Subject: Re: [dhanasingh/redmine_wktime] Could not save Expense: can't write unknown attribute cost (Issue #287)

Can you create that cost column in wk_expense_entries and see if that fix the problem for you ?

— Reply to this email directly, view it on GitHubhttps://github.com/dhanasingh/redmine_wktime/issues/287#issuecomment-1506814731, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABSCNVGMSGTVBVTGPZJBOHTXA7QSVANCNFSM6AAAAAAW3ASUGQ. You are receiving this because you authored the thread.Message ID: @.***>

cdhana17 commented 1 year ago

Glad that solved the issue, hope you upgrade to the latest version soon

BRUTEF0RCE commented 1 year ago

I wish to do so in a near future. Thank you again!