Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][MIG] account_fiscal_year_closing #169

Merged
merged 20 commits into from
Aug 11, 2022

Conversation

SimoRubi
Copy link
Member

@SimoRubi SimoRubi mentioned this pull request May 11, 2021
8 tasks
@SimoRubi SimoRubi force-pushed the 14.0-mig-account_fiscal_year_closing branch 7 times, most recently from c1076a0 to 60166c4 Compare May 11, 2021 12:44
@SimoRubi SimoRubi marked this pull request as ready for review May 11, 2021 12:59
"version": "14.0.1.0.0",
"category": "Accounting & Finance",
"website": "https://github.com/OCA/account-closing",
"author": "Tecnativa, " "Odoo Community Association (OCA)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this " " admitted?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for having a look!
Yes it's admitted apparently (there are no complaints by linters) but it's ugly, just removed it

}

# @api.onchange('closing_template_id')
# Not working due to https://github.com/odoo/odoo/issues/20163
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still valid?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently not: odoo/odoo#20163 (comment).
I enabled the onchange and removed both the method action_load_template and is_new_template that existed only to perform the onchange's job.

Tried the loading on onchange in my local environment and seems to be working fine

closing_type = fields.Selection(
selection=_selection_closing_type,
default="none",
states={"posted": [("readonly", True)]},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A value here should always exist, see #165

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather wait for #165 to be merged and then eventually re-base to have the merged changes

@petrus-v
Copy link
Contributor

I'm not sure if it's related to my data or something else I'm getting the following traceback while clicking on calculate button:

As far I understand given a quick analysis I'm not sure if we should add the date on the model account.fiscalyear.closing.unbalanced.move.line or remove it in the move_prepare ?

Erreur:
Odoo Server Error

Traceback (most recent call last):
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/http.py", line 683, in dispatch
    result = self._call_function(**self.params)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/http.py", line 359, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/http.py", line 347, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/http.py", line 912, in __call__
    return self.method(*args, **kw)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/http.py", line 531, in response_wrap
    response = f(*args, **kw)
  File "/home/pverkest/clients/cgi/cgi-erp/addons-contrib/web/controllers/main.py", line 1393, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/home/pverkest/clients/cgi/cgi-erp/addons-contrib/web/controllers/main.py", line 1381, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/api.py", line 396, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/api.py", line 383, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/pverkest/clients/cgi/cgi-erp/addons-contrib/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 328, in button_calculate
    res = self.calculate()
  File "/home/pverkest/clients/cgi/cgi-erp/addons-contrib/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 315, in calculate
    return self._show_unbalanced_move_wizard(data)
  File "/home/pverkest/clients/cgi/cgi-erp/addons-contrib/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 295, in _show_unbalanced_move_wizard
    wizard = self.env["account.fiscalyear.closing.unbalanced.move"].create(data)
  File "<decorator-gen-65>", line 2, in create
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/api.py", line 344, in _model_create_multi
    return create(self, [arg])
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/addons/base/models/ir_fields.py", line 533, in create
    recs = super().create(vals_list)
  File "<decorator-gen-13>", line 2, in create
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/api.py", line 345, in _model_create_multi
    return create(self, arg)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/models.py", line 3868, in create
    records = self._create(data_list)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/models.py", line 4028, in _create
    for other, data in zip(others, data_list)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/fields.py", line 3038, in create
    self.write_batch(record_values, True)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/fields.py", line 3064, in write_batch
    return self.write_real(records_commands_list, create)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/fields.py", line 3236, in write_real
    flush()
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/fields.py", line 3200, in flush
    comodel.create(to_create)
  File "<decorator-gen-65>", line 2, in create
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/api.py", line 345, in _model_create_multi
    return create(self, arg)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/addons/base/models/ir_fields.py", line 533, in create
    recs = super().create(vals_list)
  File "<decorator-gen-13>", line 2, in create
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/api.py", line 345, in _model_create_multi
    return create(self, arg)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/models.py", line 3825, in create
    raise ValueError("Invalid field %r on model %r" % (key, self._name))
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/http.py", line 639, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/http.py", line 315, in _handle_exception
    raise exception.with_traceback(None) from new_cause
ValueError: Invalid field 'date' on model 'account.fiscalyear.closing.unbalanced.move.line'

@SimoRubi SimoRubi force-pushed the 14.0-mig-account_fiscal_year_closing branch 2 times, most recently from 8ca3714 to 074d8f8 Compare June 17, 2021 12:06
@SimoRubi SimoRubi marked this pull request as draft June 17, 2021 12:34
@SimoRubi SimoRubi force-pushed the 14.0-mig-account_fiscal_year_closing branch from 074d8f8 to 77ac991 Compare June 17, 2021 12:57
@SimoRubi
Copy link
Member Author

Hi, thanks for having a look!

I'm not sure if it's related to my data or something else I'm getting the following traceback while clicking on calculate button:

As far I understand given a quick analysis I'm not sure if we should add the date on the model account.fiscalyear.closing.unbalanced.move.line or remove it in the move_prepare ?

Erreur:
Odoo Server Error

Traceback (most recent call last):
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
    result = request.dispatch()
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/http.py", line 683, in dispatch
    result = self._call_function(**self.params)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/http.py", line 359, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/http.py", line 347, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/http.py", line 912, in __call__
    return self.method(*args, **kw)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/http.py", line 531, in response_wrap
    response = f(*args, **kw)
  File "/home/pverkest/clients/cgi/cgi-erp/addons-contrib/web/controllers/main.py", line 1393, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/home/pverkest/clients/cgi/cgi-erp/addons-contrib/web/controllers/main.py", line 1381, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/api.py", line 396, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/api.py", line 383, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/pverkest/clients/cgi/cgi-erp/addons-contrib/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 328, in button_calculate
    res = self.calculate()
  File "/home/pverkest/clients/cgi/cgi-erp/addons-contrib/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 315, in calculate
    return self._show_unbalanced_move_wizard(data)
  File "/home/pverkest/clients/cgi/cgi-erp/addons-contrib/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 295, in _show_unbalanced_move_wizard
    wizard = self.env["account.fiscalyear.closing.unbalanced.move"].create(data)
  File "<decorator-gen-65>", line 2, in create
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/api.py", line 344, in _model_create_multi
    return create(self, [arg])
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/addons/base/models/ir_fields.py", line 533, in create
    recs = super().create(vals_list)
  File "<decorator-gen-13>", line 2, in create
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/api.py", line 345, in _model_create_multi
    return create(self, arg)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/models.py", line 3868, in create
    records = self._create(data_list)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/models.py", line 4028, in _create
    for other, data in zip(others, data_list)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/fields.py", line 3038, in create
    self.write_batch(record_values, True)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/fields.py", line 3064, in write_batch
    return self.write_real(records_commands_list, create)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/fields.py", line 3236, in write_real
    flush()
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/fields.py", line 3200, in flush
    comodel.create(to_create)
  File "<decorator-gen-65>", line 2, in create
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/api.py", line 345, in _model_create_multi
    return create(self, arg)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/addons/base/models/ir_fields.py", line 533, in create
    recs = super().create(vals_list)
  File "<decorator-gen-13>", line 2, in create
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/api.py", line 345, in _model_create_multi
    return create(self, arg)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/models.py", line 3825, in create
    raise ValueError("Invalid field %r on model %r" % (key, self._name))
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/http.py", line 639, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/pverkest/clients/cgi/cgi-erp/ocb/odoo/http.py", line 315, in _handle_exception
    raise exception.with_traceback(None) from new_cause
ValueError: Invalid field 'date' on model 'account.fiscalyear.closing.unbalanced.move.line'

The field date the error is mentioning does not look like it is assigned in move_prepare because it should be in the lines, and there are several places where this might happen like move_line_prepare, or dest_move_line_prepare.

I haven't managed to reproduce your error but seems reasonable to add the date field, done in last commit.
Can you check?

@SimoRubi SimoRubi marked this pull request as ready for review June 17, 2021 13:00
@SimoRubi
Copy link
Member Author

@sergiocorato can you update your review? Unfortunately #165 hasn't been merged yet so I think there is nothing to change here for #169 (comment).

@petrus-v any news about #169 (comment)? The issue you found should be now fixed.

@petrus-v
Copy link
Contributor

@SimoRubi

I had a quick test regarding this module and sorry for this poor report without the way to reproduce that I can't even remember too...

I can see your last commit should avoid this error it could be nice to add a test case to cover it but without the way to reproduce it's a bit annoying.

To be honest I'll be pretty busy in next few weeks and not that much interest here to give a try right now :-/

@mde-scopea
Copy link

Hello,
I found a little bug on "Calculate" process:

  File "/home/odoo/src/user/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 293, in button_calculate
    res = self.calculate()
  File "/home/odoo/src/user/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 277, in calculate
    move, data = config.moves_create()
  File "/home/odoo/src/user/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 514, in moves_create
    move_ids = self.inverse_move_prepare()
  File "/home/odoo/src/user/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 503, in inverse_move_prepare
    return move_ids.ids
Exception
 
The above exception was the direct cause of the following exception:
 
Traceback (most recent call last):
  File "/home/odoo/src/odoo/odoo/http.py", line 640, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo/src/odoo/odoo/http.py", line 316, in _handle_exception
    raise exception.with_traceback(None) from new_cause
AttributeError: 'bool' object has no attribute 'ids'

In method inverse_move_prepare of AccountFiscalyearClosingConfig, we have the case of move_ids stay False and can't return ids.

Is it possible to have a look ? returning move_ids (w/o .ids)

Thanks for your works.

@SimoRubi
Copy link
Member Author

Hello, I found a little bug on "Calculate" process:

  File "/home/odoo/src/user/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 293, in button_calculate
    res = self.calculate()
  File "/home/odoo/src/user/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 277, in calculate
    move, data = config.moves_create()
  File "/home/odoo/src/user/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 514, in moves_create
    move_ids = self.inverse_move_prepare()
  File "/home/odoo/src/user/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 503, in inverse_move_prepare
    return move_ids.ids
Exception
 
The above exception was the direct cause of the following exception:
 
Traceback (most recent call last):
  File "/home/odoo/src/odoo/odoo/http.py", line 640, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo/src/odoo/odoo/http.py", line 316, in _handle_exception
    raise exception.with_traceback(None) from new_cause
AttributeError: 'bool' object has no attribute 'ids'

In method inverse_move_prepare of AccountFiscalyearClosingConfig, we have the case of move_ids stay False and can't return ids.

Is it possible to have a look ? returning move_ids (w/o .ids)

Thanks for your works.

Hi, thanks for testing this.
Could you please provide the steps you performed in order to have this error?

@mde-scopea
Copy link

Hello, I found a little bug on "Calculate" process:

  File "/home/odoo/src/user/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 293, in button_calculate
    res = self.calculate()
  File "/home/odoo/src/user/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 277, in calculate
    move, data = config.moves_create()
  File "/home/odoo/src/user/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 514, in moves_create
    move_ids = self.inverse_move_prepare()
  File "/home/odoo/src/user/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 503, in inverse_move_prepare
    return move_ids.ids
Exception
 
The above exception was the direct cause of the following exception:
 
Traceback (most recent call last):
  File "/home/odoo/src/odoo/odoo/http.py", line 640, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo/src/odoo/odoo/http.py", line 316, in _handle_exception
    raise exception.with_traceback(None) from new_cause
AttributeError: 'bool' object has no attribute 'ids'

In method inverse_move_prepare of AccountFiscalyearClosingConfig, we have the case of move_ids stay False and can't return ids.
Is it possible to have a look ? returning move_ids (w/o .ids)
Thanks for your works.

Hi, thanks for testing this. Could you please provide the steps you performed in order to have this error?

I'm not an accounting expert, we are testing a v14 coming from a v12.
I have theses 4 configs in the system:
image

And during the 'Calculate' action, the error is raised.

@mde-scopea
Copy link

Hello, I come back after deep investigation.
In fact, my previous issue was linked to the "Moves configuration", inside, no "Accounts mapping" was correctly created.
I decided to delete and recreate entirely the fiscal year closing from scratch.

1. Issue on save

My templates are filled correctly (each config have the "accounts mapping", except the latest):
image

How to reproduce:
Create new "Fiscal year closing" and select the template.
All move configurations are loaded in screen.
Save

odoo.sql_db: bad query: INSERT INTO "account_fiscalyear_closing_mapping" ("id", "create_uid", "create_date", "write_uid", "write_date", "dest_account_id", "fyc_config_id", "name", "src_accounts") VALUES (nextval('account_fiscalyear_closing_mapping_id_seq'), 2, (now() at time zone 'UTC'), 2, (now() at time zone 'UTC'), ARRAY[4530, '0499998 Risultato dell''esercizio'], 41, 'Chiusura Conto Economico Costi', '03%') RETURNING id
ERROR: invalid input syntax for integer: "0499998 Risultato dell'esercizio"
LINE 1: ...UTC'), 2, (now() at time zone 'UTC'), ARRAY[4530, '0499998 R...
                                                             ^
...

Traceback (most recent call last):
  File "/home/odoo/src/odoo/odoo/http.py", line 640, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/odoo/src/odoo/odoo/http.py", line 316, in _handle_exception
    raise exception.with_traceback(None) from new_cause
psycopg2.DataError: invalid input syntax for integer: "0499998 Risultato dell'esercizio"
LINE 1: ...UTC'), 2, (now() at time zone 'UTC'), ARRAY[4530, '0499998 R...

image
The onchange result returns a list for dest_account_id and the save is broken.

I found this issue which talks about this kind of issue: odoo/odoo#11236 (comment)
(the many2one inside a one2many fails)
I applied theses changes in the code of class AccountFiscalyearClosingMapping by surcharging create/write methods

    @api.model
    def create(self, vals):
        if 'dest_account_id' in vals:
            vals['dest_account_id'] = vals['dest_account_id'][0]
        res = super(AccountFiscalyearClosingMapping, self).create(vals)
        return res

    def write(self, vals):
        if 'dest_account_id' in vals:
            vals['dest_account_id'] = vals['dest_account_id'][0]
        res = super(AccountFiscalyearClosingMapping, self).write(vals)
        return res

And the save works again !

2. Warning on deprecated force_company:

just change by: tmpl = self.closing_template_id.with_company(self.company_id.id)

 odoo.models: Context key 'force_company' is no longer supported. Use with_company(company) instead. 
 ....
 File "/home/odoo/src/user/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 206, in onchange_template_id
     tmpl = self.closing_template_id.with_context(force_company=self.company_id.id)
   File "/home/odoo/src/odoo/odoo/models.py", line 5110, in with_context
     stack_info=True,

I don't know if you have theses issues.
With theses fixes, all seems work fine.

Regards.

@francesco-ooops
Copy link
Contributor

@SimoRubi hi, is there a plan/roadmap for completing porting of this module?
Thanks!

@SimoRubi
Copy link
Member Author

@SimoRubi hi, is there a plan/roadmap for completing porting of this module? Thanks!

Hi, this is in my TODO list but I don't know when I'll have time to spend for this.

If you want to work on this you are welcome to supersede just leave a note here and create a new PR starting from this branch.

oca-travis and others added 15 commits February 16, 2022 17:45
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-closing-12.0/account-closing-12.0-account_fiscal_year_closing
Translate-URL: https://translation.odoo-community.org/projects/account-closing-12-0/account-closing-12-0-account_fiscal_year_closing/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-closing-12.0/account-closing-12.0-account_fiscal_year_closing
Translate-URL: https://translation.odoo-community.org/projects/account-closing-12-0/account-closing-12-0-account_fiscal_year_closing/
Currently translated at 66.6% (76 of 114 strings)

Translation: account-closing-12.0/account-closing-12.0-account_fiscal_year_closing
Translate-URL: https://translation.odoo-community.org/projects/account-closing-12-0/account-closing-12-0-account_fiscal_year_closing/it/
Fixed warnings:
Field account.fiscalyear.closing.closing_template_id: unknown parameter 'oldname', if this is an actual parameter you may want to override the method _valid_field_parameter on the relevant model in order to allow it
Field account.move.fyc_id: unknown parameter 'delete', if this is an actual parameter you may want to override the method _valid_field_parameter on the relevant model in order to allow it
The model account.fiscalyear.closing.config has no _description
The model account.fiscalyear.closing.mapping has no _description
The model account.fiscalyear.closing.type has no _description
The model account.fiscalyear.closing.template has no _description
The model account.fiscalyear.closing.config.template has no _description
The model account.fiscalyear.closing.mapping.template has no _description
The model account.fiscalyear.closing.type.template has no _description
The model account.fiscalyear.closing.unbalanced.move has no access rules
The model account.fiscalyear.closing.unbalanced.move.line has no access rules
odoo.addons.base.models.ir_ui_view: Search tag requires at least one field element
The method '_company_default_get' on res.company is deprecated and shouldn't be used anymore
DeprecationWarning: RedirectWarning method 'post()' is a deprecated alias to 'action_post()' or _post()
…line.

Otherwise the following might happen:
  File "/path/to/odoo/addons/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 328, in button_calculate
    res = self.calculate()
  File "/path/to/odoo/addons/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 315, in calculate
    return self._show_unbalanced_move_wizard(data)
  File "/path/to/odoo/addons/account_fiscal_year_closing/models/account_fiscalyear_closing.py", line 295, in _show_unbalanced_move_wizard
    wizard = self.env["account.fiscalyear.closing.unbalanced.move"].create(data)
[...]
ValueError: Invalid field 'date' on model 'account.fiscalyear.closing.unbalanced.move.line'
@SimoRubi SimoRubi force-pushed the 14.0-mig-account_fiscal_year_closing branch from 77ac991 to 7011fb0 Compare February 16, 2022 16:45
@elvise
Copy link

elvise commented Apr 19, 2022

hi @sergiocorato any chance for your review ?

@francesco-ooops
Copy link
Contributor

@OCA/accounting-maintainers any chance to review this porting?

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@rafaelbn rafaelbn added this to the 14.0 milestone Jun 26, 2022
@matteoopenf
Copy link
Contributor

@OCA/accounting-maintainers review?

@elvise
Copy link

elvise commented Jul 13, 2022

@OCA/accounting-maintainers review?

@matteoopenf there is a pending review for @sergiocorato

@matteoopenf
Copy link
Contributor

matteoopenf commented Jul 13, 2022

@api.model
def create(self, vals):
if 'dest_account_id' in vals:
vals['dest_account_id'] = vals['dest_account_id'][0]
res = super(AccountFiscalyearClosingMapping, self).create(vals)
return res

def write(self, vals):
    if 'dest_account_id' in vals:
        vals['dest_account_id'] = vals['dest_account_id'][0]
    res = super(AccountFiscalyearClosingMapping, self).write(vals)
    return res

#199 Superseed @SimoRubi @francesco-ooops @mde-spring @sergiocorato

@francesco-ooops
Copy link
Contributor

@SirTakobi

@matteoopenf
Copy link
Contributor

@SirTakobi la pr ho sistemato e fixato i test di la fammi sapere

@OCA-git-bot OCA-git-bot merged commit ee16e44 into OCA:14.0 Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.