Odoo Help

0

0
3 Answers
0
TK
29/11/18 08.55

Thank you for your answers I did not try them because it turned out that we could solve the problem by ticking an option in the settings of the operation "receipt", field "use_existing_lots" in stock.picking.type.

I am glad that I do not have to alter the database by hand.

1
Avatar

Odoo Tools

--Odoo Tools--
1400
| 5 2 7
St Petersburg, Russian Federation
--Odoo Tools--

Visit us: https://odootools.com/

OdooTools is the team of developers and business analysts to help you extend Odoo potential. We have been communicating with end users to whom the software became the main business tool since 2012. As a result, we are proud of dozens of successful Odoo apps developed. We are open for new ideas and challenges to create the best Odoo tools for business needs all over the world.

Odoo Tools
28/11/18 14.57

Hi,

you should both comment the line and remove the constraint from Postgre.

Have a look at: https://www.odoo.com/forum/help-1/question/remove-sql-constraints-5431

Alternatively you may redefine this sql contsraint in your Python class:

class stock_production_lot(models.Model):    
    _inherit = "stock.production.lot"
    _sql_constraints = [('name_ref_inique', 'check(1=1)', 'No error'),]
0
Avatar

Ibrahim

--Ibrahim--
767
| 5 2 7
Casablanca, Morocco
--Ibrahim--


Ibrahim
29/11/18 04.12

Hi, 
Just remove the contsraint manually from your python file and from the database. 

try this : 
ALTER TABLE Your_table_name DROP CONSTRAINT Your_constraint_name;

Ask a Question
Writer
Keep Informed
2 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now