Skip to content

Master pos back2basic jcb - #51624

Closed
caburj wants to merge 8 commits into
odoo:masterfrom
odoo-dev:master-pos-back2basic-jcb
Closed

Master pos back2basic jcb#51624
caburj wants to merge 8 commits into
odoo:masterfrom
odoo-dev:master-pos-back2basic-jcb

Conversation

@caburj

@caburj caburj commented May 20, 2020

Copy link
Copy Markdown
Contributor

Improve usability and first steps

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@C3POdoo C3POdoo added the RD research & development, internal work label May 20, 2020
@caburj
caburj force-pushed the master-pos-back2basic-jcb branch 2 times, most recently from 7763aee to 556c402 Compare June 3, 2020 09:28
@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label Jun 3, 2020
@caburj
caburj force-pushed the master-pos-back2basic-jcb branch from 556c402 to d26cd3b Compare June 3, 2020 10:06
@robodoo robodoo removed the CI 🤖 Robodoo has seen passing statuses label Jun 3, 2020
@caburj
caburj force-pushed the master-pos-back2basic-jcb branch from d26cd3b to 6f3a8e3 Compare June 3, 2020 10:07
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jun 3, 2020
@caburj
caburj force-pushed the master-pos-back2basic-jcb branch from acdf1d7 to ecf44cc Compare June 3, 2020 11:37
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jun 3, 2020
@caburj
caburj force-pushed the master-pos-back2basic-jcb branch from ecf44cc to 45c50ed Compare June 3, 2020 12:31
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jun 3, 2020
@caburj
caburj force-pushed the master-pos-back2basic-jcb branch from 45c50ed to cfea2ab Compare June 3, 2020 16:52
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jun 3, 2020
@caburj
caburj force-pushed the master-pos-back2basic-jcb branch from cfea2ab to 06080c9 Compare June 4, 2020 05:56
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jun 4, 2020
@caburj
caburj force-pushed the master-pos-back2basic-jcb branch from 06080c9 to f9cd359 Compare June 8, 2020 10:56
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jun 8, 2020
@caburj
caburj force-pushed the master-pos-back2basic-jcb branch from f9cd359 to 38eef7d Compare June 8, 2020 12:01
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jun 8, 2020
@caburj
caburj force-pushed the master-pos-back2basic-jcb branch from 38eef7d to 6879fe0 Compare June 8, 2020 14:40

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we really want one shop by company? When we are in multi company, they already know how to create a shop, and we are not in onboarding anymore

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You are right. I now removed that part.

@caburj
caburj force-pushed the master-pos-back2basic-jcb branch from 95c4ca7 to cdbdf51 Compare June 16, 2020 09:51
@robodoo robodoo removed the CI 🤖 Robodoo has seen passing statuses label Jun 16, 2020
@caburj
caburj force-pushed the master-pos-back2basic-jcb branch from cdbdf51 to 48f9b98 Compare June 16, 2020 10:05
@robodoo robodoo added the CI 🤖 Robodoo has seen passing statuses label Jun 16, 2020

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am not sure that creating a pricelist in the default is a good idea, because, if you have a company in euro, a default pricelist in euro already exists. And if you want to create a POS in another currency, you probably want to set a real pricelist (the prices won't be the same in euro than in dolars), so creating one is not necessary

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I put that because I have failing tests in enterprise. I'll try again without this default pricelist.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed the calculation of default pricelist and the error is not there anymore.

@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jun 16, 2020
@caburj
caburj force-pushed the master-pos-back2basic-jcb branch from 7fe467c to edb933e Compare June 16, 2020 12:57
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jun 16, 2020
@caburj
caburj force-pushed the master-pos-back2basic-jcb branch from edb933e to 6ee980b Compare June 17, 2020 09:34
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jun 17, 2020
@caburj
caburj force-pushed the master-pos-back2basic-jcb branch from 6ee980b to 191c526 Compare June 18, 2020 07:26
@robodoo robodoo added CI 🤖 Robodoo has seen passing statuses and removed CI 🤖 Robodoo has seen passing statuses labels Jun 18, 2020

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do you think that all changes made here still needed? I also think that "setup_invoice_journal" is not really needed anymore.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because of this refactoring, we are able to 1) remove the extensions we made in _create_bank_journals and generate_journals and move them in more centralized location (setup_defaults). (Perhaps I should name it setup_accounting_defaults.) Another benefit is that, 2) we can now easily define a method that loops thru all the pos.config of a given company and setup anything by default when a localisation is installed by hooking it in the setup_defaults method. This includes the setup_invoice_journal.

setup_invoice_journal function is created because the specs require the invoicing capability to be active by default. Without it, even if the module_account is set to default to True, there will be no assigned Invoice Journal in the existing pos.config after installing a fiscal localisation.

@caburj caburj Jun 24, 2020

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note that the behavior of the old code didn't change after the refactoring. Except the addition of setup_invoice_journal which you can see in this commit, was very easy to integrate after the refactoring: 3dad52a

@pimodoo

pimodoo commented Jun 25, 2020

Copy link
Copy Markdown
Collaborator

@caburj Could you just resolve the conflict of this branch, and then I'll merge it.

caburj added 8 commits June 26, 2020 07:40
Floors associated to the pos.config are deleted when is_table_management
is set to False from the backend interface because the backend issues a delete
request to the server. So instead of setting the [(5,0,0)] command during
onchange, we set it in write method to avoid unintended deletion of the floors.
When adding floor_ids in pos.config, we show only the restaurant.floor
records that are not linked to any pos.config. We do this so that one
pos.config doesn't steal floors from other pos.config.
Validating the cash register is not needed at this point because it is
already validated in _reconcile_account_move_lines.
Refactoring this method to make it extensible. After this refactoring, we
can now define methods that can apply defaults to the company's pos.config
records during the installation of a localisation.

To do so, we hook methods to the setup_defaults method. The hooked methods
take pos.config records (self) and a company. The pos.config records belong
to the given company.
@caburj

caburj commented Jun 29, 2020

Copy link
Copy Markdown
Contributor Author

Hi @pimodoo. This is now rebased.

@pimodoo

pimodoo commented Jun 29, 2020

Copy link
Copy Markdown
Collaborator

@robodoo r+ rebase-ff

@robodoo

robodoo commented Jun 29, 2020

Copy link
Copy Markdown
Contributor

Merge method set to rebase and fast-forward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI 🤖 Robodoo has seen passing statuses RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants