Odoo Help

0

0
4 Answers
1
Avatar

Niyas Raphy

--Niyas Raphy--
24580
| 7 7 11
Wayanad, Kerala, 印度
--Niyas Raphy--

Odoo Techno Functionalist

Feel free to connect :  niyasraphyk@gmail.com

Twitter:https://twitter.com/niyasraphy
LinkedIn: https://www.linkedin.com/in/niyasraphy/
FB:https://www.facebook.com/niyasraphy123

Happy to help :)

Niyas Raphy
2017/6/30 上午4:33

Hi Mauro,

It will be better to go ahead with description, make the description field as the combination of the three, in the onchange of the products you can write the values to description.

If you use this method you don't want to add further changes in the report, as already the description is there in the report.

If you are adding the two new fields separately, then you have to write the values into these fields while changing the product , also you have to customize the report to add this fields in it.

So it will be better to go ahead with the first solution.

class PurchaseOrderExtend(models.Model):
_inherit = 'purchase.order.line'

@api.onchange('product_id')
def SetDescriptions(self):
if self.product_id:
self.name = self.product_id.display_name + self.product_id.new_field_1 + \
self.product_id.new_field_2
self.price_unit = self.product_id.lst_price

Thanks

0
mauro anelli
2017/6/30 上午4:35

thanks,

i agree, now i just need to understand how to modify the code exactly


2 Comments
Niyas Raphy
2017/6/30 上午4:44

I have updated my answer with the code, please go through it

mauro anelli
2017/6/30 上午4:47

thank you very much ;)

Ask a Question
Keep Informed
1 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