From 7407f3c8882bf9ece85d6d6ab94545ac2663fe3a Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 6 Feb 2014 11:47:14 +0100 Subject: [PATCH 1/5] [FIX] mail: backport of saas-2 revision 9065 and 9081. Make sure the user is subscribed before the super() call in mail_thread. This allows to have follower based record rules working (eg: note.note) bzr revid: mat@openerp.com-20140206104714-anpehaik4wajnfrw --- addons/mail/mail_thread.py | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index c2080955bff..90d5c1b8e06 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -188,10 +188,9 @@ class mail_thread(osv.AbstractModel): new = set(command[2]) # remove partners that are no longer followers - self.message_unsubscribe(cr, uid, [id], list(old-new)) - + self.message_unsubscribe(cr, uid, [id], list(old-new), context=context) # add new followers - self.message_subscribe(cr, uid, [id], list(new-old)) + self.message_subscribe(cr, uid, [id], list(new-old), context=context) def _search_followers(self, cr, uid, obj, name, args, context): fol_obj = self.pool.get('mail.followers') @@ -238,16 +237,22 @@ class mail_thread(osv.AbstractModel): if context is None: context = {} - thread_id = super(mail_thread, self).create(cr, uid, values, context=context) + # subscribe uid unless asked not to + if not context.get('mail_create_nosubscribe'): + pid = self.pool['res.users'].browse(cr, SUPERUSER_ID, uid).partner_id.id + message_follower_ids = values.get('message_follower_ids') or [] # webclient can send None or False + message_follower_ids.append([4, pid]) + values['message_follower_ids'] = message_follower_ids + # add operation to ignore access rule checking for subscription + context_operation = dict(context, operation='create') + else: + context_operation = context + thread_id = super(mail_thread, self).create(cr, uid, values, context=context_operation) # automatic logging unless asked not to (mainly for various testing purpose) if not context.get('mail_create_nolog'): self.message_post(cr, uid, thread_id, body=_('%s created') % (self._description), context=context) - # subscribe uid unless asked not to - if not context.get('mail_create_nosubscribe'): - self.message_subscribe_users(cr, uid, [thread_id], [uid], context=context) - # auto_subscribe: take values and defaults into account create_values = dict(values) for key, val in context.iteritems(): @@ -1188,16 +1193,20 @@ class mail_thread(osv.AbstractModel): def message_subscribe(self, cr, uid, ids, partner_ids, subtype_ids=None, context=None): """ Add partners to the records followers. """ + if context is None: + context = {} + mail_followers_obj = self.pool.get('mail.followers') subtype_obj = self.pool.get('mail.message.subtype') user_pid = self.pool.get('res.users').browse(cr, uid, uid, context=context).partner_id.id if set(partner_ids) == set([user_pid]): - try: - self.check_access_rights(cr, uid, 'read') - self.check_access_rule(cr, uid, ids, 'read') - except (osv.except_osv, orm.except_orm): - return False + if context.get('operation', '') != 'create': + try: + self.check_access_rights(cr, uid, 'read') + self.check_access_rule(cr, uid, ids, 'read') + except (osv.except_osv, orm.except_orm): + return False else: self.check_access_rights(cr, uid, 'write') self.check_access_rule(cr, uid, ids, 'write') From 922836d8cdc49d089ed2cbd7b0defd1c75e882f3 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 6 Feb 2014 12:03:27 +0100 Subject: [PATCH 2/5] [IMP] mail: check at least access_rights in case of creation bzr revid: mat@openerp.com-20140206110327-zar4yl03r1lympx6 --- addons/mail/mail_thread.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 90d5c1b8e06..e7345fafb9b 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -1201,12 +1201,12 @@ class mail_thread(osv.AbstractModel): user_pid = self.pool.get('res.users').browse(cr, uid, uid, context=context).partner_id.id if set(partner_ids) == set([user_pid]): - if context.get('operation', '') != 'create': - try: - self.check_access_rights(cr, uid, 'read') + try: + self.check_access_rights(cr, uid, 'read') + if context.get('operation', '') != 'create': self.check_access_rule(cr, uid, ids, 'read') - except (osv.except_osv, orm.except_orm): - return False + except (osv.except_osv, orm.except_orm): + return False else: self.check_access_rights(cr, uid, 'write') self.check_access_rule(cr, uid, ids, 'write') From 5ebcb64c34fd9e65da311ffdc050bf15ad035bef Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 6 Feb 2014 13:01:09 +0100 Subject: [PATCH 3/5] [IMP] mail: in case of creation, still check creation access rights for subscription bzr revid: mat@openerp.com-20140206120109-6h2vz1ulu33t1509 --- addons/mail/mail_thread.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index e7345fafb9b..0ae8f521cea 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -1203,7 +1203,9 @@ class mail_thread(osv.AbstractModel): if set(partner_ids) == set([user_pid]): try: self.check_access_rights(cr, uid, 'read') - if context.get('operation', '') != 'create': + if context.get('operation', '') == 'create': + self.check_access_rule(cr, uid, ids, 'create') + else: self.check_access_rule(cr, uid, ids, 'read') except (osv.except_osv, orm.except_orm): return False From 610010876b7f630759436125c00657bad3caaba6 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 6 Feb 2014 17:00:59 +0100 Subject: [PATCH 4/5] [ADD] stock: update pot file to latest version of translations bzr revid: mat@openerp.com-20140206160059-7fkwb6havgazmttg --- addons/stock/i18n/stock.pot | 294 +++++++++++++++++++++--------------- 1 file changed, 175 insertions(+), 119 deletions(-) diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index 264a3a5dde0..0fd4e1bc718 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-06-07 19:36+0000\n" -"PO-Revision-Date: 2013-06-07 19:36+0000\n" +"POT-Creation-Date: 2014-02-06 15:56+0000\n" +"PO-Revision-Date: 2014-02-06 15:56+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -112,8 +112,8 @@ msgid "Product Moves" msgstr "" #. module: stock -#: code:addons/stock/stock.py:2524 -#: code:addons/stock/stock.py:2585 +#: code:addons/stock/stock.py:2568 +#: code:addons/stock/stock.py:2629 #, python-format msgid "Please provide proper quantity." msgstr "" @@ -129,13 +129,13 @@ msgid "Internal reference number in case it differs from the manufacturer's seri msgstr "" #. module: stock -#: code:addons/stock/wizard/stock_fill_inventory.py:59 +#: code:addons/stock/wizard/stock_fill_inventory.py:63 #, python-format msgid "You cannot perform this operation on more than one Stock Inventories." msgstr "" #. module: stock -#: code:addons/stock/wizard/stock_change_product_qty.py:91 +#: code:addons/stock/wizard/stock_change_product_qty.py:95 #, python-format msgid "Quantity cannot be negative." msgstr "" @@ -168,6 +168,8 @@ msgstr "" #: field:stock.partial.move.line,quantity:0 #: field:stock.partial.picking.line,quantity:0 #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 #: field:stock.report.prodlots,qty:0 #: field:stock.report.tracklots,name:0 #: field:stock.return.picking.memory,quantity:0 @@ -297,7 +299,7 @@ msgid "Reference" msgstr "" #. module: stock -#: code:addons/stock/stock.py:1548 +#: code:addons/stock/stock.py:1565 #, python-format msgid "Products to Process" msgstr "" @@ -330,12 +332,12 @@ msgid "Holds the Chatter summary (number of messages, ...). This summary is dire msgstr "" #. module: stock -#: code:addons/stock/stock.py:768 -#: code:addons/stock/stock.py:2473 -#: code:addons/stock/stock.py:2524 -#: code:addons/stock/stock.py:2585 -#: code:addons/stock/wizard/stock_change_product_qty.py:91 -#: code:addons/stock/wizard/stock_fill_inventory.py:124 +#: code:addons/stock/stock.py:782 +#: code:addons/stock/stock.py:2517 +#: code:addons/stock/stock.py:2568 +#: code:addons/stock/stock.py:2629 +#: code:addons/stock/wizard/stock_change_product_qty.py:95 +#: code:addons/stock/wizard/stock_fill_inventory.py:128 #: code:addons/stock/wizard/stock_inventory_merge.py:43 #: code:addons/stock/wizard/stock_inventory_merge.py:63 #: code:addons/stock/wizard/stock_invoice_onshipping.py:96 @@ -345,7 +347,7 @@ msgstr "" #: code:addons/stock/wizard/stock_partial_picking.py:192 #: code:addons/stock/wizard/stock_return_picking.py:102 #: code:addons/stock/wizard/stock_return_picking.py:109 -#: code:addons/stock/wizard/stock_return_picking.py:208 +#: code:addons/stock/wizard/stock_return_picking.py:212 #, python-format msgid "Warning!" msgstr "" @@ -453,7 +455,7 @@ msgid "Ready to Deliver" msgstr "" #. module: stock -#: code:addons/stock/stock.py:2481 +#: code:addons/stock/stock.py:2525 #, python-format msgid "Forbidden operation: it is not allowed to scrap products from a virtual location." msgstr "" @@ -463,6 +465,8 @@ msgstr "" #: selection:stock.picking,state:0 #: selection:stock.picking.in,state:0 #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 #: selection:stock.picking.out,state:0 msgid "Waiting Availability" msgstr "" @@ -472,6 +476,8 @@ msgstr "" #: selection:report.stock.move,state:0 #: selection:stock.move,state:0 #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 #: view:stock.production.lot:0 #: field:stock.production.lot,stock_available:0 msgid "Available" @@ -535,7 +541,7 @@ msgid "The average delay in days between the confirmation of the customer order msgstr "" #. module: stock -#: code:addons/stock/product.py:196 +#: code:addons/stock/product.py:195 #, python-format msgid "Products: " msgstr "" @@ -552,7 +558,7 @@ msgid "Draft Physical Inventories" msgstr "" #. module: stock -#: code:addons/stock/stock.py:1777 +#: code:addons/stock/stock.py:1806 #, python-format msgid "Quantities, Units of Measure, Products and Locations cannot be modified on stock moves that have already been processed (except by the Administrator)." msgstr "" @@ -583,7 +589,7 @@ msgid "Item Labels" msgstr "" #. module: stock -#: code:addons/stock/stock.py:1356 +#: code:addons/stock/stock.py:1373 #, python-format msgid "Back order %s has been created." msgstr "" @@ -656,6 +662,8 @@ msgstr "" #. module: stock #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 msgid "Order(Origin)" msgstr "" @@ -695,6 +703,7 @@ msgid "Destination Address " msgstr "" #. module: stock +#: view:product.product:0 #: field:product.product,reception_count:0 msgid "Reception" msgstr "" @@ -745,6 +754,8 @@ msgstr "" #: view:stock.picking.in:0 #: field:stock.picking.in,state:0 #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 #: field:stock.picking.out,state:0 msgid "Status" msgstr "" @@ -827,7 +838,7 @@ msgid "When doing real-time inventory valuation, this is the Accounting Journal msgstr "" #. module: stock -#: code:addons/stock/stock.py:2252 +#: code:addons/stock/stock.py:2296 #, python-format msgid "Please define stock output account for this product or its category: \"%s\" (id: %d)" msgstr "" @@ -852,7 +863,7 @@ msgid "Reference must be unique per Company!" msgstr "" #. module: stock -#: code:addons/stock/product.py:449 +#: code:addons/stock/product.py:448 #, python-format msgid "Future Receptions" msgstr "" @@ -891,6 +902,8 @@ msgstr "" #. module: stock #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 msgid "Weight" msgstr "" @@ -926,13 +939,13 @@ msgid "Location & Warehouse" msgstr "" #. module: stock -#: selection:report.stock.inventory,location_type:0 -#: selection:stock.location,usage:0 -msgid "Transit Location for Inter-Companies Transfers" +#: selection:report.stock.inventory,month:0 +#: selection:report.stock.move,month:0 +msgid "December" msgstr "" #. module: stock -#: code:addons/stock/stock.py:1190 +#: code:addons/stock/stock.py:1204 #, python-format msgid "You cannot cancel the picking as some moves have been done. You should cancel the picking lines." msgstr "" @@ -953,7 +966,7 @@ msgid "Change Product Quantity" msgstr "" #. module: stock -#: code:addons/stock/product.py:465 +#: code:addons/stock/product.py:464 #, python-format msgid "Future P&L" msgstr "" @@ -990,7 +1003,7 @@ msgid "You must assign a serial number for this product." msgstr "" #. module: stock -#: code:addons/stock/stock.py:2255 +#: code:addons/stock/stock.py:2299 #, python-format msgid "Please define journal on the product category: \"%s\" (id: %d)" msgstr "" @@ -1037,6 +1050,8 @@ msgstr "" #: view:stock.picking:0 #: view:stock.picking.in:0 #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 msgid "Journal" msgstr "" @@ -1136,6 +1151,11 @@ msgstr "" msgid "Stock Valuation Account" msgstr "" +#. module: stock +#: view:stock.return.picking.memory:0 +msgid "Return Picking Memory" +msgstr "" + #. module: stock #: view:stock.config.settings:0 msgid "Apply" @@ -1192,13 +1212,15 @@ msgid "Author" msgstr "" #. module: stock -#: code:addons/stock/stock.py:1822 +#: code:addons/stock/stock.py:1851 #, python-format msgid "You are moving %.2f %s but only %.2f %s available for this serial number." msgstr "" #. module: stock #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 msgid "Internal Shipment :" msgstr "" @@ -1226,7 +1248,7 @@ msgid "Supplier" msgstr "" #. module: stock -#: code:addons/stock/stock.py:2864 +#: code:addons/stock/stock.py:2908 #, python-format msgid "In order to cancel this inventory, you must first unpost related journal entries." msgstr "" @@ -1317,6 +1339,8 @@ msgstr "" #. module: stock #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 msgid "Delivery Order :" msgstr "" @@ -1365,6 +1389,11 @@ msgstr "" msgid "Waiting Another Move" msgstr "" +#. module: stock +#: selection:stock.picking,state:0 +msgid "Transferred" +msgstr "" + #. module: stock #: help:stock.change.product.qty,new_quantity:0 msgid "This quantity is expressed in the Default Unit of Measure of the product." @@ -1376,7 +1405,7 @@ msgid "Technical field used to record the product cost set by the user during a msgstr "" #. module: stock -#: code:addons/stock/stock.py:1890 +#: code:addons/stock/stock.py:1919 #, python-format msgid "Warning: No Back Order" msgstr "" @@ -1398,13 +1427,13 @@ msgid "To be refunded/invoiced" msgstr "" #. module: stock -#: code:addons/stock/stock.py:2448 +#: code:addons/stock/stock.py:2492 #, python-format msgid "You can only delete draft moves." msgstr "" #. module: stock -#: code:addons/stock/stock.py:1665 +#: code:addons/stock/stock.py:1682 #, python-format msgid "You cannot move product %s to a location of type view %s." msgstr "" @@ -1441,7 +1470,7 @@ msgid "Additional Info" msgstr "" #. module: stock -#: code:addons/stock/stock.py:2653 +#: code:addons/stock/stock.py:2697 #, python-format msgid "Missing partial picking data for move #%s." msgstr "" @@ -1604,7 +1633,7 @@ msgid "Order Date" msgstr "" #. module: stock -#: code:addons/stock/wizard/stock_change_product_qty.py:92 +#: code:addons/stock/wizard/stock_change_product_qty.py:96 #, python-format msgid "INV: %s" msgstr "" @@ -1642,7 +1671,7 @@ msgid "Stock Invoice Onshipping" msgstr "" #. module: stock -#: code:addons/stock/stock.py:2473 +#: code:addons/stock/stock.py:2517 #, python-format msgid "Please provide a positive quantity to scrap." msgstr "" @@ -1707,6 +1736,8 @@ msgstr "" #. module: stock #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 msgid "Incoming Shipment :" msgstr "" @@ -1716,8 +1747,9 @@ msgid "Stock Valuation Account (Outgoing)" msgstr "" #. module: stock -#: view:stock.return.picking.memory:0 -msgid "Return Picking Memory" +#: code:addons/stock/stock.py:1805 +#, python-format +msgid "Operation Forbidden!" msgstr "" #. module: stock @@ -1787,7 +1819,7 @@ msgid "Shelf 2" msgstr "" #. module: stock -#: code:addons/stock/stock.py:528 +#: code:addons/stock/stock.py:543 #, python-format msgid "You cannot remove a lot line." msgstr "" @@ -1811,7 +1843,7 @@ msgid "Localization" msgstr "" #. module: stock -#: code:addons/stock/product.py:461 +#: code:addons/stock/product.py:460 #, python-format msgid "Delivered Qty" msgstr "" @@ -1821,11 +1853,6 @@ msgstr "" msgid "Transfer Products" msgstr "" -#. module: stock -#: help:product.template,property_stock_inventory:0 -msgid "This stock location will be used, instead of the default one, as the source location for stock moves generated when you do an inventory." -msgstr "" - #. module: stock #: help:product.template,property_stock_account_output:0 msgid "When doing real-time inventory valuation, counterpart journal items for all outgoing stock moves will be posted in this account, unless there is a specific valuation account set on the destination location. When not set on the product, the one from the product category is used." @@ -2062,7 +2089,7 @@ msgid "Generate accounting entries per stock movement" msgstr "" #. module: stock -#: code:addons/stock/product.py:451 +#: code:addons/stock/product.py:450 #, python-format msgid "Received Qty" msgstr "" @@ -2096,6 +2123,8 @@ msgstr "" #. module: stock #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 msgid "Supplier Address :" msgstr "" @@ -2130,8 +2159,8 @@ msgid "Customer Locations" msgstr "" #. module: stock -#: code:addons/stock/stock.py:2448 -#: code:addons/stock/stock.py:2863 +#: code:addons/stock/stock.py:2492 +#: code:addons/stock/stock.py:2907 #, python-format msgid "User Error!" msgstr "" @@ -2181,12 +2210,6 @@ msgstr "" msgid "Creation" msgstr "" -#. module: stock -#: code:addons/stock/stock.py:1776 -#, python-format -msgid "Operation forbidden !" -msgstr "" - #. module: stock #: view:report.stock.inventory:0 msgid "Analysis of current inventory (only moves that have already been processed)" @@ -2346,7 +2369,7 @@ msgid "Warehouse board" msgstr "" #. module: stock -#: code:addons/stock/product.py:471 +#: code:addons/stock/product.py:470 #, python-format msgid "Future Qty" msgstr "" @@ -2365,8 +2388,9 @@ msgid "Notes" msgstr "" #. module: stock -#: selection:stock.picking,state:0 -msgid "Transferred" +#: code:addons/stock/wizard/stock_partial_picking.py:181 +#, python-format +msgid "The unit of measure rounding does not allow you to ship \"%s %s\", only rounding of \"%s %s\" is accepted by the Unit of Measure." msgstr "" #. module: stock @@ -2408,7 +2432,7 @@ msgid "Products" msgstr "" #. module: stock -#: code:addons/stock/stock.py:2243 +#: code:addons/stock/stock.py:2287 #, python-format msgid "Cannot create Journal Entry, Output Account of this product and Valuation account on category of this product are same." msgstr "" @@ -2446,7 +2470,7 @@ msgid "Outgoing Products" msgstr "" #. module: stock -#: code:addons/stock/stock.py:2249 +#: code:addons/stock/stock.py:2293 #, python-format msgid "Please define stock input account for this product or its category: \"%s\" (id: %d)" msgstr "" @@ -2464,7 +2488,7 @@ msgid "Move" msgstr "" #. module: stock -#: code:addons/stock/product.py:467 +#: code:addons/stock/product.py:466 #, python-format msgid "P&L Qty" msgstr "" @@ -2539,6 +2563,8 @@ msgstr "" #: field:stock.picking,location_id:0 #: field:stock.picking.in,location_id:0 #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 #: field:stock.picking.out,location_id:0 #: field:stock.report.prodlots,location_id:0 #: field:stock.report.tracklots,location_id:0 @@ -2562,7 +2588,7 @@ msgid "Cancel Move" msgstr "" #. module: stock -#: code:addons/stock/stock.py:2246 +#: code:addons/stock/stock.py:2290 #, python-format msgid "Cannot create Journal Entry, Input Account of this product and Valuation account on category of this product are same." msgstr "" @@ -2584,7 +2610,7 @@ msgid "scrap" msgstr "" #. module: stock -#: code:addons/stock/stock.py:1891 +#: code:addons/stock/stock.py:1920 #, python-format msgid "By changing the quantity here, you accept the new quantity as complete: OpenERP will not automatically generate a Back Order." msgstr "" @@ -2666,13 +2692,13 @@ msgid "Stock Journal" msgstr "" #. module: stock -#: code:addons/stock/wizard/stock_return_picking.py:174 +#: code:addons/stock/wizard/stock_return_picking.py:176 #, python-format msgid "%s-%s-return" msgstr "" #. module: stock -#: code:addons/stock/wizard/stock_change_product_qty.py:82 +#: code:addons/stock/wizard/stock_change_product_qty.py:86 #, python-format msgid "Active ID is not set in Context" msgstr "" @@ -2740,7 +2766,7 @@ msgid "Date of Completion" msgstr "" #. module: stock -#: code:addons/stock/stock.py:1663 +#: code:addons/stock/stock.py:1680 #, python-format msgid "You cannot move product %s from a location of type view %s." msgstr "" @@ -2812,6 +2838,8 @@ msgstr "" #: view:report.stock.inventory:0 #: field:report.stock.inventory,prodlot_id:0 #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 msgid "Lot" msgstr "" @@ -2838,6 +2866,8 @@ msgstr "" #. module: stock #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 msgid "Contact Address :" msgstr "" @@ -2864,12 +2894,6 @@ msgstr "" msgid "Properties" msgstr "" -#. module: stock -#: code:addons/stock/stock.py:1120 -#, python-format -msgid "Error, no partner !" -msgstr "" - #. module: stock #: field:stock.inventory.line.split.lines,wizard_exist_id:0 #: field:stock.inventory.line.split.lines,wizard_id:0 @@ -2986,7 +3010,7 @@ msgid "

