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

[IMP]backend link to attribute.attribute. #47

Open
wants to merge 6 commits into
base: 7.0
Choose a base branch
from
Open

[IMP]backend link to attribute.attribute. #47

wants to merge 6 commits into from

Conversation

Rona111
Copy link
Contributor

@Rona111 Rona111 commented Mar 28, 2016

creation shouldn't be linked to Magento attribute (magento.attribute) of a specific backend but should be linked to attribute.attribute.

@Rona111
Copy link
Contributor Author

Rona111 commented Mar 28, 2016

@seb-elico
Copy link
Contributor

@Rona111 I didn't ask you to create a new field and keep the old one (and make it invisible...), you need to change the current field to link with another model (attribute.attribute instead of magento.product.attribute). If there is a technical limitation to do that (such as "when I change the type, the data becomes incorrect because the foreign keys are wrong"), then please explain it here.

@Rona111
Copy link
Contributor Author

Rona111 commented Mar 29, 2016

@seb-elico Usually,we can not modified the field directly, because the old fields foreigh key still exists,and if you update the old data directly,the database will raise an error that there is no that id, and when you save the new data,the database will raise a error that the foreign key is wrong.modified the id is not enouth.the relationship between is still exist.so it's not a good way to update the old one directly.add the new field and migrate the data based one the old one ,and recreate the relationship between the two models is more simple and stable.

@seb-elico
Copy link
Contributor

@Rona111 clear, thanks. In that case, please:

  • do not hide the old field, just leave it here so we can compare the 2 fields
  • prepare a second PR (checkout a new branch from that one) to remove the old field

@Rona111
Copy link
Contributor Author

Rona111 commented Mar 29, 2016

@seb-elico
Copy link
Contributor

@Rona111 Would it be possible to rename the old field to magento_attribute_id (same for the labels and so on) and call the new one attribute_id?

@Rona111
Copy link
Contributor Author

Rona111 commented Mar 29, 2016

@seb no,rename the old field will lost all the data.

@seb-elico
Copy link
Contributor

@Rona111 Ok, so please rename the field attribute_attribute_id into attr_id

@Rona111
Copy link
Contributor Author

Rona111 commented Mar 29, 2016

cc @seb-elico

Rona111 added 3 commits April 19, 2016 17:22
…e-development

Conflicts:
	mmx_magento_attributes/__openerp__.py
	mmx_magento_attributes/product_driver.py
	mmx_magento_attributes/product_model.py
	mmx_magento_attributes/product_scale.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants