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

[MRG] website_sale_coupon: move to community #32286

Closed
wants to merge 289 commits into from

Conversation

Projects
None yet
@JKE-be
Copy link
Contributor

commented Apr 1, 2019

No description provided.

rop-odoo and others added some commits Jan 5, 2017

[FIX] sale_coupon: really use a meaningful icon
Followup of b0d07503365c67a4ad02318c362864eeb7e02f16 and #851
[FIX] sale_coupon: incorrect view
This part of the view was supposed to be removed, only purpose was
debugging.

opw-725178
[ADD] sale_management: Separate sales menu items from sale app
Purpose
=======

Don't display sales app icon in Odoo homepage when installing ecommerce (only website should be visible)
it's confusing to have sales icon  -> where do I manage my sales? In sales or in website? -> in website

Specfication
============

We need one new modules to add Sales menus to the homepage. Currently they come with "sale". So when installing "website_sale", we get them (because sale and account are dependencies of website_sale). We don't want that anymore. Along with that you need to replace modules in Apps menu:
sales menu items must be in the new sale_management module, no longer in sale

- create new app "sale_management"
- Currently 3 app icons when installing ecommerce (Sales, Invoicing, Website) -> too many icons, where to start? -> GOAL: Only 2 icons > Website, Invoicing
- new module to display Sales Icon (like account_accountant): "sale_management"
- move menu items to sale_management
- sale, sale_management: move app description, rewrite the manifest file
- sale, sale_management: move tour from sale > sale_management
- Changes in some dependency module "sale" > "sale_management" modules: event_sale, mrp_repair, pos_sale, report_intrastat, sale_crm, sale_expense, sale_stock, sale_timesheet, website_quote

Menu items to move 'sale' --> 'sale_management'
===============================================

Sales
	Quotations
        Sales Orders
Invoicing
	Orders to invoice
        Orders to Upsell
Catalog
	Products
        Product Variants
        Pricelists
Reporting
	sales
Configuration
	Settings
        Products -Attributes, Attribute Values, Internal Categories
[IMP] various: Add kanban views for all menuitems used in mobile
Purpose
=======

Improve readability on mobile

Specification
=============

Activate Kanban view on those so it could be displayed by default on mobile instead of view list

List of impacted modules:

- crm_voip: kanban for phonecalls

- website_crm_score: kanban for scoring rules

- pos_loyalty: kanban for loyalty programs

- account_deferred_revenue : kanban for deferred revenues(reuse assets)

- account_deferred_revenue : kanban for deferred revenues(reuse asset types)

- quality: kanban for quality control points

- helpdesk: kanban for all tickets

- quality: kanban for quality alert stages

- mrp_plm : kanban for ECO stages

- print: kanban for print provider

- print: kanban for print orders

- sale_coupon: kanban for coupon program

- sale_coupon: kanban for promotion program(reuse Coupon Program)

- website_crm_score: kanban for Teams Assignation(Reuse the sale channels)

- quality: kanban for quality teams(reuse Quality Dashboard).

- mrp_plm : kanban for ECO Types(reuse PLM Dashboard)

- account_reports_followup: kanban for Follow up level
[FIX] sale_coupon: Correct xml_ids for 2 menuitems
The xml_ids of 2 parent menuitems have changed in community repo.
[FIX] sale_coupon: unlink an empty set of order lines
This is possible that `unlink` is called without any record in self.
In the given case, this is because of
`self.env['sale.order.line'].search([('order_id', 'in', self.ids), ('is_delivery', '=', True)]).unlink()`
in the `undelivery_set` method of the module delivery.

`Unlink` on an empty set is supported, and it should therefore be the case here as well.
This is not because `self.order_id.no_code_promo_program_ids` expects a singleton
for the `self.order_id` part, and this is actually an empty set as `self` is an empty set.

Besides, it makes sense to loop on the lines passed to `self`,
as you could pass several lines, not all having the same
`product_id`, for the above line
`related_program = self.env['sale.coupon.program'].search([('discount_line_product_id', '=', self.product_id.id)])`

opw-746084
[FIX] sale_coupon: Allow coupon usage for non customers
Purpose
=======

On a sale coupon program, the allowed partners are the customers by default.

That way, users like the Administrator aren't allowed to use coupon on a fresh database

Specification
=============

Allow all the partners by default and the user restrict the partners as he wishes.

Before this commit:
Coupon Program: Only customers have access to rewards
Promotional Program: Only customers have access to reward and this can be retricted with a domain

After this commit:
Coupon Program: All partners have access to rewards
Promotional Program: All partners have access to reward and this can be retricted with a domain
[FIX] sale_coupon: Prevent users to modify the reward line product
Purpose
=======

People doesn't understand that the reward line product is the product that will be used in the discount line, not the product the be rewarded

If they set another product before the program is created, the product they set will be renamed, which is wrong.

Specification
=============

