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

[11.0] A better wizard for fiscal code generation. #569

Merged
merged 1 commit into from
Oct 30, 2018
Merged

[11.0] A better wizard for fiscal code generation. #569

merged 1 commit into from
Oct 30, 2018

Conversation

Byloth
Copy link
Contributor

@Byloth Byloth commented Aug 10, 2018

This PR implements some little features within the wizard used for the generation of partner's fiscal code.

  • The Odoo's native model res.country.state (which actually contains Italian provinces) is used for field "Birth province" (and all related logics).
  • Now you won't see the same province multiple times.
  • All fields required for generating the fiscal code are now really required.
  • Use of the Odoo's native <group> for splitting fields in two different columns and give to the user a better experience.
  • Now you can't create new (or edit) cities and provinces.
  • "Male" / "Female" selection field now uses the radio widget.

before

Before (actually "Now", to be precise...)


after

Say «Hello!» to 2018!

@oca-clabot
Copy link

Hey @Byloth, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/website.cla
Here is a list of the users:

  • @Byloth (login unknown in OCA database)

Appreciation of efforts,
OCA CLAbot

@Byloth Byloth changed the title A better wizard for fiscalcode generation. A better wizard for fiscal code generation. Aug 21, 2018
@Byloth Byloth closed this Sep 3, 2018
@Byloth Byloth reopened this Sep 3, 2018
@Byloth
Copy link
Contributor Author

Byloth commented Sep 3, 2018

Ok...
Ho ricevuto la conferma da parte di OCA; ora, anche io, sono presente tra gli utenti che hanno firmato la CLA.

Copy link
Member

@eLBati eLBati left a comment

Choose a reason for hiding this comment

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

Nel wizard del calcolo, lasciando vuoto il campo città e andando a modificare manualmente il campo provincia, ottengo

Traceback (most recent call last):
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/http.py", line 650, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/http.py", line 310, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/tools/pycompat.py", line 87, in reraise
    raise value
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/http.py", line 692, in dispatch
    result = self._call_function(**self.params)
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/http.py", line 342, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/service/model.py", line 97, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/http.py", line 335, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/http.py", line 936, in __call__
    return self.method(*args, **kw)
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/addons/web/controllers/main.py", line 934, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/addons/web/controllers/main.py", line 926, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/api.py", line 689, in call_kw
    return call_kw_multi(method, model, args, kwargs)
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/api.py", line 680, in call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/models.py", line 5099, in onchange
    record._onchange_eval(name, field_onchange[name], result)
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/models.py", line 4994, in _onchange_eval
    method_res = method(self)
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/l10n-italy/l10n_it_fiscalcode/wizard/compute_fc.py", line 88, in onchange_birth_province
    names = city_ids.mapped('names')
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/models.py", line 4512, in mapped
    recs = recs._mapped_func(operator.itemgetter(name))
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/models.py", line 4491, in _mapped_func
    vals = [func(rec) for rec in self]
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/models.py", line 4491, in <listcomp>
    vals = [func(rec) for rec in self]
  File "/home/elbati/workspace/odoo/instances/odoo11/parts/odoo/odoo/models.py", line 4758, in __getitem__
    return self._fields[key].__get__(self, type(self))
KeyError: 'names'

Personalmente rimuoverei l'onchange onchange_birth_province , essendo sull'ultimo campo del form , la sua modifica non dovrebbe influire su campi precedenti

@eLBati
Copy link
Member

eLBati commented Oct 28, 2018

@Byloth prevedi di portare avanti questa?

@eLBati eLBati changed the title A better wizard for fiscal code generation. [11.0] A better wizard for fiscal code generation. Oct 28, 2018
@eLBati eLBati added this to the 11.0 milestone Oct 28, 2018
@eLBati
Copy link
Member

eLBati commented Oct 28, 2018

Copy link
Member

@eLBati eLBati left a comment

Choose a reason for hiding this comment

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

Ok, grazie

@eLBati
Copy link
Member

eLBati commented Oct 29, 2018

@Byloth potresti fare squash/fixup dei 3 commit?

@Byloth
Copy link
Contributor Author

Byloth commented Oct 29, 2018

Here you are! 😊

Copy link
Member

@SimoRubi SimoRubi left a comment

Choose a reason for hiding this comment

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

Grazie! Solo qualche consiglio ma per me è ok

l10n_it_fiscalcode/wizard/compute_fc.py Show resolved Hide resolved
l10n_it_fiscalcode/wizard/compute_fc.py Outdated Show resolved Hide resolved
l10n_it_fiscalcode/wizard/compute_fc.py Outdated Show resolved Hide resolved
@eLBati eLBati merged commit 9213980 into OCA:11.0 Oct 30, 2018
eLBati pushed a commit to eLBati/l10n-italy that referenced this pull request Oct 30, 2018
@Byloth Byloth deleted the feature/fiscalcode branch October 31, 2018 11:39
SimoRubi pushed a commit to SimoRubi/l10n-italy that referenced this pull request Aug 7, 2019
Borruso pushed a commit to Borruso/l10n-italy that referenced this pull request Oct 30, 2020
victoralmau pushed a commit to Tecnativa/l10n-italy that referenced this pull request Jan 5, 2021
Borruso pushed a commit to Borruso/l10n-italy that referenced this pull request Apr 9, 2021
SimoneVagile pushed a commit to SimoneVagile/l10n-italy that referenced this pull request Jun 25, 2021
TheMule71 pushed a commit to TheMule71/l10n-italy that referenced this pull request Nov 2, 2022
TheMule71 pushed a commit to TheMule71/l10n-italy that referenced this pull request Nov 2, 2022
TheMule71 pushed a commit to TheMule71/l10n-italy that referenced this pull request Nov 2, 2022
michelerusti pushed a commit to michelerusti/l10n-italy that referenced this pull request Nov 10, 2022
michelerusti pushed a commit to michelerusti/l10n-italy that referenced this pull request Nov 10, 2022
michelerusti pushed a commit to michelerusti/l10n-italy that referenced this pull request Nov 10, 2022
michelerusti pushed a commit to michelerusti/l10n-italy that referenced this pull request Nov 10, 2022
TheMule71 pushed a commit to TheMule71/l10n-italy that referenced this pull request Nov 10, 2022
TheMule71 pushed a commit to TheMule71/l10n-italy that referenced this pull request Nov 11, 2022
TheMule71 pushed a commit to TheMule71/l10n-italy that referenced this pull request Nov 25, 2022
TonyMasciI pushed a commit to saydigital/l10n-italy that referenced this pull request Jan 9, 2023
TonyMasciI pushed a commit to saydigital/l10n-italy that referenced this pull request Jan 16, 2023
TonyMasciI pushed a commit to saydigital/l10n-italy that referenced this pull request Jan 27, 2023
are-agilebg pushed a commit to are-agilebg/l10n-italy that referenced this pull request May 10, 2023
are-agilebg pushed a commit to are-agilebg/l10n-italy that referenced this pull request May 10, 2023
tafaRU pushed a commit to agilebg/l10n-italy that referenced this pull request Sep 1, 2023
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.

4 participants