Odoo Help

0

0
3 Answers
0
TK
2018/11/29 上午8: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--
9660
| 6 3 9
St Petersburg, 俄罗斯联邦
--Odoo Tools--

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.

The apps you may like to implement in your Odoo

KnowSystem - the tool to build deep and structured knowledge base for internal and external use

OwnCloud / NextCloud Odoo Integration - the tool to automatically synchronize Odoo attachments with OwnCloud / NextCloud files in both ways

Joint Calendar - the tool to combine different Odoo events in a few configurable calendars

Google Drive Odoo Integration - the tool to automatically synchronize Odoo attachments with Google Drive files in both ways

Product Management Interface - the tool to search, select and update product templates in batch

OneDrive / SharePoint Odoo Integration - the tool to automatically synchronize Odoo attachments with OneDrive files in both ways

Periodic Reporting and Reminders - the tool to generate and periodically send reports and reminders

--> More apps
Odoo Tools
2018/11/28 下午2: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--
2807
| 6 3 7
Casablanca, 摩洛哥
--Ibrahim--


Ibrahim
2018/11/29 上午4: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 eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now