- Don't display the field before it's set
- Make the field readonly on the program form view
[FIX] sale_coupon: Don't update automatic rewards on the fly
Purpose
=======

Currently we are updating the coupon rewards on the fly when creating/modifying/deleting a sales order line.

To avoid multiple searches on res_partners and product to know whether the customer/product is valid on the sale coupon program, we store the applicable customers and products on the program according to the domain defined on it.

This brings 2 issues:
- The customers/products stored on the program are not updated (Was the original spec)
- The checks are numerous and maybe overkill for the given results

Specification
=============

- Don't recompute the reward lines on SO modifications. Add a button to compute the line by hand and make an automatic compute on the SO validation or on the page shop/payment.

- When recomputing the reward lines, make a search on the res_partners and products instead. Now that the action is not triggered so often we can afford to make a search.

- Don't use the fields rule_partners_domain and rule_products_domain. This should be removed in master.

- The field is_public_included is useless now. And we decided to make the coupon available for all the partners if they fit the domain on the program.
[FIX] sale_coupon: Don't update automatic rewards on the fly
Purpose
=======

Currently we are updating the coupon rewards on the fly when creating/modifying/deleting a sales order line.

To avoid multiple searches on res_partners and product to know whether the customer/product is valid on the sale coupon program, we store the applicable customers and products on the program according to the domain defined on it.

This brings 2 issues:
- The customers/products stored on the program are not updated (Was the original spec)
- The checks are numerous and maybe overkill for the given results

Specification
=============

- Don't recompute the reward lines on SO modifications. Add a button to compute the line by hand and make an automatic compute on the SO validation or on the page shop/payment.

- When recomputing the reward lines, make a search on the res_partners and products instead. Now that the action is not triggered so often we can afford to make a search.

- Don't use the fields rule_partners_domain and rule_products_domain. This should be removed in master.

- The field is_public_included is useless now. And we decided to make the coupon available for all the partners if they fit the domain on the program.
[FIX] sale_coupon: remove useless @Depends
Theses fields are now deprecated.

KangOl and others added some commits Nov 16, 2018

[REF] *: update js test suite to use helpers
This rev. is the counterpart of community PR /pull/28784.

Joint work with aab, dam, ged, mge, svs and vsc.

closes odoo/enterprise#3100
[REM] *: remove pycompat py2 helpers/shims
This commit complements the removal of pycompat PY2 helpers and shims
from base by removing / adapting references to these helpers from the
enterprise code.
[FIX] website_sale_coupon: no crash allowed in tour
The tour shop_sale_coupon was changed to use the testUtils.dom.click
method when we introduced the new test utility functions.  Probably
because the filename ends with 'test.js'.  Obviously, this is not
correct, because the testUtils function is not imported.

To prevent issues in the future, we simply remove the two problematic
calls.  Another solution was to import the testUtils module, however, I
think that it is simpler not to use those functions at all in tours,
because tours can be executed in the web client/website, and in that
case, they do not have access to the test utility functions.

closes odoo/enterprise#3239
[FIX] sale_coupon(_delivery): fix coupon test with product configurator
The copy() is unnecessary, and it is introducing an issue because
product.template.attribute.value are not created correctly for copied templates.

The test can be done on the original data, the transaction is going to be
reverted either way.

closes odoo/enterprise#3301
[FIX] sale_coupon: sdd sequence to the list view
The coupon program applies only one rule based on the sequence.

Steps to reproduce the bug:

Create a promotion with 5% if untaxed amount is greater than 1,000$
Create a promotion with 10% if untaxed amount is greater than 2,000$
Create a promotion with 15% if untaxed amount is greater than 3,000$
Create a SO for 3500$
Click on "Update Promotions"

Bug:

The 5% promotion is applied because it is the first one in the list.

Solution:

Display the sequence field in the list view with a handle to sort the different
promotions.

closes odoo/enterprise#3209
[REF] *: definitely get rid of web_editor.base
* website_form_editor, website_sale_coupon

Part of odoo/enterprise#3603
See #29442
task-1932066
[ADD] helpdesk_sale_coupon: Generate coupons from tickets
Add button to tickets to open a wizard to offer a selected coupon to a customer.

TaskID: 1909413
[REF] website_sale_coupon: adapt test to renamed class
See #30366
task-1866973

closes odoo/enterprise#3780

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>

@robodoo robodoo added the seen 🙂 label Apr 1, 2019

@JKE-be JKE-be force-pushed the odoo-dev:master-temp-coupon2-jke branch to 69db63d Apr 1, 2019

@C3POdoo C3POdoo added the RD label Apr 1, 2019

@seb-odoo

This comment has been minimized.

Copy link
Contributor

commented Apr 4, 2019

@JKE-be you can probably close this one

@JKE-be JKE-be closed this Apr 5, 2019

@robodoo robodoo added the closed 💔 label Apr 5, 2019

@JKE-be JKE-be deleted the odoo-dev:master-temp-coupon2-jke branch Jun 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.