-
Notifications
You must be signed in to change notification settings - Fork 27k
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
[FIX] Load all pricelist rules base on product pricelis titem sequence #11988
Conversation
@@ -156,7 +156,7 @@ def _price_rule_get_multi(self, cr, uid, pricelist, products_by_qty_by_partner, | |||
'AND (categ_id IS NULL OR categ_id = any(%s)) ' | |||
'AND (pricelist_id = %s) ' | |||
'AND ((i.date_start IS NULL OR i.date_start<=%s) AND (i.date_end IS NULL OR i.date_end>=%s))' | |||
'ORDER BY applied_on, min_quantity desc', | |||
'ORDER BY sequence, applied_on, min_quantity desc', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you should order by applied_on
first
a6a2161
to
282d1bf
Compare
@KangOl : Improved code as per your suggestion, please review it. |
I think there are 2 issues here:
And moreover, such a change was reverted a few months ago: a6badd2
|
This reverts commit b0f02e3. As pointed out by @nim-odoo [1], a similar patch has already been uncommited few month ago [2]. Ref #11988 opw-676422 [1] https://git.io/vrYxY [2] see a6badd2
I wanted to support sequence but i changed my mind fp is right it's better without. |
* [FIX] base: fetch mimetype on ir.attachment for binary fields * [FIX] sale: Teams dashboard, sales to invoice count From 9.0, a sales order to invoice is no longer a sales order in the state `manual`, but with the Invoice Status "to invoice". Before this revision, the sales order to invoice were simply not counted at all, and this count always displayed 0. opw-675919 * [FIX] mail: visibility rules for channel notifications Avoid raising an access denied error for messages that the user has indeed be notified about. The issue arose when a message posted on a document inaccessible to the user was notified to one of the channels the user is subscribed to. The access control logic on messages relies on 2 heuristics to grant read access to a message: a. either the user was notified about the messages, by being a follower of the document, or a subscriber of a channel following the document (in that case the user can see the message but not the document) b. or the user has read access to the document on which the message is posted (in that case the user can see both the message and the document) Case `a.` sometimes fail to match when a message got notified to several channels including one the user was not subscribed to. Depending on the order of the returned rows in the SQL query, the "foreign" channels could shadow the channels of the user, making `a.` a non-match. If case `b.` did not match either, the user would have the `read` access denied, even though the message was visible by the `search()` method. The fix explicitly makes case `a.` match if the user was notified in *at least* one channel. This was not done through a change of the SQL query ORDER, for readability reasons. * [FIX] base: fixes previous fix In fix e248882, the previous elif statement prevented the execution of the fix code. This fix fixes the fix. * [FIX] hr_recruitment: no create on ir_attachment action The "Resumes and Letters" action simply displays ir_attachments linked to hr_applicant objects; but there is no default_res_model in the context so no ir_attachment you create is actually displayed in the kanban view. Since the goal of this action is simply to display attachments linked to applicants, it makes more sense to disable the create button and to force people to upload resumes and cover letters through the applicant record. * [FIX] website_sale: log if no pricelist The pricelist field is not a mandatory field on the partner. A default value is usually defined for any new partner created. However, if the pricelist is manually removed from the partner, errors (tracebacks) will occur in the eCommerce when no pricelist is found. We cannot make the field mandatory, as it could potentially break the workflow of some users which are not using eCommerce. Therefore, we simply log an error message to help debugging. opw-673453 * [FIX] account_asset: asset_create When creating assets from invoice lines, the system must check that assets have not already been created for the related invoice. If assets already exist then these assets have to be removed. Used case: - In the purchase journal, tick "allow canceling entries" - On a supplier invoice line, set an asset category - validate the invoice - cancel the invoice - set to draft - validate the invoice Before the fix: the asset is created twice. After the fix: the asset is created once. opw:674674 * [FIX] account_asset: asset_create When creating assets from invoice lines, the system must check that assets have not already been created for the related invoice. If assets already exist then these assets have to be removed. Used case: - In the purchase journal, tick "allow canceling entries" - On a supplier invoice line, set an asset category - validate the invoice - cancel the invoice - set to draft - validate the invoice Before the fix: the asset is created twice. After the fix: the asset is created once. opw:674674 * [FIX] account_asset: Typo error * [FIX] website_form: prevent users from crazy clicking If the feedback of a form is too slow, people might be tempted to click a second time, trigerring a second request. If, after that, the result has not been received yet, the user might be tempted to click a lot of time because he is angry at such slowness. This behavior would trigger a record creation each time the user clicked the submit button. This fix disables the button once it has been clicked once, and re-enable it if the record could not be created, which means that there was an error in the input and the user needs to change the values and try again. The button has been changed to a span to avoid the default browser behavior to post the form when no function is bound on the send button. * [FIX] crm_claim: access rights for portal user The portal user is not allowed to read the crm.team model. opw:673480 * [FIX] res: Creating a partner with an invoice contact When creating a partner with company_type='person' and with an invoice adress, the created partner must stay a person. Now a partner which is not a comany can have an invoice address. Fixes #11730 opw:675322 * [FIX] purchase: delete unnecessary PO line In v8.0, when a procurement is cancelled and the quantity remaining on the PO line is zero, the line is deleted. It was not the case anymore after the Purchase refactoring. opw-675493 * [FIX] calendar: correct search on mail.message and ir.attachment Handle the case of immutable (tuple) domain leafs. * [IMP] doc: simpler coding: utf-8 According to PEP-263, the -*- is just a variant "using formats recognized by popular editors". * [IMP] doc: add guidelines warning To prevent huge chunk of modifications for styling reasons (e.g. mass PEP8 commits) * [FIX] account_asset: asset_create When creating assets from invoice lines, the system must check that assets have not already been created for the related invoice. If assets already exist then these assets have to be removed. Used case: - In the purchase journal, tick "allow canceling entries" - On a supplier invoice line, set an asset category - validate the invoice - cancel the invoice - set to draft - validate the invoice Before the fix: the asset is created twice. After the fix: the asset is created once. opw:674674 Note: This is a cherry-pick of commits 9d14230 and 58a5b5e * [FIX] account: amount currency in journal items list view In 8.0, the amount currency field was displayed in the journal items list view when choosing, thanks to the `quick add` widget, a journal with a currency set. Otherwise, if the journal had no currency set, the column was not displayed. It was done thanks to the key "currency" passed in the context. From 9.0, the `quick add` is no longer used, and, due to that, the amount currency field was no longer displayed in the journal items list view at all, despite if the journal had a currency set or not. In technical words, `currency` was no longer passed in the context, making the invisibility property set with `invisible="not context.get('currency',False)"` useless. As this widget is no longer used, there is no other choice than either always display the column, either never. We choose to display it only if you have the multi-currency group (as this is the case in the journal item form view) We also take the opportunity to move the column next to the debit & credit column, this is more meaningful. opw-676059 * [FIX] tools: export translated fields not included in _columns Non-stored new API computed fields are only defined in _fields but not in _columns, and they were never exported within translation files. Closes #9081 * [IMP] payment_adyen: support autogenerated HMAC SHA-256 key From v4.1.0 of the documentation (2015-06-29), the HMAC SHA-1 key is deprecated. Indeed, it should be considered as a legacy option to guarantee compatibility with older skins. The HMAC SHA-256 key should be used instead, and moreover, it seems that any new skin created does not support SHA-1 at all, even if the option is available. The merchant signature code is inspired from the documentation example. Source: https://docs.adyen.com/developers/hpp-manual Fixes #9786 opw-676081 * [FIX] mail: fix performance issue with large channels When a user is subscribed to a channel with many messages, the discuss initial rpc /mail/client_action can become very slow (in production, the rpc took > 20s when subscribed to the Community mailing list). This is due to the query in _get_message_unread, counting the number of unread messages. This commit adds an index on the relation mail_channel_partner, this allows postgres to perform only index lookups, and speeds up the query by 2 order of magnitudes. * [FIX] web: editable list, up/down navigation on m2o The current behavior was allowing going on the previous row if the user is at the start of an editable element and on the next row if the user is at the end of an editable element. The problem was, we did not want this behavior when the editable element is a select or m2o (as the up and down input should open the select/m2o dropdown instead). * [FIX] account: reconciled with forced `amount_currency` This is possible to create bank statements forcing the amount in the foreign currency, along with the bank account currency, and therefore to force the foreign currency rate. In such a case, when reconciling the journal items, the currency rate conversion must not be done against the currency rates written in database, in the rates records, at that date, but with the rate that was forced in the bank statement. opw-676048 * [FIX] crm: take contact information on customer creation on opp Conflicts: addons/crm/crm_lead_view.xml * [FIX] stock: default_get waits for a field list And not a 2-item dict that does not crash by chance. Hooray for python. * [FIX] payment_ogone: transaction code for alias AFU The Automated File Upload (AFU) Ogone API requires a transaction code to be set, either: - ATR for automated transactions - MTR for maintenance operations The default is ATR and is used for submitting transactions in batch. However, the server-to-server mode of payment_ogone only uses the AFU API to create new credit card aliases, and not to process transactions. Using the ATR transaction code requires the ATR feature to be available in the Ogone Merchant account - a paying option that is otherwise unused. Using MTR as the transaction code is sufficient for adding aliases, and the corresponding feature (MTR) is available at no cost in most Ogone Merchant Accounts. References: - Ogone Advanced Batch: https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/batch - Ogone Alias Management: https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/alias/bulk-alias-management-via-batch * [FIX] stock: missing picking_type_id field The picking type is not defined on the stock move when a picking is created manually. This can cause errors, for example in manufacturing: a product sold in kit will not be replaced by its components. opw-673741 * [FIX] sale: Invoicing several SO with same partner and different invoice address When invoicing several SO with same partner and with different invoice address, different invoices have to be created with each invoice address. Used case: -create a customer with two invoice addresses -create a SO for this customer with the first address -create a SO for this customer with the second address -select the two SO in the SO tree view -click on "Invoice Order" -click on "Create and view invoices" Results: Before the fix: The two SO are merged in one invoice with the second address. After the fix: Two invoices are created, one for the first address and one for the second address. opw:675961 * [FIX] crm: remove lead kanban view Since the crm refactoring in V9, the stages doesn't make sense anymore on a lead, as this step is only to validate an opportunity. We should remove this view as it is confusing in this case : If I create a stage on the opportunity form view, it appears also on the lead kanban view. Other side effects can also be encountered. * [FIX] fields: filter result of 2many related fields with related_sudo When traversing relational fields as superuser, you end up with a recordset for which only a subset is accessible to the current user. An earlier fix to this issue completely dropped the `related_sudo` feature; change its implementation to keep the feature. * [REF] account_bank_statement_import: small refactoring to make possible inheritance * [FIX] fields: delay recomputations when setting a binary field in attachment Setting a binary field stored in attachment may trigger recomputations on the main record before all fields are set on that record. This may cause access errors if the record does not satisfy some access rule because of the fields that are not set yet. * [FIX] expression: fix missing results in direct search on many2many fields This case corresponds to searches like `[(field, 'ilike', name)]` where `field` is a many2many field. The domain processing performs a `name_search` on the field's comodel, then makes the relation match the returned record ids. Problem: the call to `name_search` uses the default limit (100), and this makes the search return less results than expected. Make the search complete by forcing `limit=None`. * [FIX] expression: fix missing results in direct search on many2many fields This case corresponds to searches like `[(field, 'ilike', name)]` where `field` is a many2many field. The domain processing performs a `name_search` on the field's comodel, then makes the relation match the returned record ids. Problem: the call to `name_search` uses the default limit (100), and this makes the search return less results than expected. Make the search complete by forcing `limit=None`. * [I18N] Update translation terms from Transifex * [I18N] Update translation terms from Transifex * [I18N] Update translation terms from Transifex * [FIX] mail: composer: escape RegExp pattern to prevent crashes if the user types, e.g. a \, when mentionning someone. * [FIX] account: sequence_id field in account.journal The sequence_id field can be seen in debug mode but it cannot be edited. opw:676223 * [FIX] account_bank_statement_import_ofx: multiple accounts An OFX file can contain more than one account. Therefore, we need to loop over all the included accounts, otherwise statements will be missed. opw-673814 * [FIX] sale_mrp, sale_stock: _get_anglo_saxon_price_unit with a kit When a kit is set with a valuation = "real_time" and invoice_policy = "delivery", the price unit of the kit computed for the Expense Account in the the journal of entries must be the sum of the average price of each component of this kit. Used case: Create a kit001 with: *General information: -Product Type=Stockable Product -Invoicing Policy=Delivered Quantities -Sale Price=100$ -Cost Price=80$ *Inventory: -Route=Manufacture -Internal Category=All/Sealable *its product category set with -Expense Account=210000 Cost of Goods Sold -Costing Method=Standard Price -Inventory Valuation=Perpetual(automated) *a bom of two components child001 and child002 Create child001 with: *General information: -Product Type=Stockable Product -Invoicing Policy=Delivered Quantities -Sale Price=100$ -Cost Price=70$ *Inventory: -Route=Buy -Internal Category=All *its product category set with -Expense Account=210000 Cost of Goods Sold -Costing Method=Real Price -Inventory Valuation=Perpetual(automated) Create child002 with: *General information: -Product Type=Stockable Product -Invoicing Policy=Delivered Quantities -Sale Price=100$ -Cost Price=10$ *Inventory: -Route=Buy -Internal Category=All *its product category set with -Expense Account=210000 Cost of Goods Sold -Costing Method=Real Price -Inventory Valuation=Perpetual(automated) Create a SO with: -one line with the kit001 Confirm the SO Validate the Delivery Create and view the invoices -per invoicable lines(deduct down payments) Validate the invoice Result: Before the fix: in the entry created for this invoice, the debit for the kit001 in Cost of Goods Sold was equal to 70 instead of 80. After the fix: the debit for the kit001 in Cost of Goods Sold was equal to 80(the sum of the average price of each component of the kit001). opw:674608 * [FIX] project: make copy overridable in v8 api Without the proper decorator, the method is matched as `cr_ui_context`. This is because the `guess` mechanism expects a name `res_id` instead of `record_id`. For stability reason it is better to add the decorator than modify the signature of the method. Closes #11735 * [CLA] update signature of initos Changes due to changes in the legal form of the company Closes #11759 * [FIX] website_sale: set invoice address When the user has several addresses, the call to the onchange method `onchange_partner_id` will overwrite the actual invoice address chosen. opw-675935 * [I18N] Update translation terms from Transifex Had a timeout on last sync * [FIX] base: res.config default value on selection fields Since 3d8f7c2f, res.config support selection fields to set groups and install modules using a selection field instead of boolean. While the `module_*` fields are correctly casted from boolean to integers, it was not the case with `group_*` fields. This commit forces the conversion to get the expected field format value. Closes #10373 * [FIX] hr_holidays: mail notification on leave request confirm The followers of the departments subscribed to the `Leaves/Allocations Confirmed` are supposed to receive a mail notification when an employee confirms a leave request. It was no longer the case since the below revision: 2be1dfc1ed7c9814cd3dbf4eb4cc95f842f738c2 This revision subscribes the followers of the department following the `confirmed` subtype manually ,on the leave request confirmation, because `message_auto_subscribe` only works on fields for which the value is passed to the `create` or `write` methods, it doesn't work for related/computed fields This can be removed as soon as `department_id` on `hr.holidays` becomes a regular fields or as soon as `message_auto_subscribe` works with related/computed fields. opw-676521 * [FIX] point_of_sale: pass tax_ids to pos_config view It's needed by the onchange on product_id. Without this the price will be correctly computed by `onchange_product_id` but upon saving the record tax_ids will be lost. Closes #11875 Closes #11705 Closes #10378 * [FIX] product_expiry: 'product_id' in context When creating a new lot from an incoming picking transfer, the product_id is written in the context. opw:674608 * [FIX] point_of_sale: display select button on client list after scanning Before this, if you where on the customer selection screen and scanned a customer barcode the customer would be shown, but you were not able to select him. This correctly sets ClientListScreenWidget.new_client to the scanned partner which makes the button toggle. Closes #11874 * [FIX] mail: escape author name in messaging menu * [FIX] mail: messages sent as reply to previously selected message In Discuss, if a message was selected as message to reply to, it wasn't reset when switching to another channel. So if the user sent a message in that other channel, the message was sent as reply to the previously selected message. This rev. ensures to always unselect messages when switching between channels. Closes #11879 * [FIX] account: SO reference in register payment wzd Follow up of fix 6f8030a This previous fix removed the reference field when creating an invoice from a sales order since this field was for Supplier Invoices (and is not shown for Customer Invoices). While this males sense, it had the side effect of removing the default value for the "Register Payment" wizard. To keep this wizard populated with the most sensible data, the default is now set to reference or name or number (in that order). opw 676261 * [FIX] sale_mrp: return of _get_anglo_saxon_price_unit This function _get_anglo_saxon_price_unit must always return the price_unit. * [FIX] base_action_rule: simplification typo in `make_unlink()` * [FIX] mrp: avoid empty cost of produced product If the production flow is in two steps: 1. consume raw material 2. produce manufactured product The total_consume_moves was empty (so computed cost was 0) Include the moves that were already consumed since the last production. This will offer a correct estimation of cost of production in real time for companies producing in several steps. opw-675994 * [FIX] mrp: include workcenter cost in total cost Estimate the workcenter cost based on produced quantity so far. The workcenter cost is written on analytic accounts at the end of the production only. A new method _compute_costs_from_production is needed to estimate the workcenter total cost and then divide by the produced unit. opw-675994 * [FIX] crm_partner_assign: Interested message subtype When a partner tells he is interested or not by a lead, the customer on the lead must not receive a mail with this information. opw-676729 * [FIX] website_project_issue: Issues visibility in frontend for portal users The domain used to search the project issues in the website_project_issue controller(['/my', '/my/home']) was useless thanks to the ir.rule portal_issue_rule opw:676447 * [FIX] account: A negative amount with sale taxes on bank statement line must be considered as a refund. Courtesy of Adrien Peiffer (ACSONE). PR #11877 * [IMP] doc: add documentation of read_group Has already a docstring but was not included * [FIX] base: Changing a company contact in a company When a company contact is changed in a company, this contact will not be displayed as a company contact. opw:673715 * [FIX] purchase: Context propagation in wkf_confirm_order. Closes #11916 * [FIX] account_voucher: supplier voucher should list receivable accounts opw-676508 * [FIX] project: falsy demo data The author_id field is actually a res.partner, not a res.users. In some cases, if the partner with id 1 is deleted, installing project was impossible. * [CLA] signature for Farrah Dickerson Closes #11917 * [FIX] account: set reconciliation date as admin The user performing reconciliations may not always have the right to update the corresponding partners, for example if a partner is also a system user. Doing it as super-user after verifying that the user is indeed allowed to reconcile journal items works around the problem. Fixes #11931 * [FIX] import: broken translation cache for absent translation of 'false' Backport of 7d732b1011f577b12a1c2aac9ef205e633ab8f61 Fixes #979 * [FIX] website_sale_delivery: unset delivery line before update When removing the last line (apart from the delivery line) from the cart, it is necessary to remove the delivery line before updating the cart; otherwise the carrier is contacted with a 0 weight order and crashes. * [IMP] product: order attribute by name closes #11951 fixes #11602 opw-673857 * [I18N] Update translation terms from Transifex * [I18N] Update translation terms from Transifex * [FIX] web: raise a warning for bad domain When a user wrote a wrong value in char_domain field it should raise a warning message instead of a traceback. opw:676783 * [FIX] project: Settings" in administration for a user Used case: -go as admin and set for the demo user the right "Settings" in administration -connect as demo user, go in settings of project and untick the forecasts option and save Result: -Access rights error because the user has no rights to unlink records on "ir.values" model. Fix: When the user is in the group_system group, he has the rights to unlink records in "ir.values" model. opw:676714 * [FIX] mail: rapid click on "New Message" cause error If the "NEW MESSAGE" or "Log an internal note" are clicked succeedingly too fast, we can get into a situation where the composer is init'ed but have not already been start'ed. closes #11952 opw-675973 * [FIX] account: account selection When a user prints the GL of a given account, the GL of all accounts is printed. On a production environment, this can generate thousands of pages (and ultimately, a crash). opw-676061 * [IMP] web: multi-click on save on view form (no fp) When clicking on save several time when editing a view form it can be saved several times which can be an issue for one to many. The normal happenstance when saving should be as follow: -> save (click) -> wait write result -> received write result -> reload the form with updated data and updates buttons But when clicking several time, it could become: -> save (click) -> wait write result -> received write result -> save (click) -> wait write result -> received write result -> reload the form with updated data and updates buttons This commit only reinstate the saving feature once the form is reloaded. closes #11926 opw-671793 note: no need to forward-port * [FIX] google_calendar: user invited to one recurring event occurence only When a Google user was invited to one occurrence of a recurring event, but not to the recurring event itself (and the other occurrences, therefore), and the user owner of the recurring event did not sync his calendar in Odoo, the event occurrence could not be synced in Odoo, because it attempted to attach it to the parent/main recurring event, which was not present in Odoo. In such a case, Odoo now syncs the event occurrence as a simple classic event. In addition, if the owner of the event sync his calendar with Odoo afterwards, or if the user is invited later to the main/parent recurring event and then sync again his calendar, it then attach the event occurrence that was previously synced to this main event, to avoid events duplication. opw-676535 * [FIX] sale: uom conversion for invoiced quantities When invoicing products from a SO, you may decide to change the uom of the invoice (if you invoiced only a fraction of the product, for example). In that case, conversion is necessary to ensure that the "invoiced quantity" field on the SO line is correct. * [FIX] fields: invalidate x2many fields with a domain Invalidate the cache of a x2many field when any of the fields appearing in its domain is modified. Use the invalidation triggers mechanism for that purpose. * [FIX] sale: outdated .pot file Was having content of website_quote * [FIX] account_anglo_saxon: default account value The default account value set for purchases invoices lines for product of type Service was wrong: It used the stock account, which is wrong as a Service as no stock. Instead, it should left the product expense account, as usual. opw-676110 * [FIX] hr_holidays: date_from field Wrong field date_from:month in model hr.holidays opw:676837 * [FIX] account, account_asset, purchase, sale: deferred revenue type/ asset type When creating an invoice from a SO or PO with a line containing a product with a deferred revenue type or an asset type, this information is not copied in the related invoice line. Inspired from 564fda4 opw:677098 * [FIX] account_asset: deferred_revenue_category_id and asset_category_id When creating an customer invoice with a product linked to a deferred revenue category, the account used in the invoice line must be the account_asset_id. When creating an vendor bill with a product linked to an asset category, the account used in the invoice line must be the account_depreciation_id. Inspired from 0287c1e1b34a14300dcf7ef9ffddf160b61631ee opw:677098 * [FIX] web: search input of date When the user searches for date (or a datetime) in the search bar, the suggested date can become completely wrong. For example, in the French localization where the date format is DD/MM/YYYY, the system will search for the date MM/DD/YYYY. This is even worse when the date is not fully written: DD/MM could be converted to MM/DD/0000, which doesn't make any sense. This is related to the moment issue https://github.com/moment/moment/issues/1407. The fix is to make sure that the input date has a correct format thanks to `parse_value`. The latter converts the date into a fixed format. Fixes #11876 opw-676604 * [FIX] tools: keep comment in CSV export The comments field was ignored (because reasons) when exporting terms in CSV. This was an issue when using the wizard 'Synchronize Terms' as it first export the terms of every module in CSV. opw-673853 * [FIX] barcodes: also allow barcodes triggering buttons in dropdowns On smaller screens some buttons will be hidden. An example of this is the 'Validate' button in the stock.picking form view. It is not :visible but it should still be possible to trigger through scanning a 'O-BTN.validate' barcode. opw-676741 * [FIX] calendar: edition of events duration In event not during all day, it looks like `start_date` could be defined, but `stop_date` not. Despite the fact this is not such a normal state, this should not prevent the save of the event with the `_check_closing_date` constraint, checking that the ending date is after the starting date (in the case of an event not during the whole day, this is ensured with the `start_datetime` and the `stop_datetime` opw-676245 * [FIX] account payment difference sign When a payment is registered on an invoice, the payment difference must be considered differently if we receive the payment or pay a bill. This is necessary at the creation of the 'Counterpart' entry. For example, an invoice of 100 is considered as paid with a payment of 90. The difference of 10 should be booked as a debit in case of a customer invoice, but it should be booked as a credit in case of a vendor bill. opw-675641 * [FIX] base: no-break space in qweb A non-breaking space is used between the amount and the currency. However, if a space is used as a separator, there is a possibility that the amount will be split into several lines. opw-674535 * [FIX] google_calendar: do not copy user Google info If a user syncs his calendar with Google, and a second user is created in the database by copying this first user, the Google information of the first user was copied (The Google account to sync, the token to use, the last syncrhonization date, ...), which is obviously wrong. On calendar syncrhonization, which can be done manually or automatically with the according cron, all events of the first user were created a second time, as a second user synchronized the same Google Calendar. opw-674141 * [FIX] http: clear environment/caches on transaction rollback Backport of 8423a0df3482567b0e2f77852dda14b80a029401 Clear the cache/environment in addition to rolling back the cursor, in order to retry the transaction with fresh data, not partially stale data. * [FIX] account: periods in general ledger report When "Filter by Periods" is choosen in the wizard, the right periods must be set in ctx to filter the account moves according to the right periods opw:674593 * [FIX] account: print multiple GL When several accounts are selected to print their GL, the GL of only one is printed. This is due to two issues: - 'active_id' is retrieved instead of 'active_ids' - the method `get_action` is called with the wrong records. `self` refers to the wizard, not to the accounts selected. opw-676061 * [FIX] account: endless loop in exchange rate entry creation on full reconciliation fixed. ticket 676467 * [IMP] point_of_sale: verbose logging when dealing with 'rescue' sessions When dealing with issues related to 'rescue' sessions we are very limited in what we can do because the actual orders sent to the backend exist only in localStorage in the browser on the device of the user. Because of this it is important that we log some data about the orders we receive in the backend to have an idea of what's going on. opw-676497 * [FIX] purchase: taxes from PO If a user removes the taxes on a PO line, the product taxes will be added back when the invoice is created. opw-676858 * [FIX] account_asset: Depreciation Expense Account and Depreciation Asset Account "Depreciation Account" must be renamed in "Depreciation Expense Account" Reason: This is the account that will be shown in the Profit and Loss, the original label "Depreciation Account" is confusing because it could mean a depreciation asset account. "Asset Account" must be renamed in "Depreciation Asset Account" Reason: This makes it clear that this is an asset account that will receive depreciation entries, without this wording it could mean that we are simply informing the Asset module which account is the asset account, but that depreciation entries go elsewhere. opw:672852 * [FIX] mail: missing translation due to typo Closes #11929 opw-676854 * [ADD] tools: Swiss German language Closes #4722 * [ADD] tools: Burmese language * [FIX] account: sort taxes before computation Taxes should be sorted before computation, otherwise if some taxes affect subsequent taxes, the computation will be wrong. opw-676119 * [FIX] account: base field in account.invoice.tax The field base is obligatory according to a european law. This field existed in saas-6. opw:674713 * [FIX] point_of_sale: use client validation date instead of creation date 9f541d29bf58c3604f6c834ba25e1625c9ad1480 made it so that date_order on pos.order records is set using the creation_date of the clientside Order record to avoid weird date_order values when syncing to the server is not done immediately. The downside of this approach is that creation_date is set during Order creation on the client. A user that has an open POS will also have an open order. So if it takes one hour before the first order can be made then the date_order will reflect this. To avoid this we will instead use a validation date, which will be set when the user clicks on the green 'Validate' button. Because this is a stable release we won't change the name of the key in the JSON data that gets sent to the server. This means that from the server point of view nothing changes. Fixes #11933 * [FIX] sale: exact matching on origin Avoid that an invoice for 'SO042' matches with the invoices of 'SO04'. The use of the like is required as it may contains more than one reference to an invoice. opw-676921 * [FIX] account: print Trial Balance This applies commits 313bc91cf509353e5bdf8bf684589475527df7be and 2ad4bd4846074c4e4334aff13e32cc3335657c73 to Trial Balance report. opw-676061 * [FIX] stock: Reversing scrapped moves When reversing stock moves by clicking on "Reverse" in stock.picking form view, only the stock moves not scrapped must be reversed. opw:672236 * [FIX] purchase: date planned When a PO is copied, the date planned of the order lines should be recomputed based on the order date. opw-675480 * [FIX] purchase: date planned When a PO is copied, the date planned of the order lines should be recomputed based on the order date. opw-675480 * [FIX] account: multi-currency reconciliation use case as defined in opw 640248. Since the reconciliation changed, the bugfix made for saas-6 isn't valid anymore and was actually, the root cause of the same bug appearing in v9. * [FIX] product: respect sequence when loading pricelist rules Fixes #11987 Close #11988 opw-676422 * [FIX] mail: remove unneeded call to `refresh()` With new api, this call is not wanted anymore. The cache is cleared automatically, no need to clear the whole cache; that's a little bit overkill and reduce performances. * [IMP] account: improve reconciliation speed - Only invalidate cache for fields and records we modify - Rewrite query to be more efficient - Avoid o2m commands to be more efficient; write directly on reverse m2o * [IMP] models: mark records as recomputed as soon as they are When recomputing stored function fields, the `write` may trigger a cache invalidation which lead to a recompute of all the recordset values, even the ones already saved in database. * [FIX] payment_authorize: use state code instead of state name The state given to authorize requests should be the state code and not the state name. source: https://support.authorize.net/authkb/index?page=content&id=A1454&actp=RSS opw-675634 * [FIX] purchase: fiscal position from onchange_partner_id Used case: -Configure admin as multi-company user -Create 2 fiscal positions (one for company "Odoo BE" and one for company "Odoo US") -Set admin on company "Odoo BE" -On supplier (Asustek) configure fiscal position Odoo BE -Set admin on company "Odoo US" -On supplier (Asustek) configure fiscal position Odoo US -Configure a product (Laptop E5023) with: *route "Buy" *supplier (Asustek) without company *reordering rules (min qty: 20, max qty: 40) -Set admin on company "Odoo BE" -Run scheduler via the cron Behavior before the fix: -Fiscal position on the created PO is the fiscal position for "Odoo BE" (and PO is for the company "Odoo US") Behavior after the fix: -Fiscal position on the create PO is the fiscal position for "Odoo US". Closes #11537 opw:673288 * [IMP] account: invoice analysis pivot quantities In the report "Invoice Analysis", the view under the report is grouping lines by invoice and also by product on this invoice. Thus, quantities in the pivot view are not the real quantity of invoice lines, but of invoice lines with different products. eg: invoice a: - line 1: product X - line 2: product Y - line 3: product X in the report there would appear to only be 2 invoice line, whilst there is in realy three (this information is accessible via "# of Lines"). closes #11954 opw-676651 * [FIX] website: URL of website_published is wrong when using next/previous Steps to reproduce: -go to runbot 8.0 and connect -go into human ressources/job positions -pass into list view and click on the first item -click on the url to open this record into the website (website_published) -go back (back into the browser) -you're now into the form view again and then next step is to click on the button "next" to access the following record -click on the url of website_published Before the fix: wrong record, this is the previous one that is into the href After the fix: correct record with the correct id into the href Closes #11800 opw:675832 * [FIX] web_editor: scroll and editing menu modal The class modal-open on body tag allow to scroll on the modal content which is useful if the content is taller than the window viewport. When closing the modal, this class is removed but there may be another modal open on which we will not be able to scroll to view buttons/content if too big. This commit check if a modal is still opened after closing an editor modal and in the affirmative add back the modal-open class. opw-674475 note : was already present in 8.0 with ec47493, it is also present for web.Dialog (but the modal of the editor do not inherit from web.Dialog) * [FIX] account_asset: correct dependencies of `amount_residual` field Also use a `set()` to avoid processing assets multiple times when creating moves from lines * [FIX] l10n_fr: FIX default Sale/Purchase tax. Courtesy of alexis-via. PR #11139 * [FIX] web_editor: video - allow to add video from unknown source There are not cat... but you cannot know all the existing website in the world... So, have faith in the user ! To do: allow to customize size or get it from iframe provided * [FIX] tools: correct Burmese locale * Revert "[FIX] product: respect sequence when loading pricelist rules" This reverts commit b0f02e31b2e46685927ba6bb099158b6a211b6ce. As pointed out by @nim-odoo [1], a similar patch has already been uncommited few month ago [2]. Ref #11988 opw-676422 [1] https://git.io/vrYxY [2] see a6badd25597e5e0930cb014fe94db754dae32c8f * [IMP] document: indexation of MS documents Commit 3ced0ff61 removed the support of Microsoft documents for indexation. It makes sense for the old formats such as '.doc' since it requires an external tool ('antiword'), which could lead to a security issue. However, the new formats such '.docx' are simple xml files, therefore they could be indexed with the usual XML parsing tools. opw-677235 * [FIX] setup: missing dep for RHEL-based distros * [FIX] web_kanban: quick redrag of kanban records When dropping a record, it is updated and rerendered. The problem with this behaviour is that if the record is redrag immediately after drop, jquery-ui throws an error as the widget the user is trying to re-move is being rerendered. The solution provided by this commit is to block the draggable feature while the record is being rerendered. * [FIX] setup: use hard tabs GTFO * [IMP] website: share widget and multi language The lang of the content of the "Share" widget was the one used when inserting it in the view. Thus if someone see a page with it in another language the title and url for sharing is not translated. This commit use the current page language to set the widget data. opw-676062 * [FIX] setup: atom doesn't want to use hard tabs even when told to This is now the 2d stupidest commit I ever did * [FIX] core: correct `fields.modified_draft` for triggers on other models * [FIX] l10n_be_intrastat: get location_id from stock move purchase.order have been rewritten with cb01be2 It was not taken into account for intrastat who still used the now not existing "location_id" on purchase order. This commit use instead the method _get_destination_location which should be equivalent. opw-677497 * [FIX] l10n_be_intrastat: typo * [I18N] Update translation terms from Transifex * [I18N] Update translation terms from Transifex * [IMP] doc: Enterprise-compatible installation instructions Before this revision, the installation instructions where Community-centric, which led some customers to believe that they had to install first Community then Enterprise. This commit makes the instruction compatible for both editions. * [FIX] web: fix duplicate changes in form view Before this commit, in some cases, clicking on 'save' button, then on other buttons (like 'validate' in invoices) had the unfortunate effect of applying twice the changes in some cases. More specifically the problem appears when: 1. an onchange is triggered (for example, taxes in invoices) 2. the user clicks on 'save', buttons are disabled 3. the 'save' actions is completed, the buttons are enabled, but the on_button_save still does some work: triggering event, and reloading the view 4. the user clicks on 'validate' 5. the onchange completes, this triggers some more work Our only protection against such interactions is right now the fact that buttons are disabled/enabled. In my opinion, there should be a way to guarantee that actions are properly serialized (that is actually what a mutex is for... just saying). But the code of the form view/list view is too coupled, and such changes are quite dangerous. A real refactoring of those is needed at some point in the future. * [FIX] web: remove useless line the enable_button call should have been removed... * [FIX] base: Add missing return values The _auto_init method was overriden without keeping the return value of the super on some models. This break the new stored computed fields computation at field creation. Closes #11985 opw-677232 * [CLA] signature for s.sokolko * [FIX] web: update compatibility layer this commit adds better support in the compatibility layer of the js framework. This is necessary if one wants to follow the official tutorial. * [FIX] point_of_sale: select correct journal An issue occurs in the following situation. Several cash journal are configured for a given PoS, and a user performs a refund (the transaction contains only a refund). In this case, the wrong journal might be selected. This is because a payment line of zero is not sent to the backend, and therefore an arbitrary journal is selected. opw-676229 * [FIX] l10n_fr_fec: intial balance of accounts from the P&L should be summarized into a single line * [IMP] doc: uniform design with user documentation Apply the same changes from functionnal documentation to dev doc: odoo/documentation-user@4316470 * [IMP] web/database manager: admin login & country Add inputs e-mail address and country when creating a newdatabase This will provide the installation of the correct chart of accounts at the installation of Accounting Use the provided login as the admin login, and set the email on the partner if the login set is an email Set the country on the company (and its partner) The countries are parsed from XML country list We take the opportunity to repair the `label for` which bind the label with the input only if the `id` attribute of the input is set with what is set in the `for` attribute of the label * [FIX] website: backport of 613ee31f9c67179c4e13aa9a2dbcef6492da38d9 * [FIX] account: readonly bank statement line Like in "view_bank_statement_form" when a line is linked to a journal entry, this line must be in readonly. opw:676344 * [FIX] account: usererror takes only one argument opw-677589 * [FIX] web: Y-axis formatting In case of a line graph, the values of the Y axis are not formatted as numbers, although they are on the bar graph. * [FIX] web: left margin of graph The left margin of the graph doesn't take into account the width of the maximum Y-axis value. In case the values are high (> 10^7), they are cropped. The fix is to adapt the left margin as a function of the size of the maximum value. opw-676538 * [FIX] account: partial reconcile unreconcile with deleted credit/debit move `debit_move_id` and `credit_move_id` of `account.partial.reconcile` must be required. Not having one of them set on this model does not make sense, you cannot have a reconciliation with a debit move but without a credit move, for instance. Databases already having the trouble, having partial reconciliations without either a debit or a credit move, had issues for the computation of the `payment_move_line_ids` compute field, which relied on the fact these fields were supposed to be required. This revision makes a retro-compatibility patch for these databases already having the issue. opw-677709 * [FIX] account: invoice has not the same currency as the purchase order Used case: -Configure company in EUR, and user in multi-currency -Create a purchase order in USD and confirm it -Click on the smart button "0 invoices" then click on "create" Result before the fix: The system created an invoice in EUR, currency of the company, instead of in USD, currency of the purchase order. Result after the fix: The system created an invoice in USD, the currency of the related purchase order. opw:677568 * [FIX] calendar: don't block UI on slow /calendar/notify Safe imp for a stable version. Better fix could be to send notifications through the bus, but this would be in master. * [FIX] web_calendar: search date range when no date_stop field * [FIX] doc: white h2 title Cherry-pick from odoo/documentation-user@d193f7c0 * [FIX] website_sale_delivery: reset carrier on cart update It makes no sense to recompute delivery costs at each update of the cart; furthermore, it prevents users that already selected a carrier to remove the last products of their carts This fix is additional to e4e1e571c2e5854b16b913b9b7bce9774b395055 * [FIX] mail: receiving a notification without notifying the parent message. Used case: If you add a user which has no acces on a model(ex:purchase.order) as follower on a record of this model. When someone responded by email on this record, and when a message is sent on this record, an exception is raised at the connection of the user added as a follower. Fix: To have the rights to read the message, a read notification for this follower must be added to all parents of this message. Closes #11902 opw:676699 * [FIX] web_editor: serialise translations of html_translate fields The html_translate fields (e.g. website_descripton on product.product) were not serialised and the raw value from the web_editor was saved as a translation. This was an issue in case of special characters that may be present in the translation. A translation containing non-breaking space was sent in html (`foo bar`) while lxml converts such characters to unicode (`foo\xa0bar`). When writing a translation, the value is checked against incorrect format using ``` value0 = field.translate(lambda term: None, record[fname]) value1 = field.translate({trans.src: trans.value}.get, value0) value2 = field.translate({trans.value: trans.src}.get, value1) if value2 != value0: raise ValidationError(_("Translation is not valid:\n%s") % trans.value) ``` As value1 is the unicode version of the translation and `trans.value` is the html version of the translation, the last substitution in the callback method was never made and the ValidationError was raised. This commit forces the serialisation through lxml to be sure the compared strings are using the same parser instead of comparing value from summernote and lxml that may be both valid but still different. opw-675767 * [FIX] website_gengo: fixed button click and translations - Fixed linking issue after click on 'Translate' button. - Controller added to post terms in gengo opw-648546 * [FIX] project_issue: number of issues When no stage has been defined for a project, the new issues are set in an undefined stage(stage_id = False). Then these issues must be counted. opw:676985 * [FIX] l10n_be: allow more than 120 periods The widget selection only shows the first 120 results. The selection was most likely set to avoid creating new entries but it can be done with an option tag. This allows to use the search on many2one fields. opw-677908 * [FIX] account: sequence of statement The sequence used in the bank statement lines is not reliable. Indeed, several lines might have the same sequence. opw-676924 * [FIX] account: statement line amount rounding See comment in code. opw-676924 * [FIX] mail: to prevent infinite loop Introduced by fac04424caa095511b0f809b351fc2af0a5942cc * [FIX] account: duplicate journal should not use the same bank account There is several override of create and write that assumes that a bank account is present on only one account (see 4530e5d). It is very hard to change or remove the account bank once linked to a journal (see 4a65bc38) so it should not be set in the first place when duplicating a journal. opw-676374 * [FIX] hr_holidays: missing context Closes #9386, opw-677958 * [FIX] web: company logo file extension The company logo file extension is always '.png', even if the logo is of another type such as 'jpg' or 'gif'. This is not an issue for decent browsers, but IE might not display the image under specific circumstancies, e.g. in combination with nginx. opw-676836 * [IMP] doc : expand the coding guidelines - correct typos - clarify some points, according to the community comments - precise the xml notation : record tag vs act_window/menuitem/... tags - add organization of report, wizard, data/demo, ... (directories and naming conventions) - new conventions for 'symbols' - ... Thanks to @rim-odoo for its grammar extremist review, and @tde-banana-odoo for our long debates about wizard conventions. * [IMP] doc : add python idioms and odoo specific coding guidelines - add python idioms - odoo specific guidelines (for ORM, translations, ...) inspired from old guidelines v6.0 - some other best pratices * [FIX] web: download file and editor firefox bug When we download a file (as can be done with attachments in Odoo), firefox is opening the link in current window but cancel the action once it is aware the resource is to be downloaded. But this get firefox into a corrupt state for some contenteditable features, for example document.queryCommandState which is needed for the editor will after downloading a file throw an error consistently instead of working as expected. It can be reproduced on firefox (at least from version 32 to 46) with the following snippet: https://jsfiddle.net/s246u3ay/3/ The issue is probably linked to the following reported issue since 2005: https://bugzilla.mozilla.org/show_bug.cgi?id=297494 This commit avoid the bug by opening attachments download links in a new window instead of the current one. closes #12109 opw-676918 * [CLA] signature for Baldi Leandro (lbaldi) Closes #12110 * [FIX] l10n_be_intrastat: traceback change new api 642fea4 updated some models to new API but this was not taken into account into the part of the code this commit fix. opw-677497 * [FIX] calendar: fetching images of negative ids The mimetime fetching in /web/image/... may fail if: - calendar is installed - `id` is a string (using ?id=42 in the URI) - `id` is a negative number (company partners on odoo.com) The `search` override of `ir.attachment` in calendar detects if a number is a virtual ID when it contains a '-' and is a string. While it is not optimal to allow both int and str format for paramter `id`, make the verification of virtual ID in calendar more strict to only match the format `<real>-<virtual>` and not `-<real>` * [IMP] calendar: avoid parsing for models that do not have virtual ids And avoid bug with negative ids to happens in the first place * [FIX] hr: trigger job count computation on employee archive opw-676542 * [I18N] Update translation terms from Transifex * [I18N] Update translation terms from Transifex * Revert "[FIX] res.currency: allow duplication" This reverts commit d780f9476d43eb4fd25c852dd4e691002f4a6dcf. Did not work due to the size=3 on name field that strips the code to the first three letters only (removing the " (copy)" part). Copying a currency has a few business cases as the rates are not copied. As can not increase the size of a field in stable, remove the method that had no effect. Fixes #11036 * [FIX] account_asset: depreciation start date If 'Prorata Temporis' is not set, depreciation_date should be the 1st of January of purchase year. opw-677534 * [FIX] account: sort taxes In the case of grouped taxes, the taxes would not be applied anymore after commit 0a5b943d19129545724488f6026632bacd66a97b opw-678158 opw-678219 * [FIX] doc: corrects spelling errors for cmdline From #12028 * [FIX] account: invoice import with only partner and lines When creating a new invoice through the web interface, a bunch of "default" values are loaded once the partner chosen, thanks to an onchange on this field, such as the `account_id`, the fiscal position, etc. It was not when importing an invoice, making it more difficult to import an invoice. In addition, the taxes lines were not computed at all when importing an invoice with taxes within its invoice lines, while it should be the case if the tax lines are not forced during the import. opw-678155 * [FIX] account: unlink account journal The bank account linked to a journal cannot be systematicaly deleted with its journal because this bank account can be linked to several journals. opw:676374 * [FIX] account: partner_id set on a bank fee Used case: -Create several customer invoices and validate them -Register a payment without any partner_id and in a bank statement for an amount a bit lower than the total of the invoice (the difference is the paypal fees) -Reconcile the invoices with the payment and create a write-off for the paypal fees -When you close the bank statement, check the journal items, the paypal fees are automatically assigned with a partner. Fix: -When creating the account move line for the fee, if all the account move lines linked to the move are for different partners then you cannot determine the partner of the fee. opw:674822 * [FIX] project_issue: number of issues for a customer When counting the number of issues for a customer, all the the contacts of this customer must be taken into account. opw:676985 * [FIX] account: fix error in aged partner balance, variable at_least_one_amount referenced before assignment * [IMP] im_livechat: don't auto-open on mobile Currently on mobile, the livechat window would take all the viewport of a small screen mobile browser. This combined with the "auto open" feature can be desorienting: users could have only seen the "hello, how may I help you ?" window and not know what to do or what is happening. So this commit remove the "auto open" feature if user is on a too small device (the user would thus have to click on "Have a Question"). closes #12148 opw-678012 * [FIX] website_mail: publications of internal notes On the font-end view of project.issue, only the messages of type `note` were display. This excluded the messages recieved via email which makes hard to understand a conversation (e.g. a customer does not sees his own answers). Instead, only filter out the notifications (change of states, responsible...) opw-677426 * [FIX] account_asset: fiscal year date The fiscal year start date should be taken into account when calculating the depreciation amount in case of prorata temporis. opw-678072 * [FIX] hr_payroll: avoid infinite recursion The get_recursive_parent function seemingly depended on the ordering of the rule_categories recordset which happens to work fine in most cases because all data first defines the parent before defining the children rule categories. But if you happen to do it the other way around it won't work and it will infinitely call itself because: if rule_categories[0].parent_id: rule_categories = rule_categories[0].parent_id | rule_categories won't change the value of rule_categories[0]. opw-673222 (loosely related) * [FIX] calendar: editing an existing recurrent event It is not possible to edit the start_date, end_date, start_datetime, end_datetime and duration for a recurrent event due to the raesons explained in https://github.com/odoo/odoo/issues/10278 or see opw:665700 opw:677139 * [FIX] stock_account: average cost with foreign currency Quants are created, and stock moves are updated, with the purchase value converted at current rates. However, the product average was calculated before that value was retrieved. This ensures the correct value is retrieved for the average cost calculation and will match the actual quants. Fixes #12163 Closes #12164 opw-678511 * [FIX] account: don't write the foreign currency on writeoff when several secondary currencies are involved * [FIX] web_settings_dashboard: access error When a user has the access rights "Configuration" or "Access Rights" regarding the "Administration" module category, the click on the "Settings" menu leads to an access error. This is because the dashboard fetches data about the number of installed modules ("installed_apps"), which requires access to "ir.module.module". Since it is not easily possible to hide a parts of the dashboard (the static templates do not recognize the "groups" attribute), we simply hide the dashboard for these users. opw-678531 * [IMP] website_project_issue: my/issues/id form improvements 1/ Display a button for the project_user to come back in backend and edit the issue if they want * [IMP] website_mail: Display the message.atttachment_ids on message_thread * [FIX] product_visible_discount: product without company_id When computing the real price of a product, a currency of reference is needed, first the currency of the product's company is privileged and if no company is set on the product then the currency of the user's company is taken. opw:678159 * [FIX] web: chardomain, don't allow to edit the input when not in edit mode. * [FIX] website_forum: typo in translation * [IMP] gamification: prevent misconfiguration Prevent selecting wrong field or models or computed fields Fixes #8545 * [FIX] account: get_formview_id For a type 'in_refund', the supplier account invoice form must be taken. opw:678498 * [FIX] point_of_sale: set callbacks for weight and price barcodes c8732bea1e8471b90ac0c118b212a2d6ae84180a did not take into account that we don't have specific callbacks for weight or price type barcodes. Those where handled by the product callback. opw-678556 * [FIX] web: raise a warning for bad domain When a user wrote a wrong value in char_domain field it should raise a warning message instead of a traceback. Backport of b3a88b6ed846a13c0cd07cc25ea49bccbdf84aa8 opw:676783 * [FIX] calandar: all day events email notification When sending a notification email to an event attendee for an all day event, the timezone must be ignored as the `start` and `stop` datetime are stored as the day date + '00:00:00'. If the timezone is applied, for users being in a negative timezone (such as an American timezone), the day displayed would be the day just before. opw-677019 * [FIX] crm: merge leads in multi-company When merging leads with a company set different than the current user company, it failed because the notification email (the message written in the thread summarizing the merge) couldn't read the company name (the `name_get` call on the company) because of the multi-company record rule. `name_get` can be safely called as `sudo`, as it does nothing else than returning the name of the record. This is already done for the many2one links in the web client anyway (You can see leads from a company different than yours, you can see the company name to which the leads belongs to, but you can't click on the company many2one link) opw-677986 * [FIX] web: fix backport #4c7a9bd * [FIX] translate: don't translate DOCTYPE tag * [FIX] im_livechat: don't translate livechat javascript template * [FIX] report: some Wkhtmltopdf installation can return an empty version * [FIX] gamification: bad backport to 8.0 UserError was defined in version 9, not 8 * [INP] gamification: skip check for not required fields Could get a definition with a model only * [CLA] Rock Solid Solutions signs corporate CLA. Closes #12182 * [FIX] sale: propagate context Closes #9521 * [FIX] doc: update css file to reflect 8ce16c3 * [FIX] server: Do not listen when --no-xmlrpc is set This is a fix for f04f409943b8bd8f4bd2653e368523d1cc0d8246, which only prevented the workers from being spawned in Prefork mode, while the socket was still being bound to - this is a problem when starting a worker-only server as it cannot coexist with the XMLRPC server on the same machine. Closes #1828 * [FIX] sale: multi-company tax filtering When the admin creates a SO, he has access to all taxes (since ir.rules do not apply to him); therefore in some cases, the SO could be created with SO lines that have taxes from other companies. This usually does not make sense. From this revision on, only taxes that are in the same company as the SO are applied to the lines. If no company is set, then no filtering is done. * [FIX] crm_partner_assign: minimum access rights to employee Give the same as access rights to the employee as for the public user. This patch is needed to allow a user to access the partner form. Same for portal. The list of grades in not a confidential information. Fixes #7719 * [FIX] *: replace uses of `except_osv` with `UserError` that have been forgotten during previous forward-ports * [I18N] im_livechat: export source terms * Revert "[FIX] translate: don't translate DOCTYPE tag" This reverts commit 44e8b92beb4d066c6192fd723cff8299f19d9…
While my Customer can probably live without sequence, they need the sort order of applied_on reversed to be DESC. Am I misunderstanding how applied_on should work? applied_on is defined as 'applied_on': fields.selection([('3_global', 'Global'),('2_product_category', ' Product Category'), ('1_product', 'Product'), ('0_product_variant', 'Product Variant')] So the way Odoo is written it will consider Global rules LAST, and not FIRST? Is this intended? My Customer maintains many BASE pricelists (Direct, Distributor, Reseller, Member, Partner, etc). They also have a single PROMOTIONAL pricelist where they can put items, for a limited time, at a different price. They may put items on the PROMO pricelist because they want to match a competitor price, because they have extra stock they want to move, because they were able to get better pricing from their supplier, or because they are running a special campaign that all Customers (even though they are assigned one of the BASE pricelists) are eligible for. So the first (sequence = 1) pricelist item in each BASE pricelist is the PROMO pricelist (a global rule). With the following: 'ORDER BY applied_on desc, sequence, min_quantity desc', They get the expected behavior. The pricelist items are sorted so that Global comes first, and the price therefore is found on the PROMO pricelist. If the product does not appear on the PROMO pricelist (or the date has passed) then the product is found on the BASE pricelist. If we keep applied_on as written, the global rule never gets considered and therefore their pricing policy is not possible. |
The pricelist items should be sorted by sequence. opw-660745
Keeping the sequence for the items was and is essential to do a PROMO price list and as a last rule/fallback you would get the price items (based on another price list) from the first BASE price list which maybe has a second BASE price list to fallback, etc. In case it would be possible to only put the price lists in a sequence to fulfill this requirement (fallback if no price list version or price list item in the following fits which normally results in a price of zero), I think it might help usability and allowing still the firstly intended generic approach, but this is probably too late for v9. |
Hello, Thank you for the report but I will have to reject this, sorry. The 8.0 is now in end of life cycle and will soon be unsupported. We are only patching critical or security issues. The risk of regressions or introducing side effects is too high. Regards |
The 9.0 is now in end of life cycle |
Description of the issue/feature this PR addresses:
#11987
Current behavior before PR:
pricelist can not calculated base on product pricelist item sequence
Desired behavior after PR is merged:
pricelist calculated base on product pricelist item sequence
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr