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

[17.0][MIG] product_configurator #106

Closed
wants to merge 496 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
496 commits
Select commit Hold shift + click to select a range
5087d27
[PATCH 247/493] [IMP][#T00513]product_configurator:create test cases …
May 29, 2019
f2dccfb
[PATCH 248/493] [IMP][#T00513]product_configurator:change variable name
May 30, 2019
567db5b
[PATCH 249/493] [WIP][#T00513]product_configurator: write test case f…
May 30, 2019
66c6efb
[PATCH 250/493] [FIX]fix changes request during review
bizzappdev May 31, 2019
33d5db5
[PATCH 251/493] [FIX]remove parameter limit from search_session and u…
bizzappdev Jun 1, 2019
7198706
[PATCH 252/493] [IMP][T-00511] website configuration image
Jun 1, 2019
9544669
[PATCH 253/493] [T-00513][ADD] product_Configurator_image_builder: wr…
bizzappdev Jun 3, 2019
0375314
[PATCH 254/493] [FIX]check values only if both exists
bizzappdev Jun 3, 2019
e8de048
[PATCH 255/493] [FIX]fix attribute_value_line_ids in _prepare_configu…
bizzappdev Jun 3, 2019
c046a64
[PATCH 256/493] [WIP][#T00513]product_configurator: improve the code …
Jun 3, 2019
a9587ac
[PATCH 257/493] [T-00513][ADD] product_configurator_image_builder: ad…
bizzappdev Jun 3, 2019
2a99a76
[PATCH 258/493] [WIP][#T00513]product_configurator: improve the code …
Jun 3, 2019
f696d2b
[PATCH 259/493] [FIX]add domain in record rules
bizzappdev Jun 4, 2019
5586faf
[PATCH 260/493] [WIP][#T00513]product_configurator:write test case fo…
Jun 4, 2019
6727acb
[PATCH 261/493] [FIX]fix record rules
bizzappdev Jun 5, 2019
3ca8d14
[PATCH 262/493] [FIX]change module name to base from product_configur…
bizzappdev Jun 5, 2019
ec07c70
[PATCH 263/493] [FIX]remove extra parentheses
bizzappdev Jun 5, 2019
d6d715d
[PATCH 264/493] [FIX]change xml-id of record rule
bizzappdev Jun 5, 2019
7efc8f4
[PATCH 265/493] [IMP][#T00494] product_configurator : add domain on v…
Jun 5, 2019
bd29b2d
[PATCH 266/493] [FIX]add group on toggle button for configuration
bizzappdev Jun 5, 2019
1bac3a0
[PATCH 267/493] [FIX]add group manager on attr config setings and wei…
bizzappdev Jun 5, 2019
7e6c55a
[PATCH 268/493] [FIX]add group config manager on varuant price button
bizzappdev Jun 5, 2019
9318261
[PATCH 269/493] [FIX]add group config manager on product attr custom val
bizzappdev Jun 5, 2019
8e1450c
[PATCH 270/493] [FIX]remove extra space
bizzappdev Jun 5, 2019
7ff2691
[PATCH 271/493] [FIX]add group config manager on weight extra on product
bizzappdev Jun 6, 2019
f1a365f
[PATCH 272/493] [IMP][T-00513]fix conflict
Jun 6, 2019
4217255
[PATCH 273/493] [ADD][T00513]product_configurator : create demo data
Jun 6, 2019
718b78d
[PATCH 274/493] [IMP][#T00494] product_configurator,product_configura…
Jun 6, 2019
3279503
[PATCH 275/493] [ADD][#IMP]product_configurator:improve the code and …
Jun 6, 2019
00023e2
[PATCH 276/493] [IMP][#T00494] product_configurator : solve flak8 in …
Jun 6, 2019
dd619b3
[PATCH 277/493] [IMP][#T00494] product_configurator : add depends on …
Jun 6, 2019
3af6208
[PATCH 278/493] [IMP][#T00494] product_configurator : remove print st…
Jun 6, 2019
afd461b
[PATCH 279/493] [FIX]use UserError instead of warning, raise error if…
bizzappdev Jun 6, 2019
062894d
[PATCH 280/493] [ADD][#T00513] product_configurator_sale, product_con…
Jun 7, 2019
6f08b9f
[PATCH 281/493] [FIX]add value_ids in depends
bizzappdev Jun 7, 2019
841f970
[PATCH 282/493] [ADD][#T00513]product_configurator:create test case f…
Jun 8, 2019
16e4e3e
[PATCH 283/493] [WIP][#T00513] write test-case for product template
bizzappdev Jun 8, 2019
3c0984f
[PATCH 284/493] [IMP]price and weight on website
bizzappdev Jun 10, 2019
95e3cdf
[PATCH 285/493] [IMP][#T00513] product_configurator: write test-case …
bizzappdev Jun 11, 2019
3359ccb
[PATCH 286/493] [IMP][#T00513]product_configurator: create test case …
Jun 12, 2019
879a73a
[PATCH 287/493] [IMP][#T00513]product_configurator:create test case f…
Jun 13, 2019
230536d
[PATCH 288/493] [FIX]fix record rules
bizzappdev Jun 13, 2019
5df8b8d
[PATCH 289/493] [FIX]set value_ids only if value_ids is None
bizzappdev Jun 13, 2019
5227611
[PATCH 290/493] [IMP][#T00513]product_configurator: create test case …
Jun 13, 2019
4260caa
[PATCH 291/493] [IMP][#T00513]product_configurator: remove comment st…
Jun 13, 2019
d5c6519
[PATCH 292/493] [FIX]uncommit button config_ok
bizzappdev Jun 13, 2019
d7c4333
[PATCH 293/493] [IMP][#T00513]product_configurator: create test case …
Jun 13, 2019
b8cbd7e
[PATCH 294/493] [ADD][t00513]product_configurator,product_configurato…
Jun 14, 2019
87ae08c
[PATCH 295/493] [T-00513][IMP] product_configurator: For test-case ad…
bizzappdev Jun 14, 2019
487b627
[PATCH 296/493] [ADD][#T00513]product_configurator:solved conflict
Jun 14, 2019
8576da8
[PATCH 297/493] [FIX]move .get_custom_value_id to config session
bizzappdev Jun 14, 2019
bdf844d
[PATCH 298/493] [T-00513][IMP] add new changes
bizzappdev Jun 14, 2019
7df212f
[PATCH 299/493] [FIX]fix flake8 and pylint errors
bizzappdev Jun 15, 2019
d2b607f
[PATCH 300/493] [ADD][#T00513]product_configurator: create test case …
Jun 15, 2019
bfc7ab1
[PATCH 301/493] [FIX]call get_custom_value using config_session
bizzappdev Jun 17, 2019
9285ea5
[PATCH 302/493] [FIX]fix flake8
bizzappdev Jun 17, 2019
90c02c9
[PATCH 303/493] [FIX]change realtion and columns name in value_ids
bizzappdev Jun 19, 2019
3e650de
[PATCH 304/493] [FIX][T-00513] product_configurator: add new changes …
bizzappdev Jun 19, 2019
27df99e
[PATCH 305/493] [IMP][T-00513] product_configurator: solve flake8
bizzappdev Jun 19, 2019
8a1ba7b
[PATCH 306/493] [FIX]add domain website_published = true in record ru…
bizzappdev Jun 19, 2019
71626ec
[PATCH 307/493] [WIP]initial working wizard for the v12 migration
bizzappdev Jun 19, 2019
9bca2dd
[PATCH 308/493] [FIX]remove noupdate=1 from security file of product_…
bizzappdev Jun 19, 2019
deacb62
[PATCH 309/493] [IMP]make image click work for radio and check box
bizzappdev Jun 19, 2019
8755c28
[PATCH 310/493] [FIX]take value_ids from session if value_ids is not …
bizzappdev Jun 21, 2019
c6c0b45
[PATCH 311/493] [FIX]if default not exist then set it to {}
bizzappdev Jun 24, 2019
14fe0e1
[PATCH 312/493] [FIX]return new_attrs outside for loop
bizzappdev Jun 24, 2019
280de95
[PATCH 313/493] [IMP][T-00513] product_configurator: add changes for …
bizzappdev Jun 24, 2019
00717db
[PATCH 314/493] [FIX]add copy False in product_ids and attribute_line…
bizzappdev Jun 24, 2019
b472b17
[PATCH 315/493] [IMP][T-00513] product_configurator: add changes for …
bizzappdev Jun 24, 2019
e247874
[PATCH 316/493] [FIX][00513]product_configurator : chnages in test case
Jun 24, 2019
a78d785
[PATCH 317/493] [IMP]add description and copy false in attr line_ids …
bizzappdev Jun 24, 2019
06d5265
[PATCH 318/493] [FIX]add price_extra
bizzappdev Jun 24, 2019
fb6dde4
[PATCH 319/493] [FIX]fix wizard view
bizzappdev Jun 24, 2019
98e91a3
[PATCH 320/493] [IMP][T-00513] product_configurator: add changes for …
bizzappdev Jun 24, 2019
15b4415
[PATCH 321/493] [FIX]fix flake8 error
bizzappdev Jun 25, 2019
95a2992
[PATCH 322/493] [IMP][T-00513] product_configurator: add chages in te…
bizzappdev Jun 25, 2019
6f7fcda
[PATCH 323/493] [FIX]fix access rules and record rules
bizzappdev Jun 25, 2019
836cffc
[PATCH 324/493] [FIX]use value_ids is None instead not value_ids and …
bizzappdev Jun 25, 2019
ecb3fb7
[PATCH 325/493] [IMP][T-00513] product_configurator: add chages for t…
bizzappdev Jun 25, 2019
6488900
[PATCH 326/493] [FIX]change model in record rules
bizzappdev Jun 25, 2019
9018030
[PATCH 327/493] [FIX]fix price extra functionality
bizzappdev Jun 25, 2019
61a04a8
[PATCH 328/493] [FIX]fixes from 11.0
bizzappdev Jun 26, 2019
616ed4d
[PATCH 329/493] [FIX][T-00517]fix :: When we create the standard prod…
bizzappdev Jun 26, 2019
b4324a2
[PATCH 330/493] [FIX]add for loop in compute and constrains method to…
bizzappdev Jun 26, 2019
127a891
[PATCH 331/493] [FIX][T-00517]fix default filter,add desciption, allo…
bizzappdev Jun 26, 2019
de17b51
[PATCH 332/493] [FIX]delete recor rules
bizzappdev Jun 26, 2019
63032fd
[PATCH 333/493] [FIX]add check in create write and unlink
bizzappdev Jun 26, 2019
791f3d4
[PATCH 334/493] [FIX]move image to last field in tree view
bizzappdev Jun 27, 2019
37b47d6
[PATCH 335/493] [FIX][T-00513] product_configurator: fix test-case is…
bizzappdev Jun 27, 2019
1bf09d1
[PATCH 336/493] [IMP][T-00513] product_configurator: init uncomment code
bizzappdev Jun 27, 2019
16c75a8
[PATCH 337/493] [FIX]filter configuratble product and loop out then i…
bizzappdev Jun 27, 2019
867805e
[PATCH 338/493] [FIX] use condition change_config_ok or self.config_ok
bizzappdev Jun 27, 2019
6e1795b
[PATCH 339/493] [FIX]remove onchange and add readonly in config_ok on…
bizzappdev Jun 27, 2019
56dba7c
[PATCH 340/493] [FIX]remove loop from unlink
bizzappdev Jun 27, 2019
92a7234
[PATCH 341/493] [FIX]set config_ok=true default in method
bizzappdev Jun 28, 2019
94f3799
[PATCH 342/493] [FIX]fix flake8
bizzappdev Jun 28, 2019
d511cde
[PATCH 343/493] [WIP][00513]product_configurator : write testcase
Jun 28, 2019
1b9263e
[PATCH 344/493] [FIX]move config_ok at top of method
bizzappdev Jun 28, 2019
5b49810
[PATCH 345/493] [FIX]change group manager
bizzappdev Jun 29, 2019
a36234b
[PATCH 346/493] [FIX]if check_value_ids is none only then set it to s…
bizzappdev Jun 29, 2019
fac8085
[PATCH 347/493] [FIX]remove config_ok from method check_config_user_a…
bizzappdev Jun 29, 2019
42b40c5
[PATCH 348/493] [FIX][T-00513] fix issue test-case issue in product_c…
bizzappdev Jun 29, 2019
f81ce6b
[PATCH 349/493] [FIX] fix ex. name
bizzappdev Jul 10, 2019
2a45b22
[PATCH 350/493] [FIX] product_configurator: fix validation issue in p…
bizzappdev Jul 13, 2019
6dba0bd
[PATCH 351/493] [WIP][00517] website_product_configurator: create cha…
bizzappdev Jul 13, 2019
c484c02
[PATCH 352/493] [FIX]fixes from 11.0
bizzappdev Jul 15, 2019
11fc7ad
[PATCH 353/493] [FIX]fix security file
bizzappdev Jul 15, 2019
e57c491
[PATCH 354/493] [FIX]add if value_ids is None instead if not value_id…
bizzappdev Jul 16, 2019
84eec48
[PATCH 355/493] [FIX]fix argument name
bizzappdev Jul 16, 2019
9341c58
[PATCH 356/493] [IMP][T00517] product_configurator : add attribute on…
Jul 17, 2019
afdae26
[PATCH 357/493] [IMP][T00517] product_configurator : add attribute on…
Jul 17, 2019
9564b00
[PATCH 358/493] [IMP][T00517] product_configurator : add attribute on…
Jul 17, 2019
091ec33
[PATCH 359/493] [IMP][T00517] product_configurator : add attribute on…
Jul 17, 2019
8d880d8
[PATCH 360/493] [IMP][T00517] product_configurator : add attribute on…
Jul 17, 2019
d612fc3
[PATCH 361/493] [FIX]add group manager in weight_extra
bizzappdev Jul 17, 2019
133acb0
[PATCH 362/493] [FIX][T-00517]website_product_configurator: fix flake8
bizzappdev Jul 19, 2019
dd01c49
[PATCH 363/493] [FIX]fix flake8
bizzappdev Jul 23, 2019
4f374ff
[PATCH 364/493] [ADD][00517]product_configurator : migration testcase…
Jul 23, 2019
f481b2d
[PATCH 365/493] [FIX][00517] product_configurator,product_configurato…
Jul 24, 2019
c0e6922
[PATCH 366/493] [FIX]change version in manifest file
bizzappdev Jul 26, 2019
669ab9c
[PATCH 367/493] [WIP][00517]product_configurator : migration test-cas…
Jul 30, 2019
ad47e37
[PATCH 368/493] [ADD][FIX][00517]product_configurator : craete test-c…
Jul 30, 2019
3431fe7
[PATCH 369/493] [FIX][00517]product_configurator : onchange method c…
Jul 31, 2019
c590de4
[PATCH 370/493] [FIX][00517]product_configurator : solve the flak8
Jul 31, 2019
b1eb768
[PATCH 371/493] [FIX] product_configurator: Add admin to Manager group
max3903 Aug 5, 2019
b2151b0
[PATCH 372/493] [FIX] product_configurator: Reorder and rename the me…
max3903 Aug 5, 2019
ddf5b99
[PATCH 373/493] [FIX]add group confg manager to user root and admin
bizzappdev Aug 19, 2019
f6f38cd
[PATCH 374/493] [FIX]website_product_configurator,product_configurato…
Sep 7, 2019
8ab522f
[PATCH 375/493] [WIP] product_configurator: add change for fix price …
bizzappdev Sep 22, 2019
e755c62
[PATCH 376/493] [FIX][T-00517]fix domain calculation don't consider i…
bizzappdev Sep 28, 2019
8ce1c8c
[PATCH 377/493] [FIX][T-00517]fix price precision on backend wizard
bizzappdev Sep 28, 2019
f3387ae
[PATCH 378/493] [FIX]display currency in backend wizard
bizzappdev Sep 28, 2019
d7ab14a
[PATCH 379/493] Adding created/found variant on configuration session…
PCatinean Sep 29, 2019
e5f8f8b
[PATCH 380/493] Added product_id field to config.session views
PCatinean Sep 29, 2019
fd22c84
[PATCH 381/493] [FIX]add ondelete='cascade' instead of ondelete='rest…
bizzappdev Sep 30, 2019
fb96d45
[PATCH 382/493] [FIX]remove action_confirm from create_get_variant an…
bizzappdev Sep 30, 2019
064772b
[PATCH 383/493] [FIX]remove extra call for .create_get_variant
bizzappdev Sep 30, 2019
797e601
[PATCH 384/493] [FIX][T2998]fix write method
bizzappdev Oct 7, 2019
c9f9e57
[PATCH 385/493] [FIX]product_configurator : chnage in product_configu…
Oct 10, 2019
20c9167
[PATCH 386/493] [FIX]product_configurator,website_product_configurato…
Oct 10, 2019
b571791
[PATCH 387/493] [IMP][T-00560] product_Configurator: for the restrict…
bizzappdev Oct 14, 2019
fc8e7ba
[PATCH 388/493] [IMP][T-00560] product_configurator: fix issue of cha…
bizzappdev Oct 15, 2019
4f7c7d1
[PATCH 389/493] [IMP][T-00560] product_configurator: make change for …
bizzappdev Oct 23, 2019
d1a5cf1
[PATCH 390/493] [IMP][T-00560] product_configurator: make readonly at…
bizzappdev Oct 23, 2019
c20c155
[PATCH 391/493] [IMP][T-00560] product_configurator: solve flake8
bizzappdev Oct 25, 2019
50fb525
[PATCH 392/493] [FIX]product_configurator : add new test case for get…
Nov 1, 2019
5c450c6
[PATCH 393/493] [FIX]fix price precision on backend wizard
bizzappdev Nov 6, 2019
3d12bc6
[PATCH 394/493] [WIP][T-00616] Product_configurator: show price_extra…
bizzappdev Nov 21, 2019
2648ab2
[PATCH 395/493] [IMP][T-00616] Product_configurator: price extra changes
bizzappdev Nov 25, 2019
a3a6993
[PATCH 396/493] [FIX][T-00616]fix test case and code optimization
bizzappdev Nov 26, 2019
833bf0b
[PATCH 397/493] [FIX][T-00547]move code from onchage to new method ap…
bizzappdev Dec 2, 2019
4f85f6a
[PATCH 398/493] [FIX][T-00616]find price from related product, and th…
bizzappdev Dec 2, 2019
2eb78b9
[PATCH 399/493] [IMP][T-00622]add name in separator for Configuration…
bizzappdev Dec 12, 2019
5b0c14f
[PATCH 400/493] [FIX][T-00631]call onchange for custom values too
bizzappdev Dec 17, 2019
3902cd8
[PATCH 401/493] [IMP]Add installable False to module from version 12
bizzappdev Dec 26, 2019
22c79fe
[PATCH 402/493] [MIG]migrate product configurator base to 13.0 from 12.0
bizzappdev Dec 31, 2019
32e509b
[PATCH 403/493] [IMP][T3186]add domain in restriction
bizzappdev Dec 31, 2019
38dc616
[PATCH 404/493] Revert "[IMP][T3186]add domain in restriction"
bizzappdev Dec 31, 2019
1a850d5
[PATCH 405/493] [IMP][T3186]add domain in restriction
bizzappdev Dec 31, 2019
1d69ad9
[PATCH 406/493] [FIX][T3186]fix variant prices domain
bizzappdev Dec 31, 2019
6828b19
[PATCH 407/493] [FIX][T3186]fix variant prices domain
bizzappdev Dec 31, 2019
0fe816a
[PATCH 408/493] [FIX][T3186]fix product_preset_id in onchane
bizzappdev Dec 31, 2019
43184af
[PATCH 409/493] [FIX][T3186]send template in context on reset
bizzappdev Dec 31, 2019
dd861d1
[PATCH 410/493] [FIX][T3186]change int to integer (custom type)
bizzappdev Dec 31, 2019
ab8f61a
[PATCH 411/493] [FIX][T3186]fix reset button functionality
bizzappdev Jan 1, 2020
dfbb658
[PATCH 412/493] [FIX][T3186]hide create button from variants
bizzappdev Jan 1, 2020
711dbc7
[PATCH 413/493] [FIX][T3186]prevent to save wrong custom value when n…
bizzappdev Jan 1, 2020
2bab35d
[PATCH 414/493] [FIX][T3186]prevent warning for int/float value valid…
bizzappdev Jan 1, 2020
0e4b239
[PATCH 415/493] [FIX][T3186] fix js error due to undefined element
bizzappdev Jan 1, 2020
cfe7702
[PATCH 416/493] [FIX][T3186] open config attribute view from product_…
bizzappdev Jan 2, 2020
190d95d
[PATCH 417/493] [FIX][T3186] fix context on attribute lines
bizzappdev Jan 2, 2020
c29bddd
[PATCH 418/493] [FIX][T3186] fix context on attribute lines
bizzappdev Jan 2, 2020
78469cd
[PATCH 419/493] [FIX][T3186] fix context on attribute lines
bizzappdev Jan 2, 2020
1405bab
[PATCH 420/493] [FIX][T3186] fix context on attribute lines
bizzappdev Jan 2, 2020
f17cc5e
[PATCH 421/493] [WIP][3186]add views in wizard action
bizzappdev Jan 3, 2020
de296ca
[PATCH 422/493] [IMP][T3186]add helper methods to call onchage
bizzappdev Jan 4, 2020
6c5f3a8
[PATCH 423/493] [IMP][T3186]remove custom values on variant
bizzappdev Jan 4, 2020
656bdc4
[PATCH 424/493] [IMP][T3186]remove search on custom values in get_var…
bizzappdev Jan 4, 2020
571b608
[PATCH 425/493] [FIX][3186]add name in session custom values
bizzappdev Jan 6, 2020
29a0900
[PATCH 426/493] [FIX][T3199]add active false in custom attribute values
bizzappdev Jan 6, 2020
aefbf6a
[PATCH 427/493] [FIX]fix flake8
bizzappdev Jan 28, 2020
e1d7937
[PATCH 428/493] [FIX]remove print
bizzappdev Jan 28, 2020
72e81be
[PATCH 429/493] [FIX][T3186]fix duplicate copy of attribute-lines and…
bizzappdev Feb 10, 2020
695663a
[PATCH 430/493] [MIG]migrate website_product_configurator to v13
bizzappdev Feb 12, 2020
26978e7
[PATCH 431/493] [FIX]add res config settings view
bizzappdev Feb 19, 2020
5293afb
[PATCH 432/493] [FIX]remove extra context from res config settings view
bizzappdev Feb 19, 2020
17a8314
[PATCH 433/493] [FIX]fix configurator setting menu
bizzappdev Feb 19, 2020
7c085c6
[PATCH 434/493] [FIX]update po file
bizzappdev Feb 19, 2020
4b959ae
[PATCH 435/493] [FIX][T3200]fix price in cart lines
bizzappdev Feb 24, 2020
437b279
[PATCH 436/493] [FIX][T3200]fix product session in context
bizzappdev Feb 27, 2020
484c758
[PATCH 437/493] [FIX]fix flake8 error
bizzappdev Mar 2, 2020
6074eb1
[PATCH 438/493] [FIX]fix signletom error
bizzappdev Sep 10, 2020
8a9b398
[PATCH 439/493] Fix flake8 error
PCatinean Oct 17, 2020
3cf3ea3
[PATCH 440/493] [13.0][FIX]wrong view inherit (#183)
luc-demeyer Jan 8, 2021
fb09c2e
[PATCH 441/493] FIX user access if sudo() mode (#180)
Jan 11, 2021
60939e4
[PATCH 442/493] [13.0][FIX] Error on smart button with context (#184)
Jan 11, 2021
e72b498
[PATCH 443/493] [IMP] product_configurator: black, isort, prettier
dreispt Mar 19, 2021
004ef3a
[PATCH 444/493] [MIG] product_configurator: Migration to 14.0
dreispt Mar 19, 2021
9905344
[PATCH 445/493] [IMP] Improved the code and made the module as instal…
Chandresh-SerpentCS Mar 31, 2021
f601ddf
[PATCH 446/493] [FIX] product_configurator: wizard form would not open
dreispt Mar 31, 2021
0d0d0f5
[PATCH 447/493] [FIX] Fixed pre-commit, improved the methods.
Chandresh-OSI Apr 16, 2021
50a533e
[PATCH 448/493] [FIX] product_configurator: attribute required error …
dreispt Apr 20, 2021
6d83096
[PATCH 449/493] [FIX] product_configurator: fix installation log warn…
dreispt Apr 20, 2021
513309f
[PATCH 450/493] [FIX] product_configurator: readme, precommit, beta m…
dreispt Apr 27, 2021
91770c1
[PATCH 451/493] [UPD] Update product_configurator.pot
oca-travis Apr 27, 2021
a63c2ad
[PATCH 452/493] [UPD] README.rst
OCA-git-bot Apr 27, 2021
2bd5520
[PATCH 453/493] [FIX] product_configurator: remove old readme file
dreispt Apr 27, 2021
a327812
[PATCH 454/493] product_configurator 14.0.1.0.1
OCA-git-bot May 3, 2021
e63a017
[PATCH 455/493] [MIG] Migrated product_configurator base to V14
PCatinean May 7, 2021
bef8dec
[PATCH 456/493] [MIG] rebase product configurator module.
pledrateam May 13, 2021
3e01389
[PATCH 457/493] [MIG] rebase product configurator module for translat…
pledrateam May 13, 2021
63111c7
[PATCH 458/493] [UPD] Update product_configurator.pot
oca-travis May 13, 2021
d9f2c3c
[PATCH 459/493] [UPD] README.rst
OCA-git-bot May 13, 2021
61108c2
[PATCH 460/493] product_configurator 14.0.1.1.0
OCA-git-bot May 13, 2021
fbabb84
[PATCH 461/493] [FIX]remove stock from depends
pledrateam May 17, 2021
3e45f05
[PATCH 462/493] [FIX]product_configurator: stock depending view move …
pledrateam May 18, 2021
affb808
[PATCH 463/493] product_configurator 14.0.1.2.0
OCA-git-bot May 19, 2021
6a1b9a2
[PATCH 464/493] FIX form_widget.js because it conflicted with the eva…
May 23, 2021
a6bd980
[PATCH 465/493] [FIX] product_configurator: missing variable initiali…
May 23, 2021
84ac843
[PATCH 466/493] product_configurator 14.0.1.2.1
OCA-git-bot May 24, 2021
78ff260
[PATCH 467/493] Modifi Fotmat code
May 24, 2021
0249129
[PATCH 468/493] Modify format by pre-commite
May 24, 2021
b03326f
[PATCH 469/493] product_configurator 14.0.1.2.2
OCA-git-bot May 25, 2021
9235d04
[PATCH 470/493] Add pcatinean as maintainer for all modules
PCatinean Jun 15, 2021
1516404
[PATCH 471/493] [UPD] README.rst
OCA-git-bot Jun 22, 2021
9009743
[PATCH 472/493] [WIP][T-01839]product_configurator: remove price calc…
pledrateam Oct 25, 2021
ac61de5
[PATCH 473/493] [REF] *: fix PCatinean maintainer
dreispt Dec 10, 2021
19d5850
[PATCH 474/493] [UPD] README.rst
OCA-git-bot Dec 10, 2021
3043e19
[PATCH 475/493] product_configurator 14.0.1.2.3
OCA-git-bot Dec 10, 2021
c99d36e
[PATCH 476/493] [FIX] product_configurator: ordinary users don't have…
DonatasV Mar 10, 2022
93f3762
[PATCH 477/493] product_configurator 14.0.1.2.4
OCA-git-bot Mar 22, 2022
9e96408
[PATCH 478/493] [IMP] Change from Transient to regular Model
patrickrwilson Apr 26, 2022
3d9e780
[PATCH 479/493] product_configurator 14.0.1.2.5
OCA-git-bot Jul 4, 2022
4c9c3bf
[PATCH 480/493] [FIX] product_configurator
csil300 Aug 26, 2022
b618fa3
[PATCH 481/493] product_configurator 14.0.1.2.6
OCA-git-bot Sep 27, 2022
23962fd
[PATCH 482/493] [MIG] product_configurator: Migration to 16.0
dannyadair Nov 22, 2023
de52359
[PATCH 483/493] [REF] product_configurator: pre-commit
dreispt Dec 9, 2023
dbfcd16
[PATCH 484/493] [FIX] product_configurator: Deprecated attribute
SirAionTech Jan 10, 2024
c99c607
[PATCH 485/493] [FIX] product_configurator: Validate attributes
SirAionTech Jan 10, 2024
7bafbb5
[PATCH 486/493] [IMP] product_configurator: Use new translation syntax
SirAionTech Jan 10, 2024
b0ee01e
[PATCH 487/493] [IMP] product_configurator: Use new name_search
SirAionTech Jan 10, 2024
6bdca02
[PATCH 488/493] [REF] product_configurator: Remove unused method
SirAionTech Jan 10, 2024
ba6a66d
[PATCH 489/493] [FIX] product_configurator: product.product.price doe…
SirAionTech Jan 11, 2024
2b6b826
[PATCH 490/493] [IMP] product_configurator: Use existing flatten
SirAionTech Jan 11, 2024
e77cfcd
[PATCH 491/493] [FIX] product_configurator: Remove old commented code
SirAionTech Jan 11, 2024
c24067f
[PATCH 492/493] [IMP] product_configurator: Do not recreate same exce…
SirAionTech Jan 10, 2024
6a10823
[PATCH 493/493] [UPD] Update product_configurator.pot
Feb 5, 2024
ac945b4
[ADD] product_configurator: Migrated to v17
Nikul-OSI Feb 7, 2024
a9134c4
[FIX] Fixed validation error
Nikul-OSI Feb 16, 2024
de2eb0d
[FIX] Commented a code.
Ammar-OSI Feb 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions product_configurator/models/product_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
continue
for line in lines[:-1]:
if line.operator == "or":
computed_domain.append("|")

Check warning on line 43 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L43

Added line #L43 was not covered by tests
computed_domain.append(
(line.attribute_id.id, line.condition, line.value_ids.ids)
)
Expand Down Expand Up @@ -96,25 +96,25 @@
@api.depends("attribute_id")
def _compute_template_attribute_value_ids(self):
for domain in self:
domain.template_attribute_value_ids = (

Check warning on line 99 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L99

Added line #L99 was not covered by tests
domain._get_allowed_attribute_value_ids()
)

def _compute_attribute_id_domain(self):
if "product_attribute_ids" in self.env.context:
return [("id", "in", self.env.context["product_attribute_ids"][0][2])]

Check warning on line 105 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L105

Added line #L105 was not covered by tests
return []

def _get_allowed_attribute_value_ids(self):
self.ensure_one()
product_template = self.env["product.template"]

Check warning on line 110 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L109-L110

Added lines #L109 - L110 were not covered by tests
if self.env.context.get("product_tmpl_id"):
product_template = product_template.browse(

Check warning on line 112 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L112

Added line #L112 was not covered by tests
self.env.context.get("product_tmpl_id")
)
template_lines = product_template.attribute_line_ids
attribute_values = self.attribute_id.value_ids
return (

Check warning on line 117 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L115-L117

Added lines #L115 - L117 were not covered by tests
product_template
and (template_lines.mapped("value_ids") & attribute_values)
or attribute_values
Expand Down Expand Up @@ -177,9 +177,9 @@
)
def _compute_template_attribute_ids(self):
for config_line in self:
product_template = config_line.product_tmpl_id
attribute_line_ids = product_template.attribute_line_ids
config_line.template_attribute_ids = attribute_line_ids.mapped(

Check warning on line 182 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L180-L182

Added lines #L180 - L182 were not covered by tests
"attribute_id"
)

Expand Down Expand Up @@ -266,8 +266,8 @@
product_tmpl_id=cfg_img.product_tmpl_id.id,
final=False,
)
except ValidationError as exc:
raise ValidationError(

Check warning on line 270 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L269-L270

Added lines #L269 - L270 were not covered by tests
_(
"Values entered for line '%s' generate "
"a incompatible configuration"
Expand Down Expand Up @@ -321,7 +321,7 @@
lambda line: line != config_step
).mapped("config_step_id")
if config_step.config_step_id in cfg_steps:
raise ValidationError(

Check warning on line 324 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L324

Added line #L324 was not covered by tests
_("Cannot have a configuration step defined twice.")
)

Expand Down Expand Up @@ -369,14 +369,14 @@
def _compute_config_step_name(self):
"""Get the config.step.line name using the string stored in config_step
field of the session"""
cfg_step_line_obj = self.env["product.config.step.line"]
cfg_session_step_lines = self.mapped("config_step")

Check warning on line 373 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L372-L373

Added lines #L372 - L373 were not covered by tests
cfg_step_line_ids = set()
for step in cfg_session_step_lines:
try:
cfg_step_line_ids.add(int(step))
except ValueError:
_logger.debug("Step from session not valid")

Check warning on line 379 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L379

Added line #L379 was not covered by tests
cfg_step_lines = cfg_step_line_obj.browse(cfg_step_line_ids)
for session in self:
try:
Expand All @@ -386,7 +386,7 @@
)
session.config_step_name = config_step_line.name
except Exception:
_logger.debug("Invalid session data ignored")

Check warning on line 389 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L389

Added line #L389 was not covered by tests
if not session.config_step_name:
session.config_step_name = session.config_step

Expand All @@ -407,20 +407,20 @@

product_tmpl = self.product_tmpl_id

self = self.with_context(active_id=product_tmpl.id)

Check warning on line 410 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L410

Added line #L410 was not covered by tests

value_ids = self.flatten_val_ids(value_ids)

weight_extra = 0.0
product_attr_val_obj = self.env["product.template.attribute.value"]
product_tmpl_attr_values = product_attr_val_obj.search(

Check warning on line 416 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L415-L416

Added lines #L415 - L416 were not covered by tests
[
("product_tmpl_id", "in", product_tmpl.ids),
("product_attribute_value_id", "in", value_ids),
]
)
for product_tmpl_attr_val in product_tmpl_attr_values:
weight_extra += product_tmpl_attr_val.weight_extra

Check warning on line 423 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L423

Added line #L423 was not covered by tests

return product_tmpl.weight + weight_extra

Expand All @@ -437,10 +437,10 @@
cfg_session.weight = cfg_session.get_cfg_weight()

def _compute_currency_id(self):
main_company = self.env["res.company"]._get_main_company()

Check warning on line 440 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L440

Added line #L440 was not covered by tests
for session in self:
template = session.product_tmpl_id
session.currency_id = (

Check warning on line 443 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L442-L443

Added lines #L442 - L443 were not covered by tests
template.company_id.sudo().currency_id.id or main_company.currency_id.id
)

Expand Down Expand Up @@ -507,7 +507,7 @@
def _check_product_id(self):
for session in self.filtered(lambda s: s.state == "done"):
if not session.product_id:
raise ValidationError(

Check warning on line 510 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L510

Added line #L510 was not covered by tests
_("Finished configuration session must have a " "product_id linked")
)

Expand Down Expand Up @@ -553,14 +553,14 @@
if field_vals[0] == 6:
field_val += field_vals[2] or []
elif field_vals[0] == 4:
field_val.append(field_vals[1])

Check warning on line 556 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L556

Added line #L556 was not covered by tests
# field_val = [
# i[1] for i in vals[field_name] if vals[field_name][0]
# ] or vals[field_name][0][1]
elif not attr_line.multi and isinstance(vals[field_name], int):
field_val = vals[field_name]
else:
raise UserError(

Check warning on line 563 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L563

Added line #L563 was not covered by tests
_("An error occurred while parsing value for attribute %s")
% attr_line.attribute_id.name
)
Expand All @@ -573,8 +573,8 @@
val = vals.get(custom_field_name, False)
if attr_line.attribute_id.custom_type == "binary":
# TODO: Add widget that enables multiple file uploads
val = [{"name": "custom", "datas": vals[custom_field_name]}]
custom_val_dict.update({attr_id: val})

Check warning on line 577 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L576-L577

Added lines #L576 - L577 were not covered by tests
# Ensure there is no standard value stored if we have switched
# from selected value to custom value.
attr_val_dict.update({attr_id: False})
Expand Down Expand Up @@ -634,7 +634,7 @@
).unlink()

if custom_val_dict:
binary_field_ids = (

Check warning on line 637 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L637

Added line #L637 was not covered by tests
self.env["product.attribute"]
.search(
[
Expand All @@ -652,9 +652,9 @@
continue

if "custom_value_ids" not in update_vals:
update_vals["custom_value_ids"] = []

Check warning on line 655 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L655

Added line #L655 was not covered by tests

custom_vals = {"attribute_id": attr_id}

Check warning on line 657 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L657

Added line #L657 was not covered by tests

if attr_id in binary_field_ids:
attachments = [
Expand All @@ -665,11 +665,11 @@
)
for val in vals
]
custom_vals.update({"attachment_ids": attachments})

Check warning on line 668 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L668

Added line #L668 was not covered by tests
else:
custom_vals.update({"value": vals})

Check warning on line 670 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L670

Added line #L670 was not covered by tests

update_vals["custom_value_ids"].append((0, 0, custom_vals))

Check warning on line 672 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L672

Added line #L672 was not covered by tests
self.write(update_vals)

def write(self, vals):
Expand All @@ -677,7 +677,7 @@
# TODO: Issue warning when writing to value_ids or custom_val_ids
res = super().write(vals)
if not self.product_tmpl_id:
return res

Check warning on line 680 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L680

Added line #L680 was not covered by tests
value_ids = self.value_ids.ids
avail_val_ids = self.values_available(value_ids)
if set(value_ids) - set(avail_val_ids):
Expand All @@ -685,9 +685,9 @@
try:
self.validate_configuration(final=False)
except ValidationError as exc:
raise ValidationError(_("{}".format(exc)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe raise ValidationError(_("{}").format(exc))?
Or even better, I can't see the point for this except, what if we remove it?

except Exception as exc:
raise ValidationError(_("Invalid Configuration")) from exc

Check warning on line 690 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L688-L690

Added lines #L688 - L690 were not covered by tests
return res

@api.model_create_multi
Expand All @@ -711,7 +711,7 @@
)
value_ids = vals.get("value_ids")
if value_ids:
default_val_ids += value_ids[0][2]

Check warning on line 714 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L714

Added line #L714 was not covered by tests
try:
self.validate_configuration(
value_ids=default_val_ids,
Expand All @@ -721,9 +721,9 @@
# TODO: Remove if cond when PR with
# raise error on github is merged
except ValidationError as exc:
raise ValidationError(_("%s") % exc.name) from exc
except Exception as exc:
raise ValidationError(

Check warning on line 726 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L724-L726

Added lines #L724 - L726 were not covered by tests
_(
"Default values provided generate an invalid "
"configuration"
Expand Down Expand Up @@ -754,9 +754,9 @@
try:
self.validate_configuration()
except ValidationError as exc:
raise ValidationError(_("%s") % exc.name) from exc
except Exception as exc:
raise ValidationError(_("Invalid Configuration")) from exc

Check warning on line 759 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L757-L759

Added lines #L757 - L759 were not covered by tests

duplicates = self.search_variant(
value_ids=value_ids, product_tmpl_id=self.product_tmpl_id
Expand All @@ -783,7 +783,7 @@
if value_ids is None:
value_ids = self.value_ids.ids

value_obj = self.env["product.attribute.value"].with_context(

Check warning on line 786 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L786

Added line #L786 was not covered by tests
pricelist=pricelist.id
)
values = (
Expand All @@ -798,14 +798,14 @@
value_ids = self.value_ids.ids
vals = self._get_option_values(pricelist, value_ids)
for val in vals:
prices["vals"].append(

Check warning on line 801 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L801

Added line #L801 was not covered by tests
(
val.attribute_id.name,
val.product_id.name,
val.product_id.price,
)
)
product = val.product_id.with_context(pricelist=pricelist.id)

Check warning on line 808 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L808

Added line #L808 was not covered by tests
product_prices = product.taxes_id.sudo().compute_all(
price_unit=product.price,
currency=pricelist.currency_id,
Expand All @@ -814,10 +814,10 @@
partner=self.env.user.partner_id,
)

total_included = product_prices["total_included"]
taxes = total_included - product_prices["total_excluded"]
prices["taxes"] += taxes
prices["total"] += total_included

Check warning on line 820 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L817-L820

Added lines #L817 - L820 were not covered by tests
return prices

@api.model
Expand Down Expand Up @@ -929,7 +929,7 @@
("state", "=", state),
]
if parent_id:
domain.append(("parent_id", "=", parent_id))

Check warning on line 932 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L932

Added line #L932 was not covered by tests
return domain

def get_session_vals(self, product_tmpl_id, parent_id=None, user_id=None):
Expand Down Expand Up @@ -967,7 +967,7 @@
if (value_ids or custom_value_ids) and state != "select":
return False
elif not (value_ids or custom_value_ids) and state != "select":
raise UserError(

Check warning on line 970 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L970

Added line #L970 was not covered by tests
_(
"You must select at least one "
"attribute in order to configure a product"
Expand All @@ -994,7 +994,7 @@
if next_step:
pass
elif not (value_ids or custom_value_ids):
raise UserError(

Check warning on line 997 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L997

Added line #L997 was not covered by tests
_(
"You must select at least one "
"attribute in order to configure a product"
Expand Down Expand Up @@ -1140,7 +1140,7 @@
step_to_open = step
break
if step_to_open:
return "%s" % (step_to_open.id)

Check warning on line 1143 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1143

Added line #L1143 was not covered by tests
return False

@api.model
Expand Down Expand Up @@ -1271,7 +1271,7 @@
# Validate custom values
attr = line.attribute_id
if attr.id in custom_vals:
attr.validate_custom_val(custom_vals[attr.id])

Check warning on line 1274 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1274

Added line #L1274 was not covered by tests
if final:
common_vals = set(value_ids) & set(line.value_ids.ids)
custom_val = custom_vals.get(attr.id)
Expand All @@ -1287,7 +1287,7 @@
and not custom_val
):
# TODO: Verify custom value type to be correct
raise ValidationError(

Check warning on line 1290 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1290

Added line #L1290 was not covered by tests
_("Required attribute '%s' is empty") % (attr.name)
)

Expand Down Expand Up @@ -1364,7 +1364,7 @@
custom_attrs_with_error = list(
set(custom_vals.keys()) - set(custom_attr_ids)
)
custom_attrs_with_error = self.env["product.attribute"].browse(

Check warning on line 1367 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1367

Added line #L1367 was not covered by tests
custom_attrs_with_error
)
error_message = _(
Expand All @@ -1377,7 +1377,7 @@
)
message_vals = ""
for attr_id in custom_attrs_with_error:
message_vals += f"\n {attr_id.name}: {custom_vals.get(attr_id.id)}"

Check warning on line 1380 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1380

Added line #L1380 was not covered by tests
raise ValidationError(error_message % (message_vals))

# Check if there are multiple values passed for non-multi attributes
Expand All @@ -1387,7 +1387,7 @@
attrs_with_error = {}
for line in mono_attr_lines:
if len(set(line.value_ids.ids) & set(value_ids)) > 1:
wrong_vals = self.env["product.attribute.value"].browse(

Check warning on line 1390 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1390

Added line #L1390 was not covered by tests
set(line.value_ids.ids) & set(value_ids)
)
attrs_with_error[line.attribute_id] = wrong_vals
Expand All @@ -1402,7 +1402,7 @@
)
message_vals = ""
for attr_id, vals in attrs_with_error.items():
message_vals += "\n {}: {}".format(

Check warning on line 1405 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1405

Added line #L1405 was not covered by tests
attr_id.name, ", ".join(vals.mapped("name"))
)
raise ValidationError(error_message % (message_vals))
Expand All @@ -1425,9 +1425,9 @@
value_ids = list(set(value_ids) - set(custom_value_id.ids))

if not product_tmpl_id:
product_tmpl_id = self.product_tmpl_id

Check warning on line 1428 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1428

Added line #L1428 was not covered by tests
if not product_tmpl_id:
raise ValidationError(

Check warning on line 1430 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1430

Added line #L1430 was not covered by tests
_(
"Cannot conduct search on an empty config session "
"without product_tmpl_id kwarg"
Expand Down Expand Up @@ -1485,9 +1485,9 @@
if value_ids and value_ids[0]:
for val in value_ids:
if not val:
continue

Check warning on line 1488 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1488

Added line #L1488 was not covered by tests
if isinstance(val, list):
flat_val_ids.add(val[1])

Check warning on line 1490 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1490

Added line #L1490 was not covered by tests
elif isinstance(val, int):
flat_val_ids.add(val)
return list(flat_val_ids)
Expand All @@ -1496,8 +1496,8 @@
if prices is None:
prices = {}
dp = None
prices["taxes"] = formatLang(self.env, prices["taxes"], monetary=True, dp=dp)
prices["total"] = formatLang(self.env, prices["total"], monetary=True, dp=dp)

Check warning on line 1500 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1499-L1500

Added lines #L1499 - L1500 were not covered by tests
prices["vals"] = [
(v[0], v[1], formatLang(self.env, v[2], monetary=True, dp=dp))
for v in prices["vals"]
Expand All @@ -1510,19 +1510,19 @@
:param custom_vals: dict {product.attribute.id: custom_value}
:returns: list of custom values compatible with write and create
"""
attr_obj = self.env["product.attribute"]
binary_attribute_ids = attr_obj.search([("custom_type", "=", "binary")]).ids

Check warning on line 1514 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1513-L1514

Added lines #L1513 - L1514 were not covered by tests
custom_lines = []

for key, val in custom_vals.items():
custom_vals = {"attribute_id": key}

Check warning on line 1518 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1518

Added line #L1518 was not covered by tests
# TODO: Is this extra check neccesairy as we already make
# the check in validate_configuration?
attr_obj.browse(key).validate_custom_val(val)
if key in binary_attribute_ids:
custom_vals.update({"attachment_ids": [(6, 0, val.ids)]})

Check warning on line 1523 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1523

Added line #L1523 was not covered by tests
else:
custom_vals.update({"value": val})

Check warning on line 1525 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1525

Added line #L1525 was not covered by tests
custom_lines.append((0, 0, custom_vals))
return custom_lines

Expand All @@ -1530,12 +1530,12 @@
def get_child_specification(self, model, parent):
"""return dictiory of onchange specification by
appending parent before each key"""
model_obj = self.env[model]
specs = model_obj._onchange_spec()
new_specs = {}

Check warning on line 1535 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1533-L1535

Added lines #L1533 - L1535 were not covered by tests
for key, val in specs.items():
new_specs[f"{parent}.{key}"] = val
return new_specs

Check warning on line 1538 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1537-L1538

Added lines #L1537 - L1538 were not covered by tests

@api.model
def get_onchange_specifications(self, model):
Expand All @@ -1544,16 +1544,19 @@
- needed this method because odoo don't add specification for fields
one2many or many2many there is view-reference(using : tree_view_ref)
intead of view in that field"""
model_obj = self.env[model]
specs = model_obj._onchange_spec()

Check warning on line 1548 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1547-L1548

Added lines #L1547 - L1548 were not covered by tests
for name, field in model_obj._fields.items():
if field.type not in ["one2many", "many2many"]:
continue
ch_specs = self.get_child_specification(
model=field.comodel_name, parent=name
)
specs.update(ch_specs)

# TODO :- Commented a code and ths code already base in a odoo base modules.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just delete the code then.

# for name, field in model_obj._fields.items():
# if field.type not in ["one2many", "many2many"]:
# continue
# ch_specs = self.get_child_specification(
# model=field.comodel_name, parent=name
# )
# specs.update(ch_specs)

return specs

Check warning on line 1559 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1559

Added line #L1559 was not covered by tests

@api.model
def get_vals_to_write(self, values, model):
Expand All @@ -1561,24 +1564,24 @@
- same functionality by _convert_to_write
- needed this method because odoo don't call convert to write
for the many2many/one2many fields"""
model_obj = self.env[model]
values = model_obj._convert_to_write(values)
fields = model_obj._fields

Check warning on line 1569 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1567-L1569

Added lines #L1567 - L1569 were not covered by tests
for key, vals in values.items():
if not isinstance(vals, list):
continue
new_lst = []

Check warning on line 1573 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1572-L1573

Added lines #L1572 - L1573 were not covered by tests
for line in vals:
new_line = line

Check warning on line 1575 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1575

Added line #L1575 was not covered by tests
if line and isinstance(line[-1], dict):
new_line = line[:-1] + (

Check warning on line 1577 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1577

Added line #L1577 was not covered by tests
self.get_vals_to_write(
values=line[-1], model=fields[key].comodel_name
),
)
new_lst.append(new_line)
values[key] = new_lst
return values

Check warning on line 1584 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1582-L1584

Added lines #L1582 - L1584 were not covered by tests


class ProductConfigSessionCustomValue(models.Model):
Expand All @@ -1589,8 +1592,8 @@
@api.depends("attribute_id", "attribute_id.uom_id")
def _compute_val_name(self):
for attr_val_custom in self:
uom = attr_val_custom.attribute_id.uom_id.name
attr_val_custom.name = "{}{}".format(

Check warning on line 1596 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1595-L1596

Added lines #L1595 - L1596 were not covered by tests
attr_val_custom.value,
(" %s" % uom) or "",
)
Expand Down Expand Up @@ -1618,7 +1621,7 @@
"""Return custom value evaluated using the related custom field type"""
field_type = self.attribute_id.custom_type
if field_type == "binary":
vals = self.attachment_ids.mapped("datas")

Check warning on line 1624 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1624

Added line #L1624 was not covered by tests
if len(vals) == 1:
return vals[0]
return vals
Expand All @@ -1639,7 +1642,7 @@
)
> 1
):
raise ValidationError(

Check warning on line 1645 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1645

Added line #L1645 was not covered by tests
_("Configuration cannot have the " "same value inserted twice")
)

Expand All @@ -1657,16 +1660,16 @@
@api.constrains("attachment_ids", "value")
def check_custom_type(self):
for custom_val in self:
custom_type = custom_val.attribute_id.custom_type

Check warning on line 1663 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1663

Added line #L1663 was not covered by tests
if custom_val.value and custom_type == "binary":
raise ValidationError(

Check warning on line 1665 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1665

Added line #L1665 was not covered by tests
_(
"Attribute custom type is binary, attachments are the "
"only accepted values with this custom field type"
)
)
if custom_val.attachment_ids and custom_type != "binary":
raise ValidationError(

Check warning on line 1672 in product_configurator/models/product_config.py

View check run for this annotation

Codecov / codecov/patch

product_configurator/models/product_config.py#L1672

Added line #L1672 was not covered by tests
_(
"Attribute custom type must be 'binary' for saving "
"attachments to custom value"
Expand Down
Loading