Comments (24)
Worth to note this module has another big design issue. It replaces the Manyone towards pos.category
on the field product_template.pos_categ_id
by a Many2one towards product.category
. As soon as you will want to upgrade the base module point_of_sale
, this one will try to create a Foreign Key towards product.category
and fail (letting the database blocked in an intermediate state) because the ids might not exist in this table.
IMO this module should either be reworked in a clean way, either be removed.
from pos.
In case you were wondering like I was, this problem did not affect 8.0 or 9.0. The bug was introduced here, during the migration to 10.0, by not returning a call to super but returning only a reference to the super method instead: https://github.com/OCA/pos/pull/158/files#diff-a2bb6a42189587ba52241d71ea03f98eL104
Thank you @flotho for doing all this investigation and pinpointing the problem to this particular module.
from pos.
Hi,
I made additionnal tests :
- OCA/pos : 10.0 ddfab70 OCA Transbot updated translations from Transifex
- odoo/odoo : 10.0 89cade3bffc [FIX] pos_restaurant: wrap product names on OrderChangeReceipt
Same result, all the FK disappearing from tables, Does anyone reproduce this ?
from pos.
Which module from OCA/pos? Check in runbot if it happens the same.
from pos.
I'm trying each module one by one to identify
from pos.
Well it looks like that pos_remove_category caused the problem. I'll recheck
from pos.
Well, I confirm that having the module pos_remove_category cause the problem. I made those tests :
- Creating db with adding module from oca/pos one by one, retsart odoo between each addition
** => everything work fine except when pos_remove_category is present in the addons path - Creating db with all the module except pos_remove_category
** => Everything Ok - creating db with only pos_remove_categ => make FK disappear
i'm suspecting the ir.module.module dependency so that I tried to comment the init part.
There's something I can't log/ identify more without your support. Thanks in advance.
regards
from pos.
@pedrobaeza it's not really easy for me to try on runbot because no error make the creation failed. Sadly there also nothing special in the logs. The db is created but the table structure haven't got anymore FK. I discovered that when a product.template has been deleted and its associated product.product still living its own ....
not easy to debug this one
from pos.
Thanks @flotho for reporting this problem.
This line seems to create your bug. (not tested)
https://github.com/OCA/pos/blob/10.0/pos_remove_pos_category/models/product.py#L89
Solution 1 : full refactoring
My point of view is that this module is not very clean, and should be refactored :
- do not alter database.
- while loading product, remove pos_categ_id field, add the product_categ_id, and at the end of the load, initialize the pos_categ_id with the product_categ_id
- drop auto_end function and all product overload.
- product_category.available_in_pos : could be computed. (optional) (if category has products that can be sold in PoS.)
Solution 2 : more easy.
- disable _auto_end function. (The module will not work anymore correctly), but the repo will be safe.
@simone, @sylvainc. Could you take a look ?
Note : this problem is present on odoo8 too.
https://github.com/OCA/pos/blob/8.0/pos_remove_pos_category/product.py#L105
from pos.
Hi everyone,
Additionnal question, once this module is not present in the addons_path, do you think that an -u all will re-add all the FK on an already created database?
regards
from pos.
Yeah, this is very critical. Who was the original author/migrator? Is he/she (or anyone else) going to attend this? If not, we should remove it.
from pos.
from pos.
Done : PR to review :
8.0 : #201
9.0 : #202
10.0 : #203
from pos.
Thanks folks, needless to say that it had badside effects on my actual prod databases. Hopefully, -u all re-added all the FK.
regards
from pos.
@flotho thanks for spotting this! 👍 for removal.
from pos.
Thanks @StefanRijnhart for this explanation.
from pos.
holy 💩 I'm gonna bury myself... 😢
sorry for the mess guys... 🔫
from pos.
@pedrobaeza @sylvainc @flotho @legalsylvain @simahawk Can you restore this addon. The fix is proposed for a long time and works fine... #182
from pos.
Please restore the addon and add the patch in your PR, and if everything is correct, we merge at once.
from pos.
Please revert your merge, it is more simple. I pointed everyone in my PR months ago.
from pos.
Sorry, but we can't allowed a module that breaks whole installation. Restore it in your PR and when merged, everything will work correctly. You can press yourself in revert commit, and GitHub will propose a new PR. Cherry-pick your commit in top of it and it's done.
from pos.
Ok you are right. I renamed my PR description and add the revert of the removal.
from pos.
Thanks for the understanding, @Cedric-Pigeon
from pos.
Thanks you all
from pos.
Related Issues (20)
- [16.0] pos_default_partner default partner should be visible in pos HOT 1
- After refund of 1 qty, POS qty display increased by 2 qty HOT 4
- [15.0] pos_event_sale : no way to refund hidden event HOT 1
- Error when trying to install [pos_order_reorder] on 15.0 HOT 1
- pos_stock_available_online HOT 3
- Migration to version 17.0 HOT 5
- pos_report_session_summary Error when printing the session summary. HOT 1
- [16] pos_partner_firstname Can't create a contact HOT 10
- pos_order_to_sale_order Fiscal Position applied at Header but not at OrderLines HOT 9
- [16.0]pos_payment_change change policy option not displayed
- V16 branch looks broken. HOT 9
- RFC: Addition of Customer Postal Code Field in Odoo POS for Enhanced Data Analysis HOT 2
- dos not work with localization HOT 3
- pos_product_packaging_container_deposit - Does'nt add Deposit
- pos_lot_selection - v15 - POS Picking Type's Location is Not Considering
- [16.0][pos_stock_available_online] Bad quantity on products list if forecasted sales
- [15.0] pos_payment_change_wizard strange behavior on rounding HOT 1
- Error en configuracion de Excluir mercancías entrantes HOT 2
- How to use this? HOT 3
- install guide please HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pos.