\n" msgstr "" #. module: stock -#: code:addons/stock/stock.py:2501 +#: code:addons/stock/stock.py:2545 #, python-format msgid "%s %s %s has been moved to scrap." msgstr "" @@ -3006,6 +3030,8 @@ msgstr "" #: view:stock.picking:0 #: view:stock.picking.in:0 #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 msgid "Done" msgstr "" @@ -3034,7 +3060,7 @@ msgid "Date done" msgstr "" #. module: stock -#: code:addons/stock/stock.py:1121 +#: code:addons/stock/stock.py:1135 #, python-format msgid "Please put a partner on the picking list if you want to generate invoice." msgstr "" @@ -3106,7 +3132,7 @@ msgid "Stock" msgstr "" #. module: stock -#: code:addons/stock/wizard/stock_return_picking.py:222 +#: code:addons/stock/wizard/stock_return_picking.py:226 #, python-format msgid "Returned Picking" msgstr "" @@ -3169,7 +3195,7 @@ msgid "Assigned Internal Moves" msgstr "" #. module: stock -#: code:addons/stock/stock.py:790 +#: code:addons/stock/stock.py:804 #, python-format msgid "You cannot process picking without stock moves." msgstr "" @@ -3322,6 +3348,12 @@ msgstr "" msgid "Manager" msgstr "" +#. module: stock +#: code:addons/stock/wizard/stock_partial_picking.py:192 +#, python-format +msgid "The rounding of the initial uom does not allow you to ship \"%s %s\", as it would let a quantity of \"%s %s\" to ship and only rounding of \"%s %s\" is accepted by the uom." +msgstr "" + #. module: stock #: model:stock.location,name:stock.stock_location_intermediatelocation0 msgid "Internal Shippings" @@ -3368,7 +3400,7 @@ msgid "Inventory Move" msgstr "" #. module: stock -#: code:addons/stock/product.py:477 +#: code:addons/stock/product.py:476 #, python-format msgid "Future Productions" msgstr "" @@ -3483,6 +3515,8 @@ msgstr "" #: field:stock.partial.move.line,prodlot_id:0 #: field:stock.partial.picking.line,prodlot_id:0 #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 #: view:stock.production.lot:0 #: field:stock.production.lot,name:0 #: field:stock.production.lot.revision,lot_id:0 @@ -3501,6 +3535,12 @@ msgstr "" msgid "Icon" msgstr "" +#. module: stock +#: selection:report.stock.inventory,location_type:0 +#: selection:stock.location,usage:0 +msgid "Transit Location for Inter-Companies Transfers" +msgstr "" + #. module: stock #: field:stock.partial.move,hide_tracking:0 #: field:stock.partial.move.line,tracking:0 @@ -3535,7 +3575,7 @@ msgid "Non European Customers" msgstr "" #. module: stock -#: code:addons/stock/product.py:96 +#: code:addons/stock/product.py:100 #: code:addons/stock/product.py:110 #: code:addons/stock/product.py:113 #: code:addons/stock/product.py:120 @@ -3543,19 +3583,19 @@ msgstr "" #: code:addons/stock/product.py:167 #: code:addons/stock/report/report_stock.py:78 #: code:addons/stock/report/report_stock.py:134 -#: code:addons/stock/stock.py:528 -#: code:addons/stock/stock.py:790 -#: code:addons/stock/stock.py:1190 -#: code:addons/stock/stock.py:1199 -#: code:addons/stock/stock.py:2243 -#: code:addons/stock/stock.py:2246 -#: code:addons/stock/stock.py:2249 -#: code:addons/stock/stock.py:2252 -#: code:addons/stock/stock.py:2255 -#: code:addons/stock/stock.py:2258 -#: code:addons/stock/stock.py:2481 -#: code:addons/stock/stock.py:2590 -#: code:addons/stock/wizard/stock_fill_inventory.py:59 +#: code:addons/stock/stock.py:543 +#: code:addons/stock/stock.py:804 +#: code:addons/stock/stock.py:1204 +#: code:addons/stock/stock.py:1213 +#: code:addons/stock/stock.py:2287 +#: code:addons/stock/stock.py:2290 +#: code:addons/stock/stock.py:2293 +#: code:addons/stock/stock.py:2296 +#: code:addons/stock/stock.py:2299 +#: code:addons/stock/stock.py:2302 +#: code:addons/stock/stock.py:2525 +#: code:addons/stock/stock.py:2634 +#: code:addons/stock/wizard/stock_fill_inventory.py:63 #: code:addons/stock/wizard/stock_invoice_onshipping.py:112 #: code:addons/stock/wizard/stock_splitinto.py:53 #, python-format @@ -3600,9 +3640,10 @@ msgid "This picking list does not require invoicing." msgstr "" #. module: stock -#: code:addons/stock/wizard/stock_partial_picking.py:181 +#: code:addons/stock/wizard/stock_partial_move.py:72 +#: code:addons/stock/wizard/stock_return_picking.py:189 #, python-format -msgid "The unit of measure rounding does not allow you to ship \"%s %s\", only roundings of \"%s %s\" is accepted by the Unit of Measure." +msgid "You have manually created product lines, please delete them to proceed" msgstr "" #. module: stock @@ -3630,7 +3671,7 @@ msgid "Determines whether this location is chained to another location, i.e. any msgstr "" #. module: stock -#: code:addons/stock/stock.py:1853 +#: code:addons/stock/stock.py:1882 #, python-format msgid "By changing this quantity here, you accept the new quantity as complete: OpenERP will not automatically generate a back order." msgstr "" @@ -3641,11 +3682,9 @@ msgid "Serial Number Revisions" msgstr "" #. module: stock -#: model:ir.actions.act_window,name:stock.action_picking_tree -#: model:ir.model,name:stock.model_stock_picking_out -#: model:ir.ui.menu,name:stock.menu_action_picking_tree -#: view:stock.picking.out:0 -msgid "Delivery Orders" +#: code:addons/stock/stock.py:1134 +#, python-format +msgid "Error, no partner!" msgstr "" #. module: stock @@ -3699,7 +3738,7 @@ msgid "Followers" msgstr "" #. module: stock -#: code:addons/stock/stock.py:2590 +#: code:addons/stock/stock.py:2634 #, python-format msgid "Cannot consume a move with negative or zero quantity." msgstr "" @@ -3774,7 +3813,7 @@ msgid "If cost price is increased, stock variation account will be debited and s msgstr "" #. module: stock -#: code:addons/stock/stock.py:2816 +#: code:addons/stock/stock.py:2860 #, python-format msgid "INV:" msgstr "" @@ -3792,7 +3831,7 @@ msgid "Chaining Journal" msgstr "" #. module: stock -#: code:addons/stock/stock.py:768 +#: code:addons/stock/stock.py:782 #, python-format msgid "Not enough stock, unable to reserve the products." msgstr "" @@ -3813,7 +3852,7 @@ msgid "Used for real-time inventory valuation. When set on a virtual location (n msgstr "" #. module: stock -#: code:addons/stock/product.py:459 +#: code:addons/stock/product.py:458 #, python-format msgid "Future Deliveries" msgstr "" @@ -3836,7 +3875,7 @@ msgid "Auto Validate" msgstr "" #. module: stock -#: code:addons/stock/stock.py:1821 +#: code:addons/stock/stock.py:1850 #, python-format msgid "Insufficient Stock for Serial Number !" msgstr "" @@ -3847,9 +3886,11 @@ msgid "Product Template" msgstr "" #. module: stock -#: selection:report.stock.inventory,month:0 -#: selection:report.stock.move,month:0 -msgid "December" +#: model:ir.actions.act_window,name:stock.action_picking_tree +#: model:ir.model,name:stock.model_stock_picking_out +#: model:ir.ui.menu,name:stock.menu_action_picking_tree +#: view:stock.picking.out:0 +msgid "Delivery Orders" msgstr "" #. module: stock @@ -3927,14 +3968,14 @@ msgid "Invoiced" msgstr "" #. module: stock -#: code:addons/stock/stock.py:1852 +#: code:addons/stock/stock.py:1881 #: view:product.template:0 #, python-format msgid "Information" msgstr "" #. module: stock -#: code:addons/stock/stock.py:1199 +#: code:addons/stock/stock.py:1213 #, python-format msgid "You cannot remove the picking which is in %s state!" msgstr "" @@ -3966,6 +4007,8 @@ msgstr "" #. module: stock #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 msgid "Customer Address :" msgstr "" @@ -4025,7 +4068,7 @@ msgid "Shelves (Y)" msgstr "" #. module: stock -#: code:addons/stock/stock.py:2258 +#: code:addons/stock/stock.py:2302 #, python-format msgid "Please define inventory valuation account on the product category: \"%s\" (id: %d)" msgstr "" @@ -4036,7 +4079,7 @@ msgid "Serial Number Revision" msgstr "" #. module: stock -#: code:addons/stock/product.py:96 +#: code:addons/stock/product.py:100 #, python-format msgid "Specify valuation Account for Product Category: %s." msgstr "" @@ -4048,7 +4091,7 @@ msgid "Adds a Claim link to the delivery order.\n" msgstr "" #. module: stock -#: code:addons/stock/wizard/stock_return_picking.py:208 +#: code:addons/stock/wizard/stock_return_picking.py:212 #, python-format msgid "Please specify at least one non-zero quantity." msgstr "" @@ -4081,7 +4124,7 @@ msgid "November" msgstr "" #. module: stock -#: code:addons/stock/product.py:473 +#: code:addons/stock/product.py:472 #, python-format msgid "Unplanned Qty" msgstr "" @@ -4092,7 +4135,7 @@ msgid "Chained Company" msgstr "" #. module: stock -#: view:stock.picking.out:0 +#: view:stock.picking:0 msgid "Check Availability" msgstr "" @@ -4113,7 +4156,7 @@ msgid "This allows you to manage products by using serial numbers. When you sele msgstr "" #. module: stock -#: code:addons/stock/wizard/stock_fill_inventory.py:124 +#: code:addons/stock/wizard/stock_fill_inventory.py:128 #, python-format msgid "No product in this location. Please select a location in the product form." msgstr "" @@ -4129,14 +4172,14 @@ msgid "Move History (parent moves)" msgstr "" #. module: stock -#: code:addons/stock/product.py:455 +#: code:addons/stock/product.py:454 #, python-format msgid "Future Stock" msgstr "" #. module: stock -#: code:addons/stock/stock.py:1663 -#: code:addons/stock/stock.py:1665 +#: code:addons/stock/stock.py:1680 +#: code:addons/stock/stock.py:1682 #, python-format msgid "Error" msgstr "" @@ -4240,6 +4283,8 @@ msgstr "" #. module: stock #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 msgid "Schedule Date" msgstr "" @@ -4277,6 +4322,8 @@ msgstr "" #. module: stock #: field:stock.move,name:0 #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 #: view:stock.production.lot.revision:0 #: field:stock.production.lot.revision,description:0 msgid "Description" @@ -4300,6 +4347,7 @@ msgid "Deliver" msgstr "" #. module: stock +#: view:product.product:0 #: field:product.product,delivery_count:0 msgid "Delivery" msgstr "" @@ -4321,7 +4369,7 @@ msgid "Location Content" msgstr "" #. module: stock -#: code:addons/stock/product.py:479 +#: code:addons/stock/product.py:478 #, python-format msgid "Produced Qty" msgstr "" @@ -4424,6 +4472,13 @@ msgstr "" msgid "Invoiced date" msgstr "" +#. module: stock +#: code:addons/stock/wizard/stock_partial_move.py:72 +#: code:addons/stock/wizard/stock_return_picking.py:189 +#, python-format +msgid "Warning !" +msgstr "" + #. module: stock #: model:stock.location,name:stock.stock_location_output msgid "Output" @@ -4461,9 +4516,8 @@ msgid "Shipping Type of the Picking List that will contain the chained move (lea msgstr "" #. module: stock -#: code:addons/stock/wizard/stock_partial_picking.py:192 -#, python-format -msgid "The rounding of the initial uom does not allow you to ship \"%s %s\", as it would let a quantity of \"%s %s\" to ship and only roundings of \"%s %s\" is accepted by the uom." +#: help:product.template,property_stock_inventory:0 +msgid "This stock location will be used, instead of the default one, as the source location for stock moves generated when you do an inventory." msgstr "" #. module: stock @@ -4496,6 +4550,8 @@ msgstr "" #. module: stock #: report:stock.picking.list:0 +#: report:stock.picking.list.in:0 +#: report:stock.picking.list.out:0 msgid "Warehouse Address :" msgstr "" From 4818a83f2693f23aa66b7b2f8b5714bb15d14482 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 6 Feb 2014 17:34:44 +0100 Subject: [PATCH 5/5] [FIX] point_of_sale: validate and closing pos sessoin handle multi company When the user who validated and closed the pos session was not the same user who created the session, and if this user was not in the same company, it wasnt possible to validate and close the pos session. This explanation if also valid if the user who created the pos session changed of company in his preferences between the creation and the validation. bzr revid: dle@openerp.com-20140206163444-ckcmurcwk2vhi5vp --- addons/account_voucher/account_voucher.py | 7 ++++--- addons/point_of_sale/point_of_sale.py | 22 ++++++++++------------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 72fea7d94ee..a269ae43b2c 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1380,6 +1380,7 @@ class account_voucher(osv.osv): move_pool = self.pool.get('account.move') move_line_pool = self.pool.get('account.move.line') for voucher in self.browse(cr, uid, ids, context=context): + local_context = dict(context, force_company=voucher.journal_id.company_id.id) if voucher.move_id: continue company_currency = self._get_company_currency(cr, uid, voucher.id, context) @@ -1394,7 +1395,7 @@ class account_voucher(osv.osv): # Get the name of the account_move just created name = move_pool.browse(cr, uid, move_id, context=context).name # Create the first line of the voucher - move_line_id = move_line_pool.create(cr, uid, self.first_move_line_get(cr,uid,voucher.id, move_id, company_currency, current_currency, context), context) + move_line_id = move_line_pool.create(cr, uid, self.first_move_line_get(cr,uid,voucher.id, move_id, company_currency, current_currency, local_context), local_context) move_line_brw = move_line_pool.browse(cr, uid, move_line_id, context=context) line_total = move_line_brw.debit - move_line_brw.credit rec_list_ids = [] @@ -1406,9 +1407,9 @@ class account_voucher(osv.osv): line_total, rec_list_ids = self.voucher_move_line_create(cr, uid, voucher.id, line_total, move_id, company_currency, current_currency, context) # Create the writeoff line if needed - ml_writeoff = self.writeoff_move_line_get(cr, uid, voucher.id, line_total, move_id, name, company_currency, current_currency, context) + ml_writeoff = self.writeoff_move_line_get(cr, uid, voucher.id, line_total, move_id, name, company_currency, current_currency, local_context) if ml_writeoff: - move_line_pool.create(cr, uid, ml_writeoff, context) + move_line_pool.create(cr, uid, ml_writeoff, local_context) # We post the voucher. self.write(cr, uid, [voucher.id], { 'move_id': move_id, diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 805bfce4515..0c077807a6e 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -448,11 +448,12 @@ class pos_session(osv.osv): wf_service = netsvc.LocalService("workflow") for session in self.browse(cr, uid, ids, context=context): + local_context = dict(context or {}, force_company=session.config_id.journal_id.company_id.id) order_ids = [order.id for order in session.order_ids if order.state == 'paid'] - move_id = self.pool.get('account.move').create(cr, uid, {'ref' : session.name, 'journal_id' : session.config_id.journal_id.id, }, context=context) + move_id = self.pool.get('account.move').create(cr, uid, {'ref' : session.name, 'journal_id' : session.config_id.journal_id.id, }, context=local_context) - self.pool.get('pos.order')._create_account_move_line(cr, uid, order_ids, session, move_id, context=context) + self.pool.get('pos.order')._create_account_move_line(cr, uid, order_ids, session, move_id, context=local_context) for order in session.order_ids: if order.state not in ('paid', 'invoiced'): @@ -918,23 +919,16 @@ class pos_order(osv.osv): # Tricky, via the workflow, we only have one id in the ids variable """Create a account move line of order grouped by products or not.""" account_move_obj = self.pool.get('account.move') - account_move_line_obj = self.pool.get('account.move.line') account_period_obj = self.pool.get('account.period') account_tax_obj = self.pool.get('account.tax') - user_proxy = self.pool.get('res.users') property_obj = self.pool.get('ir.property') cur_obj = self.pool.get('res.currency') - ctx = dict(context or {}, account_period_prefer_normal=True) - period = account_period_obj.find(cr, uid, context=ctx)[0] - #session_ids = set(order.session_id for order in self.browse(cr, uid, ids, context=context)) if session and not all(session.id == order.session_id.id for order in self.browse(cr, uid, ids, context=context)): raise osv.except_osv(_('Error!'), _('Selected orders do not have the same session!')) - current_company = user_proxy.browse(cr, uid, uid, context=context).company_id - grouped_data = {} have_to_group_by = session and session.config_id.group_by or False @@ -954,7 +948,7 @@ class pos_order(osv.osv): if order.state != 'paid': continue - user_company = user_proxy.browse(cr, order.user_id.id, order.user_id.id).company_id + current_company = order.sale_journal.company_id group_tax = {} account_def = property_obj.get(cr, uid, 'property_account_receivable', 'res.partner', context=context) @@ -975,6 +969,7 @@ class pos_order(osv.osv): # if have_to_group_by: sale_journal_id = order.sale_journal.id + period = account_period_obj.find(cr, uid, context=dict(context or {}, company_id=current_company.id, account_period_prefer_normal=True))[0] # 'quantity': line.qty, # 'product_id': line.product_id.id, @@ -984,7 +979,7 @@ class pos_order(osv.osv): 'journal_id' : sale_journal_id, 'period_id' : period, 'move_id' : move_id, - 'company_id': user_company and user_company.id or False, + 'company_id': current_company.id, }) if data_type == 'product': @@ -1025,7 +1020,10 @@ class pos_order(osv.osv): cur = order.pricelist_id.currency_id for line in order.lines: tax_amount = 0 - taxes = [t for t in line.product_id.taxes_id] + taxes = [] + for t in line.product_id.taxes_id: + if t.company_id == current_company.id: + taxes.append(t) computed_taxes = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit * (100.0-line.discount) / 100.0, line.qty)['taxes'] for tax in computed_taxes: