跳至内容
菜单
此问题已终结
3 回复
3665 查看

Hello Experts

I'm using odoo's coupon code programm and need to import coupon codes like this: PCHB-OD+  this is becose I migrate from another system
I miss the import feature on coupon list -- has someone already made it or can push me in the right direction?


thanks

形象
丢弃
最佳答案

Hey Tom,

I guess this is not the intended way, but for me it works (Odoo 13 EE):

  • Create a new field for the model sale.coupon (typ: char), in this example I will call it tmpCode (x_tmpcode).

  • Create your coupon program and as many Coupons as you need.

  • Export your coupon program with the fields id (external id) and coupon_ids/id (external id)

  • Add a new  column to the export-file, call the first row coupon_ids/x_tmpcode and add your codes you want to import, one in each line. Like this:   


  • Import the file (not without testing ;) ) in coupon program, pay attention that your codes are imported to tmpCode 

  • Create a new server-action for sale.coupon, Phyton Code:

 

for rec in records:
  rec['code'] = rec.x_tmpcode

  • "Create Contextual Action"

  • Go to your coupon program - click on Coupons, select all and start the created server-action

Now all the codes created by Odoo should be overwriten by the ones you imported.

形象
丢弃
编写者

works perfect -- I thank you so much for your help :-) great stuff

You are welcome. Glad i could help :)

最佳答案

I am needed the coupon_program module. Could you give me the link to download?

Thanks.

形象
丢弃
编写者

Hi Rigoberto -- here you go: https://lanbacher.ch/clx_advanced_couponcodes.zip -for V13 CE

编写者 最佳答案

Hi Florian

That looks great, I thank you and really appreciate you response :-)

I'll will try out and send you feedback here

形象
丢弃
相关帖文 回复 查看 活动
0
9月 23
2008
1
1月 25
4693
0
8月 16
4207
3
5月 16
6781
0
3月 15
4834