diff --git a/addons/account/account.py b/addons/account/account.py
index a0bcfe5ee2d..1d3b9b0dc4d 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -122,7 +122,7 @@ class account_payment_term_line(osv.osv):
return True
_constraints = [
- (_check_percent, _('Percentages for Payment Term Line must be between 0 and 1, Example: 0.02 for 2% '), ['value_amount']),
+ (_check_percent, 'Percentages for Payment Term Line must be between 0 and 1, Example: 0.02 for 2% ', ['value_amount']),
]
account_payment_term_line()
diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py
index 0f14fb77bb6..cf17a799372 100644
--- a/addons/account/account_cash_statement.py
+++ b/addons/account/account_cash_statement.py
@@ -246,7 +246,7 @@ class account_cash_statement(osv.osv):
]
open_jrnl = self.search(cr, uid, sql)
if open_jrnl:
- raise osv.except_osv('Error', _('You can not have two open register for the same journal'))
+ raise osv.except_osv(_('Error'), _('You can not have two open register for the same journal'))
if self.pool.get('account.journal').browse(cr, uid, vals['journal_id']).type == 'cash':
open_close = self._get_cash_open_close_box_lines(cr, uid, context)
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index e5427a93361..c6542758952 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -63,7 +63,9 @@
-
+
+
diff --git a/addons/account/i18n/account.pot b/addons/account/i18n/account.pot
index 1384399389e..a276969aae3 100644
--- a/addons/account/i18n/account.pot
+++ b/addons/account/i18n/account.pot
@@ -5697,6 +5697,7 @@ msgstr ""
#: code:addons/account/invoice.py:0
#: code:addons/account/wizard/account_invoice_refund.py:0
#: code:addons/account/wizard/account_use_model.py:0
+#: code:addons/account/account_cash_statement.py:0
#, python-format
msgid "Error !"
msgstr ""
@@ -6269,6 +6270,12 @@ msgstr ""
msgid "You can not have two open register for the same journal"
msgstr ""
+#. module: account
+#: code:addons/account/account_cash_statement.py:0
+#, python-format
+msgid "You cannot create a bank or cash register without a journal!"
+msgstr ""
+
#. module: account
#: view:account.payment.term.line:0
msgid " day of the month= -1"
diff --git a/addons/auction/auction_demo.xml b/addons/auction/auction_demo.xml
index da4989756f9..cb8dfc45376 100644
--- a/addons/auction/auction_demo.xml
+++ b/addons/auction/auction_demo.xml
@@ -2,6 +2,10 @@
+
+
+
+
Tax
diff --git a/addons/auction/i18n/auction.pot b/addons/auction/i18n/auction.pot
index 3ceac2cbde8..f36f2cd186a 100644
--- a/addons/auction/i18n/auction.pot
+++ b/addons/auction/i18n/auction.pot
@@ -312,6 +312,54 @@ msgstr ""
msgid "The Buyer \"%s\" has no Invoice Address."
msgstr ""
+#. module: auction
+#: code:addons/auction/wizard/auction_pay_buy.py:0
+#, python-format
+msgid "Payment aborted !"
+msgstr ""
+
+#. module: auction
+#: code:addons/auction/wizard/auction_pay_buy.py:0
+#, python-format
+msgid "You should pay all the total: "%.2f" are missing to accomplish the payment."
+msgstr ""
+
+#. module: auction
+#: code:addons/auction/wizard/auction_pay_buy.py:0
+#, python-format
+msgid "Error!"
+msgstr ""
+
+#. module: auction
+#: code:addons/auction/wizard/auction_catalog_flagey_report.py:0
+#, python-format
+msgid "No Lots belong to this Auction Date"
+msgstr ""
+
+#. module: auction
+#: code:addons/auction/wizard/auction_lots_numerotate.py:0
+#, python-format
+msgid "This record does not exist !"
+msgstr ""
+
+#. module: auction
+#: code:addons/auction/wizard/auction_lots_numerotate.py:0
+#, python-format
+msgid "This lot does not exist !"
+msgstr ""
+
+#. module: auction
+#: code:addons/auction/wizard/auction_lots_buyer_map.py:0
+#, python-format
+msgid "No buyer is set for this lot."
+msgstr ""
+
+#. module: auction
+#: code:addons/auction/wizard/auction_pay_buy.py:0
+#, python-format
+msgid "No auction date for "%s": Please set one."
+msgstr ""
+
#. module: auction
#: view:auction.dates:0
msgid "Commissions"
@@ -663,6 +711,7 @@ msgstr ""
#. module: auction
#: code:addons/auction/wizard/auction_lots_invoice.py:0
+#: code:addons/auction/wizard/auction_lots_numerotate.py:0
#, python-format
msgid "UserError"
msgstr ""
diff --git a/addons/auction/security/auction_security.xml b/addons/auction/security/auction_security.xml
index 32fdf0d64f3..1fc69bb314f 100644
--- a/addons/auction/security/auction_security.xml
+++ b/addons/auction/security/auction_security.xml
@@ -8,6 +8,6 @@
Auction / User
-
+
\ No newline at end of file
diff --git a/addons/auction/wizard/auction_catalog_flagey_report.py b/addons/auction/wizard/auction_catalog_flagey_report.py
index 97440a6680c..b5bff2d2858 100644
--- a/addons/auction/wizard/auction_catalog_flagey_report.py
+++ b/addons/auction/wizard/auction_catalog_flagey_report.py
@@ -21,6 +21,7 @@
from osv import osv, fields
import netsvc
+from tools.translate import _
class auction_catalog_flagey(osv.osv_memory):
_name = 'auction.catalog.flagey'
@@ -57,7 +58,7 @@ class auction_catalog_flagey(osv.osv_memory):
v_ids = lots_obj.browse(cr, uid, v_lots)
for ab in v_ids:
if not ab.auction_id :
- raise osv.except_osv('Error!','No Lots belong to this Auction Date')
+ raise osv.except_osv(_('Error!'), _('No Lots belong to this Auction Date'))
pass
def print_report(self, cr, uid, ids, context):
diff --git a/addons/auction/wizard/auction_lots_buyer_map.py b/addons/auction/wizard/auction_lots_buyer_map.py
index 23279942965..98d26b83b4f 100644
--- a/addons/auction/wizard/auction_lots_buyer_map.py
+++ b/addons/auction/wizard/auction_lots_buyer_map.py
@@ -67,7 +67,7 @@ class wiz_auc_lots_buyer_map(osv.osv_memory):
lots_obj = self.pool.get('auction.lots')
for rec in lots_obj.browse(cr, uid, ids, context):
if (len(ids)==1) and (not rec.ach_uid and not rec.ach_login):
- raise osv.except_osv('Error', 'No buyer is set for this lot.')
+ raise osv.except_osv(_('Error'), _('No buyer is set for this lot.'))
if not rec.ach_uid and rec.ach_login:
return {'ach_login': rec.ach_login}
return {}
diff --git a/addons/auction/wizard/auction_lots_numerotate.py b/addons/auction/wizard/auction_lots_numerotate.py
index b464ba49a28..9c41d1d4f70 100644
--- a/addons/auction/wizard/auction_lots_numerotate.py
+++ b/addons/auction/wizard/auction_lots_numerotate.py
@@ -99,7 +99,7 @@ class auction_lots_numerotate_per_lot(osv.osv_memory):
('lot_num','=',int(datas['lot_num']))])
found = [r for r in res if r in record_ids]
if len(found)==0:
- raise osv.except_osv('UserError', 'This record does not exist !')
+ raise osv.except_osv(_('UserError'), _('This record does not exist !'))
lots_obj.write(cr, uid, found, {'obj_num':int(datas['obj_num'])} )
view_id = data_obj._get_id(cr, uid, 'auction', 'view_auction_numerotate')
if view_id:
@@ -125,7 +125,7 @@ class auction_lots_numerotate_per_lot(osv.osv_memory):
('lot_num','=',int(datas['lot_num']))])
found = [r for r in res if r in record_ids]
if len(found)==0:
- raise osv.except_osv('UserError', 'This record does not exist !')
+ raise osv.except_osv(_('UserError'), _('This record does not exist !'))
lots_datas = lots_obj.read(cr, uid, found,
['obj_num', 'name', 'lot_est1',
'lot_est2', 'obj_desc'])
@@ -141,7 +141,7 @@ class auction_lots_numerotate_per_lot(osv.osv_memory):
('lot_num','=',int(datas['lot_num']))])
found = [r for r in res if r in record_ids]
if len(found)==0:
- raise osv.except_osv('Error', 'This lot does not exist !')
+ raise osv.except_osv(_('Error'), _('This lot does not exist !'))
view_id = data_obj._get_id(cr, uid, 'auction', 'view_auction_lots_numerotate_second')
if view_id:
res_id = data_obj.browse(cr, uid, view_id, context=context).res_id
diff --git a/addons/auction/wizard/auction_pay_buy.py b/addons/auction/wizard/auction_pay_buy.py
index 108ed00eddc..bf6a85cf74b 100644
--- a/addons/auction/wizard/auction_pay_buy.py
+++ b/addons/auction/wizard/auction_pay_buy.py
@@ -76,14 +76,14 @@ class auction_pay_buy(osv.osv_memory):
for datas in self.read(cr, uid, ids):
if not abs(datas['total'] - (datas['amount'] + datas['amount2'] + datas['amount3'])) <0.01:
rest = datas['total'] - (datas['amount'] + datas['amount2'] + datas['amount3'])
- raise osv.except_osv('Payment aborted !', 'You should pay all the total: "%.2f" are missing to accomplish the payment.' %(round(rest, 2)))
+ raise osv.except_osv(_('Payment aborted !'), _('You should pay all the total: "%.2f" are missing to accomplish the payment.') %(round(rest, 2)))
lots = lot_obj.browse(cr, uid, context['active_ids'], context)
for lot in lots:
if datas['buyer_id']:
lot_obj.write(cr, uid, [lot.id], {'ach_uid': datas['buyer_id']})
if not lot.auction_id:
- raise osv.except_osv('Error !', 'No auction date for "%s": Please set one.'%(lot.name))
+ raise osv.except_osv(_('Error!'), _('No auction date for "%s": Please set one.') % (lot.name))
lot_obj.write(cr, uid, [lot.id], {'is_ok':True})
for st, stamount in [('statement_id1', 'amount'), ('statement_id2', 'amount2'), ('statement_id3', 'amount3')]:
diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py
index ce5f7cfff8e..c567105547d 100644
--- a/addons/base_calendar/base_calendar.py
+++ b/addons/base_calendar/base_calendar.py
@@ -1089,9 +1089,9 @@ class calendar_event(osv.osv):
cr.execute("UPDATE %s set exrule=Null where id=%%s" % self._table,( event,))
elif datas.get('rrule_type') == 'custom':
if datas.get('interval', 0) < 0:
- raise osv.except_osv('Warning!', 'Interval can not be Negative')
+ raise osv.except_osv(_('Warning!'), _('Interval can not be Negative'))
if datas.get('count', 0) < 0:
- raise osv.except_osv('Warning!', 'Count can not be Negative')
+ raise osv.except_osv(_('Warning!'), _('Count can not be Negative'))
rrule_custom = self.compute_rule_string(cr, uid, datas, \
context=context)
result[event] = rrule_custom
diff --git a/addons/base_calendar/i18n/base_calendar.pot b/addons/base_calendar/i18n/base_calendar.pot
index 78fbfa434f9..c387b612718 100644
--- a/addons/base_calendar/i18n/base_calendar.pot
+++ b/addons/base_calendar/i18n/base_calendar.pot
@@ -146,6 +146,24 @@ msgstr ""
msgid "Warning !"
msgstr ""
+#. module: base_calendar
+#: code:addons/base_calendar/base_calendar.py:0
+#, python-format
+msgid "Warning!"
+msgstr ""
+
+#. module: base_calendar
+#: code:addons/base_calendar/base_calendar.py:0
+#, python-format
+msgid "Interval can not be Negative"
+msgstr ""
+
+#. module: base_calendar
+#: code:addons/base_calendar/base_calendar.py:0
+#, python-format
+msgid "Count can not be Negative"
+msgstr ""
+
#. module: base_calendar
#: selection:base.calendar.set.exrule,week_list:0
#: selection:calendar.event,week_list:0
diff --git a/addons/base_contact/base_contact_demo.xml b/addons/base_contact/base_contact_demo.xml
index 40646d1f8eb..393c318015c 100644
--- a/addons/base_contact/base_contact_demo.xml
+++ b/addons/base_contact/base_contact_demo.xml
@@ -2,6 +2,10 @@
+
+
+
+
diff --git a/addons/base_contact/security/base_contact_security.xml b/addons/base_contact/security/base_contact_security.xml
index 72b692ca372..56a995c76a8 100644
--- a/addons/base_contact/security/base_contact_security.xml
+++ b/addons/base_contact/security/base_contact_security.xml
@@ -9,5 +9,6 @@
Sales / Manager
+
diff --git a/addons/board/__openerp__.py b/addons/board/__openerp__.py
index 1c44dfe7955..770fc71777b 100644
--- a/addons/board/__openerp__.py
+++ b/addons/board/__openerp__.py
@@ -27,7 +27,7 @@
'author': 'OpenERP SA',
'depends': ['base'],
'update_xml': ['security/board_security.xml','security/ir.model.access.csv', 'wizard/board_menu_create_view.xml', 'board_view.xml','board_administration_view.xml'],
- 'demo_xml': [],
+ 'demo_xml': ['board_demo.xml'],
'installable': True,
'active': False,
'certificate': '0076912305725',
diff --git a/addons/board/board_demo.xml b/addons/board/board_demo.xml
new file mode 100644
index 00000000000..2f704e640bc
--- /dev/null
+++ b/addons/board/board_demo.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py
index 7515e47506e..a593f5e77bc 100644
--- a/addons/caldav/calendar.py
+++ b/addons/caldav/calendar.py
@@ -38,8 +38,7 @@ from tools.safe_eval import safe_eval as eval
try:
import vobject
except ImportError:
- raise osv.except_osv('vobject Import Error!','Please install python-vobject \
- from http://vobject.skyhouseconsulting.com/')
+ raise osv.except_osv(_('vobject Import Error!'), _('Please install python-vobject from http://vobject.skyhouseconsulting.com/'))
# O-1 Optional and can come only once
# O-n Optional and can come more than once
diff --git a/addons/crm/crm_demo.xml b/addons/crm/crm_demo.xml
index 9ae60b11a70..e629330751f 100644
--- a/addons/crm/crm_demo.xml
+++ b/addons/crm/crm_demo.xml
@@ -5,6 +5,5 @@
-
diff --git a/addons/delivery/delivery_report.xml b/addons/delivery/delivery_report.xml
index 14c1d241131..3cebbba4eac 100644
--- a/addons/delivery/delivery_report.xml
+++ b/addons/delivery/delivery_report.xml
@@ -6,7 +6,8 @@
id="report_shipping"
model="stock.picking"
name="sale.shipping"
- rml="delivery/report/shipping.rml"
+ multi="True"
+ rml="delivery/report/shipping.rml"
string="Delivery order"/>
diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml
index b7ec0fed61e..f0588c76b52 100644
--- a/addons/delivery/delivery_view.xml
+++ b/addons/delivery/delivery_view.xml
@@ -4,6 +4,9 @@
+
+
+
delivery.carrier.tree
delivery.carrier
@@ -128,7 +131,7 @@
sale.order
-
+
@@ -266,10 +269,23 @@
-
+
+
+ stock.picking.out.form
+ form
+ stock.picking
+
+
+
+
+
+
+
+
+
diff --git a/addons/document/document_demo.xml b/addons/document/document_demo.xml
index 1c757a73909..b94048ec13c 100644
--- a/addons/document/document_demo.xml
+++ b/addons/document/document_demo.xml
@@ -1,7 +1,9 @@
-
+
+
+
diff --git a/addons/document_webdav/webdav.py b/addons/document_webdav/webdav.py
index bb2b8caf470..302d8c2a8a7 100644
--- a/addons/document_webdav/webdav.py
+++ b/addons/document_webdav/webdav.py
@@ -27,14 +27,14 @@ from xml.dom.minicompat import StringTypes
import urlparse
import urllib
from osv import osv
+from tools.translate import _
try:
from DAV import utils
from DAV.propfind import PROPFIND
from DAV.report import REPORT
except ImportError:
- raise osv.except_osv('PyWebDAV Import Error!','Please install PyWebDAV \
-from http://code.google.com/p/pywebdav/downloads/detail?name=PyWebDAV-0.9.4.tar.gz&can=2&q=/')
+ raise osv.except_osv(_('PyWebDAV Import Error!'), _('Please install PyWebDAV from http://code.google.com/p/pywebdav/downloads/detail?name=PyWebDAV-0.9.4.tar.gz&can=2&q=/'))
import tools
diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py
index 763d11e277e..def74fe17dc 100644
--- a/addons/email_template/email_template.py
+++ b/addons/email_template/email_template.py
@@ -267,7 +267,7 @@ This is useful for CRM leads for example"),
}
_sql_constraints = [
- ('name', 'unique (name)', _('The template name must be unique !'))
+ ('name', 'unique (name)','The template name must be unique !')
]
def create_action(self, cr, uid, ids, context):
diff --git a/addons/email_template/email_template_account.py b/addons/email_template/email_template_account.py
index 24b7958276d..281a876fc22 100644
--- a/addons/email_template/email_template_account.py
+++ b/addons/email_template/email_template_account.py
@@ -360,19 +360,19 @@ unless it is already specified in the From Email, e.g: John Doe ",
payload_part.attach(part)
except Exception, error:
logger.notifyChannel(_("Email Template"), netsvc.LOG_ERROR, _("Mail from Account %s failed. Probable Reason:MIME Error\nDescription: %s") % (id, error))
- return {'error_msg': "Server Send Error\nDescription: %s"%error}
+ return {'error_msg': _("Server Send Error\nDescription: %s")%error}
try:
serv.sendmail(payload_part['From'], addresses_l['all-recipients'], payload_part.as_string())
except Exception, error:
- logging.getLogger('email_template').error("Mail from Account %s failed. Probable Reason: Server Send Error\n Description: %s", id, error, exc_info=True)
- return {'error_msg': "Server Send Error\nDescription: %s"%error}
+ logging.getLogger('email_template').error(_("Mail from Account %s failed. Probable Reason: Server Send Error\n Description: %s"), id, error, exc_info=True)
+ return {'error_msg': _("Server Send Error\nDescription: %s")%error}
#The mail sending is complete
serv.close()
logger.notifyChannel(_("Email Template"), netsvc.LOG_INFO, _("Mail from Account %s successfully Sent.") % (id))
return True
else:
logger.notifyChannel(_("Email Template"), netsvc.LOG_ERROR, _("Mail from Account %s failed. Probable Reason:Account not approved") % id)
- return {'error_msg':"Mail from Account %s failed. Probable Reason:Account not approved"% id}
+ return {'nodestroy':True,'error_msg': _("Mail from Account %s failed. Probable Reason:Account not approved")% id}
def extracttime(self, time_as_string):
"""
diff --git a/addons/email_template/email_template_account_view.xml b/addons/email_template/email_template_account_view.xml
index 7037223f518..00429efc16c 100644
--- a/addons/email_template/email_template_account_view.xml
+++ b/addons/email_template/email_template_account_view.xml
@@ -3,7 +3,7 @@
+ groups="marketing.group_marketing_user,marketing.group_marketing_manager"/>
diff --git a/addons/email_template/security/ir.model.access.csv b/addons/email_template/security/ir.model.access.csv
index 79135b0de4d..17859d6bb9d 100644
--- a/addons/email_template/security/ir.model.access.csv
+++ b/addons/email_template/security/ir.model.access.csv
@@ -5,3 +5,6 @@
"access_email_template_account_system","email_template.account system","model_email_template_account","base.group_system",1,1,1,1
"access_email_template_system","email.template system","model_email_template","base.group_system",1,1,1,1
"access_email_template_mailbox_system","email_template.mailbox system","model_email_template_mailbox","base.group_system",1,0,0,0
+"access_email_template_account_manager","email_template.account","model_email_template_account","marketing.group_marketing_manager",1,1,1,1
+"access_email_template_manager","email.template","model_email_template","marketing.group_marketing_manager",1,1,1,1
+"access_email_template_mailbox_manager","email_template.mailbox","model_email_template_mailbox","marketing.group_marketing_manager",1,1,1,1
diff --git a/addons/event/__openerp__.py b/addons/event/__openerp__.py
index 9f479a2d941..a45eeac0dae 100644
--- a/addons/event/__openerp__.py
+++ b/addons/event/__openerp__.py
@@ -24,7 +24,7 @@
'name': 'Event',
'version': '0.1',
'category': 'Generic Modules/Association',
- 'description': """Oraganization and management of Event.
+ 'description': """Organization and management of Event.
This module allow you
* to manage your events and their registrations
diff --git a/addons/event/report/report_event_registration_view.xml b/addons/event/report/report_event_registration_view.xml
index 7b489775f25..7794843af40 100644
--- a/addons/event/report/report_event_registration_view.xml
+++ b/addons/event/report/report_event_registration_view.xml
@@ -141,7 +141,7 @@
-
+
diff --git a/addons/event/security/event_security.xml b/addons/event/security/event_security.xml
index 8aba5863e22..648662911d2 100644
--- a/addons/event/security/event_security.xml
+++ b/addons/event/security/event_security.xml
@@ -2,7 +2,7 @@
-
+
Marketing / Manager
diff --git a/addons/event/security/ir.model.access.csv b/addons/event/security/ir.model.access.csv
index a2e4b55bed5..59651dfa007 100644
--- a/addons/event/security/ir.model.access.csv
+++ b/addons/event/security/ir.model.access.csv
@@ -1,16 +1,16 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_event_type","event.type","model_event_type","marketing.group_marketing_user",1,0,0,0
-"access_event_type_manager","event.type manager","model_event_type","base.group_marketing_manager",1,1,1,1
+"access_event_type_manager","event.type manager","model_event_type","marketing.group_marketing_manager",1,1,1,1
"access_event_event","event.event","model_event_event","marketing.group_marketing_user",1,1,1,0
"access_event_registration","event.registration","model_event_registration","marketing.group_marketing_user",1,1,1,0
"access_report_event_registration","report.event.registration","model_report_event_registration","marketing.group_marketing_user",1,1,1,1
-"access_event_event_manager","event.event manager","model_event_event","base.group_marketing_manager",1,0,0,0
-"access_event_registration_manager","event.registration manager","model_event_registration","base.group_marketing_manager",1,0,0,0
-"access_crm_case_section_manager","crm.case.section manager","crm.model_crm_case_section","base.group_marketing_manager",1,1,1,1
-"access_product_product","product.product.product manager","product.model_product_product","base.group_marketing_manager",1,1,1,1
-"access_report_event_registration","report.event.registration","model_report_event_registration","base.group_marketing_manager",1,1,1,1
-"access_event_registration_badge_manager","event.registration.badge manager","model_event_registration_badge","base.group_marketing_manager",1,1,1,1
+"access_event_event_manager","event.event manager","model_event_event","marketing.group_marketing_manager",1,0,0,0
+"access_event_registration_manager","event.registration manager","model_event_registration","marketing.group_marketing_manager",1,0,0,0
+"access_crm_case_section_manager","crm.case.section manager","crm.model_crm_case_section","marketing.group_marketing_manager",1,1,1,1
+"access_product_product","product.product.product manager","product.model_product_product","marketing.group_marketing_manager",1,1,1,1
+"access_report_event_registration","report.event.registration","model_report_event_registration","marketing.group_marketing_manager",1,1,1,1
+"access_event_registration_badge_manager","event.registration.badge manager","model_event_registration_badge","marketing.group_marketing_manager",1,1,1,1
"access_event_event_sale_salesman","event.event.sale","model_event_event","base.group_sale_salesman",1,0,0,0
-"access_account_account_invoice_manager","account.account.invoice","account.model_account_invoice","base.group_marketing_manager",1,0,0,0
+"access_account_account_invoice_manager","account.account.invoice","account.model_account_invoice","marketing.group_marketing_manager",1,0,0,0
"access_event_registration_badge","event.registration.badge","model_event_registration_badge","marketing.group_marketing_user",1,0,0,0
"access_event_registration_sale_user","event.registration.sale.user","model_event_registration","base.group_sale_salesman",1,0,0,0
diff --git a/addons/l10n_ch/wizard/create_dta.py b/addons/l10n_ch/wizard/create_dta.py
index 94c623af13d..6d05cabd8e7 100644
--- a/addons/l10n_ch/wizard/create_dta.py
+++ b/addons/l10n_ch/wizard/create_dta.py
@@ -463,9 +463,9 @@ def _create_dta(obj, cr, uid, data, context=None):
v['partner_city']= ''
v['partner_zip']= ''
v['partner_country']= ''
- raise osv.except_osv('Error', 'No address defined \n' \
- 'for the partner: ' + pline.partner_id.name + '\n' \
- 'on line: ' + pline.name)
+ raise osv.except_osv(_('Error'), _('No address defined \n' \
+ 'for the partner: %s \n' \
+ 'on line: %s') % (pline.partner_id.name,pline.name))
if pline.order_id.date_scheduled:
date_value = datetime.strptime(pline.order_id.date_scheduled, '%Y-%m-%d')
@@ -612,4 +612,4 @@ class create_dta_wizard(osv.osv_memory):
create_dta_wizard()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/marketing/__openerp__.py b/addons/marketing/__openerp__.py
index 16127d2d343..931ac38c4bb 100644
--- a/addons/marketing/__openerp__.py
+++ b/addons/marketing/__openerp__.py
@@ -34,7 +34,7 @@
'security/ir.model.access.csv',
'marketing_view.xml'
],
- 'demo_xml': [],
+ 'demo_xml': ['marketing_demo.xml'],
'installable': True,
'active': False,
}
diff --git a/addons/marketing/marketing_demo.xml b/addons/marketing/marketing_demo.xml
new file mode 100644
index 00000000000..904736ac5ec
--- /dev/null
+++ b/addons/marketing/marketing_demo.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/marketing/marketing_view.xml b/addons/marketing/marketing_view.xml
index 69ee91d52dc..8b804487e77 100644
--- a/addons/marketing/marketing_view.xml
+++ b/addons/marketing/marketing_view.xml
@@ -2,7 +2,7 @@
-
+
marketing.installer.view
diff --git a/addons/marketing/security/marketing_security.xml b/addons/marketing/security/marketing_security.xml
index 740b9b3a2c5..06cf40772f4 100644
--- a/addons/marketing/security/marketing_security.xml
+++ b/addons/marketing/security/marketing_security.xml
@@ -4,5 +4,10 @@
Marketing / User
+
+
+ Marketing / Manager
+
+
diff --git a/addons/marketing_campaign/i18n/marketing_campaign.pot b/addons/marketing_campaign/i18n/marketing_campaign.pot
index 8f2a4dde22c..3d896b488b0 100644
--- a/addons/marketing_campaign/i18n/marketing_campaign.pot
+++ b/addons/marketing_campaign/i18n/marketing_campaign.pot
@@ -31,6 +31,18 @@ msgstr ""
msgid "The current step for this item has no email or report to preview."
msgstr ""
+#. module: marketing_campaign
+#: code:addons/marketing_campaign/marketing_campaign.py:0
+#, python-format
+msgid "Operation not supported"
+msgstr ""
+
+#. module: marketing_campaign
+#: code:addons/marketing_campaign/marketing_campaign.py:0
+#, python-format
+msgid "Sorry, campaign duplication is not supported at the moment."
+msgstr ""
+
#. module: marketing_campaign
#: code:addons/marketing_campaign/marketing_campaign.py:0
#, python-format
diff --git a/addons/marketing_campaign/marketing_campaign.py b/addons/marketing_campaign/marketing_campaign.py
index bdfe825781c..d0d18c043db 100644
--- a/addons/marketing_campaign/marketing_campaign.py
+++ b/addons/marketing_campaign/marketing_campaign.py
@@ -205,7 +205,7 @@ Normal - the campaign runs normally and automatically sends all emails and repor
# prevent duplication until the server properly duplicates several levels of nested o2m
def copy(self, cr, uid, id, default=None, context=None):
- raise osv.except_osv("Operation not supported", "Sorry, campaign duplication is not supported at the moment.")
+ raise osv.except_osv(_("Operation not supported"), _("Sorry, campaign duplication is not supported at the moment."))
marketing_campaign()
@@ -257,7 +257,7 @@ class marketing_campaign_segment(osv.osv):
return True
_constraints = [
- (_check_model, _('Model of filter must be same as resource model of Campaign '), ['ir_filter_id,campaign_id']),
+ (_check_model, 'Model of filter must be same as resource model of Campaign ', ['ir_filter_id,campaign_id']),
]
def onchange_campaign_id(self, cr, uid, ids, campaign_id):
@@ -309,7 +309,7 @@ class marketing_campaign_segment(osv.osv):
for segment in self.browse(cr, uid, segment_ids, context=context):
if segment.campaign_id.state != 'running':
continue
-
+
campaigns.add(segment.campaign_id.id)
act_ids = self.pool.get('marketing.campaign.activity').search(cr,
uid, [('start', '=', True), ('campaign_id', '=', segment.campaign_id.id)], context=context)
@@ -377,7 +377,7 @@ class marketing_campaign_activity(osv.osv):
help="Python expression to decide whether the activity can be executed, otherwise it will be deleted or cancelled."
"The expression may use the following [browsable] variables:\n"
" - activity: the campaign activity\n"
- " - workitem: the campaign workitem\n"
+ " - workitem: the campaign workitem\n"
" - resource: the resource object this campaign item represents\n"
" - transitions: list of campaign transitions outgoing from this activity\n"
"...- re: Python regular expression module"),
@@ -539,9 +539,9 @@ class marketing_campaign_transition(osv.osv):
return True
_constraints = [
- (_check_campaign, _('The To/From Activity of transition must be of the same Campaign '), ['activity_from_id,activity_to_id']),
+ (_check_campaign, 'The To/From Activity of transition must be of the same Campaign ', ['activity_from_id,activity_to_id']),
]
-
+
_sql_constraints = [
('interval_positive', 'CHECK(interval_nbr >= 0)', 'The interval must be positive or zero')
]
@@ -638,7 +638,7 @@ class marketing_campaign_workitem(osv.osv):
'activity': activity,
'workitem': workitem,
'object': object_id,
- 'resource': object_id,
+ 'resource': object_id,
'transitions': activity.to_ids,
're': re,
}
diff --git a/addons/marketing_campaign/report/campaign_analysis_view.xml b/addons/marketing_campaign/report/campaign_analysis_view.xml
index 1c8581b3f31..745dd4047e5 100644
--- a/addons/marketing_campaign/report/campaign_analysis_view.xml
+++ b/addons/marketing_campaign/report/campaign_analysis_view.xml
@@ -11,6 +11,7 @@
+
diff --git a/addons/marketing_campaign/security/ir.model.access.csv b/addons/marketing_campaign/security/ir.model.access.csv
index 082cafd7054..c2b7b4f4c86 100644
--- a/addons/marketing_campaign/security/ir.model.access.csv
+++ b/addons/marketing_campaign/security/ir.model.access.csv
@@ -1,13 +1,21 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_marketing_campaign_admin","marketing.campaign","model_marketing_campaign","marketing.group_marketing_user",1,1,1,1
-"access_marketing_campaign_segment_campaignadmin","marketing.campaign.segment","model_marketing_campaign_segment","marketing.group_marketing_user",1,1,1,1
-"access_marketing_campaign_activity_campaignadmin","marketing.campaign.activity","model_marketing_campaign_activity","marketing.group_marketing_user",1,1,1,1
-"access_marketing_campaign_workitem_campaignadmin","marketing.campaign.workitem","model_marketing_campaign_workitem","marketing.group_marketing_user",1,1,1,1
-"access_marketing_campaign_transition_campaignadmin","marketing.campaign.transition","model_marketing_campaign_transition","marketing.group_marketing_user",1,1,1,1
-"access_marketing_campaign_analysis_campaignadmin","campaign.analysis","model_campaign_analysis","marketing.group_marketing_user",1,1,1,1
+"access_marketing_campaign_admin","marketing.campaign","model_marketing_campaign","marketing.group_marketing_user",1,1,0,0
+"access_marketing_campaign_segment_campaignadmin","marketing.campaign.segment","model_marketing_campaign_segment","marketing.group_marketing_user",1,1,0,0
+"access_marketing_campaign_activity_campaignadmin","marketing.campaign.activity","model_marketing_campaign_activity","marketing.group_marketing_user",1,1,0,0
+"access_marketing_campaign_workitem_campaignadmin","marketing.campaign.workitem","model_marketing_campaign_workitem","marketing.group_marketing_user",1,1,0,0
+"access_marketing_campaign_transition_campaignadmin","marketing.campaign.transition","model_marketing_campaign_transition","marketing.group_marketing_user",1,1,0,0
+"access_marketing_campaign_analysis_campaignadmin","campaign.analysis","model_campaign_analysis","marketing.group_marketing_user",1,1,0,0
"access_marketing_campaign_workitem_all","marketing.campaign.workitem","model_marketing_campaign_workitem","base.group_user",1,0,0,0
-"access_email_template_user","email.template","model_email_template","marketing.group_marketing_user",1,1,1,1
-"access_email_template_account_user","email_template.account.user","email_template.model_email_template_account","marketing.group_marketing_user",1,1,1,1
+"access_email_template_user","email.template","model_email_template","marketing.group_marketing_user",1,1,0,0
+"access_email_template_account_user","email_template.account.user","email_template.model_email_template_account","marketing.group_marketing_user",1,1,0,0
"access_marketing_campaign_system","marketing.campaign system","model_marketing_campaign","base.group_system",1,0,0,0
"access_marketing_campaign_segment_system","marketing.campaign.segment system","model_marketing_campaign_segment","base.group_system",1,0,0,0
"access_marketing_campaign_workitem_system","marketing.campaign.workitem system","model_marketing_campaign_workitem","base.group_system",1,0,0,0
+"access_marketing_campaign_manager","marketing.campaign","model_marketing_campaign","marketing.group_marketing_manager",1,1,1,1
+"access_marketing_campaign_segment_campaign_manager","marketing.campaign.segment","model_marketing_campaign_segment","marketing.group_marketing_manager",1,1,1,1
+"access_marketing_campaign_activity_campaign_manager","marketing.campaign.activity","model_marketing_campaign_activity","marketing.group_marketing_manager",1,1,1,1
+"access_marketing_campaign_workitem_campaign_manager","marketing.campaign.workitem","model_marketing_campaign_workitem","marketing.group_marketing_manager",1,1,1,1
+"access_marketing_campaign_transition_campaign_manager","marketing.campaign.transition","model_marketing_campaign_transition","marketing.group_marketing_manager",1,1,1,1
+"access_marketing_campaign_analysis_campaign_manager","campaign.analysis","model_campaign_analysis","marketing.group_marketing_manager",1,1,1,1
+"access_email_template_manager","email.template","model_email_template","marketing.group_marketing_manager",1,1,1,1
+"access_email_template_account_manager","email_template.account.manager","email_template.model_email_template_account","marketing.group_marketing_manager",1,1,1,1
diff --git a/addons/mrp/i18n/ca.po b/addons/mrp/i18n/ca.po
index d0f2e64988c..ca586185708 100644
--- a/addons/mrp/i18n/ca.po
+++ b/addons/mrp/i18n/ca.po
@@ -2270,7 +2270,7 @@ msgstr ""
#~ msgid "Product & Location"
#~ msgstr "Producte & Ubicació"
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "Planificador MRP & Logística"
#~ msgid ""
diff --git a/addons/mrp/i18n/de.po b/addons/mrp/i18n/de.po
index ab0ab79587b..643bd0f1a5c 100644
--- a/addons/mrp/i18n/de.po
+++ b/addons/mrp/i18n/de.po
@@ -2508,7 +2508,7 @@ msgstr "Jahr"
#~ msgid "Product & Location"
#~ msgstr "Produkt & Lagerort"
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "Fertigungs- und Beschaffungsplanung"
#~ msgid ""
diff --git a/addons/mrp/i18n/el.po b/addons/mrp/i18n/el.po
index 5c7ca68f453..0308547af2a 100644
--- a/addons/mrp/i18n/el.po
+++ b/addons/mrp/i18n/el.po
@@ -2354,7 +2354,7 @@ msgstr ""
#~ msgid "Best price (not yet active!)"
#~ msgstr "Best price (not yet active!)"
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP & Προγραμματισμός Προμηθειών"
#~ msgid ""
diff --git a/addons/mrp/i18n/es.po b/addons/mrp/i18n/es.po
index 1a883321ff9..f182fc07d63 100644
--- a/addons/mrp/i18n/es.po
+++ b/addons/mrp/i18n/es.po
@@ -2511,7 +2511,7 @@ msgstr "Año"
#~ msgid "Product & Location"
#~ msgstr "Producto & Ubicación"
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "Planificador MRP & Logística"
#~ msgid ""
diff --git a/addons/mrp/i18n/fi.po b/addons/mrp/i18n/fi.po
index 0cb3e26f332..a41a1571a61 100644
--- a/addons/mrp/i18n/fi.po
+++ b/addons/mrp/i18n/fi.po
@@ -2385,7 +2385,7 @@ msgstr ""
#~ "This is the days added to what you promise to customers for security purpose"
#~ msgstr "Nämä päivät lisätään asiakkaalle luvattuun aikaan turvallisuussyistä"
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "Tuotanto- ja logistiikka-aikataulut"
#~ msgid "A purchase order is created for a sub-contracting demand."
diff --git a/addons/mrp/i18n/it.po b/addons/mrp/i18n/it.po
index 56545de28d3..a9c38d15a38 100644
--- a/addons/mrp/i18n/it.po
+++ b/addons/mrp/i18n/it.po
@@ -2501,7 +2501,7 @@ msgstr ""
#~ "Questi sono i giorni aggiunti, per sicurezza, alla data che hai promesso ai "
#~ "clienti."
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP e Schedulatore Logistico"
#~ msgid "Automatic Procurements"
diff --git a/addons/mrp/i18n/ko.po b/addons/mrp/i18n/ko.po
index f7d15c28df0..f6afd586b21 100644
--- a/addons/mrp/i18n/ko.po
+++ b/addons/mrp/i18n/ko.po
@@ -2246,7 +2246,7 @@ msgstr ""
#~ msgid "Product name"
#~ msgstr "제품 이름"
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP 및 물류 스케줄러"
#~ msgid "Ask New Products"
diff --git a/addons/mrp/i18n/nl.po b/addons/mrp/i18n/nl.po
index 202d9117369..aeb0547ec47 100644
--- a/addons/mrp/i18n/nl.po
+++ b/addons/mrp/i18n/nl.po
@@ -2464,7 +2464,7 @@ msgstr ""
#~ "Dit is het aantal dagen dat als veiligheidsmarge wordt toegevoegd aan de "
#~ "beloofde levertijd."
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP & logistieke planning"
#~ msgid "Product & Location"
diff --git a/addons/mrp/i18n/pl.po b/addons/mrp/i18n/pl.po
index 00767690d69..db537e316b7 100644
--- a/addons/mrp/i18n/pl.po
+++ b/addons/mrp/i18n/pl.po
@@ -2283,7 +2283,7 @@ msgstr ""
#~ msgid "Origin"
#~ msgstr "Pochodzenie"
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP i planowanie logistyczne"
#~ msgid "Product & Location"
diff --git a/addons/mrp/i18n/pt.po b/addons/mrp/i18n/pt.po
index 38ab051f51b..dcb5807136a 100644
--- a/addons/mrp/i18n/pt.po
+++ b/addons/mrp/i18n/pt.po
@@ -2500,7 +2500,7 @@ msgstr ""
#~ "Estes são os dias adicionados aos que prometeu aos clientes para fins de "
#~ "segurança"
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "Planificador Logístico e de Produção"
#~ msgid "Automatic Procurements"
diff --git a/addons/mrp/i18n/ru.po b/addons/mrp/i18n/ru.po
index 46a7997d409..8b73ee5ef3b 100644
--- a/addons/mrp/i18n/ru.po
+++ b/addons/mrp/i18n/ru.po
@@ -2516,7 +2516,7 @@ msgstr ""
#~ msgid "Exceptions Procurements"
#~ msgstr "Исключения поставок"
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "ПМР и Логистическое планирование"
#~ msgid "Stockable Stock"
diff --git a/addons/mrp/i18n/sk.po b/addons/mrp/i18n/sk.po
index d72ee6b54d0..2715a919654 100644
--- a/addons/mrp/i18n/sk.po
+++ b/addons/mrp/i18n/sk.po
@@ -2230,7 +2230,7 @@ msgstr ""
#~ msgid "Ask New Products"
#~ msgstr "Opýtať sa na nový produkt"
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP a plánovač logistiky"
#~ msgid "Product & Location"
diff --git a/addons/mrp/i18n/tr.po b/addons/mrp/i18n/tr.po
index 6c34a3b860d..54a7b5e374d 100644
--- a/addons/mrp/i18n/tr.po
+++ b/addons/mrp/i18n/tr.po
@@ -2241,7 +2241,7 @@ msgstr ""
#~ msgid "Product & Location"
#~ msgstr "Ürün & Lokasyon Bilgisi"
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP & Lojistik Planlaması"
#~ msgid "Ask New Products"
diff --git a/addons/mrp/i18n/zh_CN.po b/addons/mrp/i18n/zh_CN.po
index ce6a25897a9..f44485efd32 100644
--- a/addons/mrp/i18n/zh_CN.po
+++ b/addons/mrp/i18n/zh_CN.po
@@ -2544,7 +2544,7 @@ msgstr ""
#~ msgid "Product & Location"
#~ msgstr "产品&库位"
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "MRP&物流调度"
#~ msgid ""
diff --git a/addons/mrp/i18n/zh_HK.po b/addons/mrp/i18n/zh_HK.po
index a96126ab8db..5160246f0b4 100644
--- a/addons/mrp/i18n/zh_HK.po
+++ b/addons/mrp/i18n/zh_HK.po
@@ -2255,7 +2255,7 @@ msgstr ""
#~ "This is the days added to what you promise to customers for security purpose"
#~ msgstr "這是你為了客人的保險而所承諾的天數"
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "物料需求計劃 & 物流調度"
#~ msgid "Automatic Procurements"
diff --git a/addons/mrp/i18n/zh_TW.po b/addons/mrp/i18n/zh_TW.po
index 15c4a447108..a1e6e66c1de 100644
--- a/addons/mrp/i18n/zh_TW.po
+++ b/addons/mrp/i18n/zh_TW.po
@@ -2251,7 +2251,7 @@ msgstr ""
#~ "This is the days added to what you promise to customers for security purpose"
#~ msgstr "這是你為了客人的保險而所承諾的天數"
-#~ msgid "MRP & Logistic Scheduler"
+#~ msgid "MRP & Logistics Scheduler"
#~ msgstr "物料需求計劃 & 物流調度"
#~ msgid "Product & Location"
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index b6e14d0c182..a5d53fbf31d 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -446,18 +446,18 @@ class mrp_production(osv.osv):
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.production', context=c),
}
_order = 'priority desc, date_planned asc';
-
+
def _check_qty(self, cr, uid, ids):
orders = self.browse(cr, uid, ids)
for order in orders:
if order.product_qty <= 0:
return False
return True
-
+
_constraints = [
(_check_qty, 'Order quantity cannot be negative or zero !', ['product_qty']),
]
-
+
def unlink(self, cr, uid, ids, context=None):
productions = self.read(cr, uid, ids, ['state'])
unlink_ids = []
@@ -639,16 +639,16 @@ class mrp_production(osv.osv):
@param production_mode: specify production mode (consume/consume&produce).
@return: True
"""
-
+
stock_mov_obj = self.pool.get('stock.move')
production = self.browse(cr, uid, production_id)
-
+
final_product_todo = []
produced_qty = 0
if production_mode == 'consume_produce':
produced_qty = production_qty
-
+
for produced_product in production.move_created_ids2:
if (produced_product.scrapped) or (produced_product.product_id.id<>production.product_id.id):
continue
@@ -658,7 +658,7 @@ class mrp_production(osv.osv):
consumed_products = {}
check = {}
scrapped = map(lambda x:x.scrapped,production.move_lines2).count(True)
-
+
for consumed_product in production.move_lines2:
consumed = consumed_product.product_qty
if consumed_product.scrapped:
@@ -671,9 +671,9 @@ class mrp_production(osv.osv):
if (len(production.move_lines2) - scrapped) > len(production.product_lines):
check[consumed_product.product_id.id] += consumed_product.product_qty
consumed = check[consumed_product.product_id.id]
- rest_consumed = produced_qty * f.product_qty / production.product_qty - consumed
+ rest_consumed = produced_qty * f.product_qty / production.product_qty - consumed
consumed_products[consumed_product.product_id.id] = rest_consumed
-
+
for raw_product in production.move_lines:
for f in production.product_lines:
if f.product_id.id == raw_product.product_id.id:
@@ -712,7 +712,7 @@ class mrp_production(osv.osv):
new_parent_ids.append(final_product.id)
for new_parent_id in new_parent_ids:
stock_mov_obj.write(cr, uid, [raw_product.id], {'move_history_ids': [(4,new_parent_id)]})
-
+
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'mrp.production', production_id, 'button_produce_done', cr)
return True
@@ -750,7 +750,7 @@ class mrp_production(osv.osv):
'account_id': account,
'general_account_id': wc.costs_general_account_id.id,
'journal_id': wc.costs_journal_id.id,
- 'code': wc.code
+ 'code': wc.code,
} )
return amount
@@ -827,7 +827,7 @@ class mrp_production(osv.osv):
'company_id': production.company_id.id,
}
res_final_id = move_obj.create(cr, uid, data)
-
+
self.write(cr, uid, [production.id], {'move_created_ids': [(6, 0, [res_final_id])]})
moves = []
for line in production.product_lines:
@@ -879,7 +879,7 @@ class mrp_production(osv.osv):
'company_id': production.company_id.id,
})
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
- proc_ids.append(proc_id)
+ proc_ids.append(proc_id)
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
self.write(cr, uid, [production.id], {'picking_id': picking_id, 'move_lines': [(6,0,moves)], 'state':'confirmed'})
message = _("Manufacturing order '%s' is scheduled for the %s.") % (
diff --git a/addons/mrp/mrp_demo.xml b/addons/mrp/mrp_demo.xml
index cea5c60ee56..d19a99a12ca 100644
--- a/addons/mrp/mrp_demo.xml
+++ b/addons/mrp/mrp_demo.xml
@@ -2,6 +2,11 @@
+
+
+
+
+
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index ab4614827db..14d0d11e7ea 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -585,8 +585,8 @@
-
-
+
+
-
+
-
+
@@ -649,7 +649,7 @@
-
+
-
diff --git a/addons/mrp/test/mrp_procurement.yml b/addons/mrp/test/mrp_procurement.yml
index 4e01062d7b2..9286bc7df42 100644
--- a/addons/mrp/test/mrp_procurement.yml
+++ b/addons/mrp/test/mrp_procurement.yml
@@ -2,10 +2,10 @@
In order to test the flow of procurement orders. I will put some orders with
different procurement methods. I have installed sale, mrp and purchase modules.
-
- I am creating products.
--
+ I am creating products.
+-
I create record for product Shirt.
--
+-
!record {model: product.product, id: product_product_shirt0}:
categ_id: product.cat1
cost_method: standard
@@ -26,9 +26,9 @@
warranty: 0.0
weight: 0.0
weight_net: 0.0
--
+-
I create record for product Cloth.
--
+-
!record {model: product.product, id: product_product_cloth0}:
categ_id: product.cat1
cost_method: standard
@@ -52,9 +52,9 @@
warranty: 0.0
weight: 0.0
weight_net: 0.0
--
+-
I create record for product Buttons.
--
+-
!record {model: product.product, id: product_product_buttons0}:
categ_id: product.cat1
cost_method: standard
@@ -79,10 +79,10 @@
weight: 0.0
weight_net: 0.0
-
- I am creating bills of material for 'Shirt'.
--
+ I am creating bills of material for 'Shirt'.
+-
I create bills of material for Shirt.
--
+-
!record {model: mrp.bom, id: mrp_bom_shirt0}:
bom_lines:
- company_id: base.main_company
@@ -99,7 +99,7 @@
product_efficiency: 1.0
product_id: product_product_buttons0
product_qty: 8.0
- product_uom: product.product_uom_unit
+ product_uom: product.product_uom_kgm
product_uos_qty: 0.0
sequence: 0.0
type: normal
@@ -123,7 +123,7 @@
product_id: mrp.product_product_buttons0
product_max_qty: 50.0
product_min_qty: 10.0
- product_uom: product.product_uom_unit
+ product_uom: product.product_uom_kgm
qty_multiple: 1
warehouse_id: stock.warehouse0
-
@@ -142,7 +142,7 @@
-
I run the procurement.
-
- !workflow {model: procurement.order, action: button_check, ref: procurement_order_shirt0}
+ !workflow {model: procurement.order, action: button_check, ref: procurement_order_shirt0}
-
I see that there is a manufacturing order for Shirt.
-
@@ -210,7 +210,7 @@
picking_ids = pick_obj.search(cr, uid, [('address_id.name','=','Wong'),('state','=','assigned')])
partial = self.browse(cr, uid, 1, context)
partial_datas = {
- 'delivery_date' : partial.date
+ 'delivery_date' : partial.date
}
for pick in pick_obj.browse(cr, uid, picking_ids):
for m in pick.move_lines:
@@ -219,8 +219,8 @@
'product_qty' : m.product_qty,
'product_uom' : m.product_uom.id
}
- if (pick.type == 'in') and (m.product_id.cost_method == 'average'):
- partial_datas['move%s'%(m.id)].update({
+ if (pick.type == 'in') and (m.product_id.cost_method == 'average'):
+ partial_datas['move%s'%(m.id)].update({
'product_price' : m.product_price,
'product_currency': m.product_currency
})
@@ -246,7 +246,7 @@
picking_ids = pick_obj.search(cr, uid, [('address_id.name','=','Tang'),('state','=','assigned')])
partial = self.browse(cr, uid, 1, context)
partial_datas = {
- 'delivery_date': partial.date
+ 'delivery_date': partial.date
}
for pick in pick_obj.browse(cr, uid, picking_ids):
for m in pick.move_lines:
@@ -255,8 +255,8 @@
'product_qty': m.product_qty,
'product_uom': m.product_uom.id
}
- if (pick.type == 'in') and (m.product_id.cost_method == 'average'):
- partial_datas['move%s'%(m.id)].update({
+ if (pick.type == 'in') and (m.product_id.cost_method == 'average'):
+ partial_datas['move%s'%(m.id)].update({
'product_price': m.product_price,
'product_currency': m.product_currency
})
@@ -323,4 +323,4 @@
prod_obj = self.pool.get('mrp.production')
prod_ids = prod_obj.search(cr, uid, [('product_id.name','=','Shirt')])
self.do_produce(cr, uid, [1], context={'active_ids': prod_ids})
-
+
diff --git a/addons/mrp/wizard/mrp_product_produce.py b/addons/mrp/wizard/mrp_product_produce.py
index aea6fb41bc0..16729b7eccf 100644
--- a/addons/mrp/wizard/mrp_product_produce.py
+++ b/addons/mrp/wizard/mrp_product_produce.py
@@ -26,7 +26,7 @@ class mrp_product_produce(osv.osv_memory):
_description = "Product Produce"
_columns = {
- 'product_qty': fields.float('Quantity', required=True),
+ 'product_qty': fields.float('Select Quantity', required=True),
'mode': fields.selection([('consume_produce', 'Consume & Produce'),
('consume', 'Consume Only')], 'Mode', required=True,
help="'Consume only' mode will only consume the products with the quantity selected.\n"
diff --git a/addons/point_of_sale/i18n/point_of_sale.pot b/addons/point_of_sale/i18n/point_of_sale.pot
index 50c2a2092cc..8a7f575bec6 100644
--- a/addons/point_of_sale/i18n/point_of_sale.pot
+++ b/addons/point_of_sale/i18n/point_of_sale.pot
@@ -290,6 +290,12 @@ msgstr ""
msgid "No valid pricelist line found !"
msgstr ""
+#. module: point_of_sale
+#: code:addons/point_of_sale/wizard/pos_discount.py:0
+#, python-format
+msgid "No Order Lines"
+msgstr ""
+
#. module: point_of_sale
#: report:pos.details:0
#: report:pos.lines:0
@@ -1732,6 +1738,7 @@ msgstr ""
#. module: point_of_sale
#: code:addons/point_of_sale/wizard/pos_payment.py:0
+#: code:addons/point_of_sale/wizard/pos_discount.py:0
#, python-format
msgid "Error!"
msgstr ""
diff --git a/addons/point_of_sale/wizard/pos_discount.py b/addons/point_of_sale/wizard/pos_discount.py
index f0ea93e3d7a..03717f7701c 100644
--- a/addons/point_of_sale/wizard/pos_discount.py
+++ b/addons/point_of_sale/wizard/pos_discount.py
@@ -47,7 +47,7 @@ class pos_discount(osv.osv_memory):
record_id = context and context.get('active_id', False) or False
order = self.pool.get('pos.order').browse(cr, uid, record_id, context=context)
if not order.lines:
- raise osv.except_osv('Error!','No Order Lines ')
+ raise osv.except_osv(_('Error!'), _('No Order Lines'))
True
def apply_discount(self, cr, uid, ids, context=None):
diff --git a/addons/procurement/company_view.xml b/addons/procurement/company_view.xml
index e046fd4faee..4d14f69edde 100644
--- a/addons/procurement/company_view.xml
+++ b/addons/procurement/company_view.xml
@@ -10,7 +10,7 @@
-
+
diff --git a/addons/procurement/i18n/en_US.po b/addons/procurement/i18n/en_US.po
index 61b250516dd..249709f42cf 100644
--- a/addons/procurement/i18n/en_US.po
+++ b/addons/procurement/i18n/en_US.po
@@ -314,8 +314,8 @@ msgstr "If you encode manually a Procurement, you probably want to use a make to
#. module: procurement
#: view:res.company:0
-msgid "MRP & Logistic Scheduler"
-msgstr "MRP & Logistic Scheduler"
+msgid "MRP & Logistics Scheduler"
+msgstr "MRP & Logistics Scheduler"
#. module: procurement
#: view:procurement.order.compute.all:0
diff --git a/addons/procurement/i18n/fr.po b/addons/procurement/i18n/fr.po
index 1cd6975c4f5..441527c6ce6 100644
--- a/addons/procurement/i18n/fr.po
+++ b/addons/procurement/i18n/fr.po
@@ -324,7 +324,7 @@ msgstr ""
#. module: procurement
#: view:res.company:0
-msgid "MRP & Logistic Scheduler"
+msgid "MRP & Logistics Scheduler"
msgstr ""
#. module: procurement
diff --git a/addons/procurement/i18n/it.po b/addons/procurement/i18n/it.po
index aecf56d6ea3..63df3159cd0 100644
--- a/addons/procurement/i18n/it.po
+++ b/addons/procurement/i18n/it.po
@@ -325,7 +325,7 @@ msgstr ""
#. module: procurement
#: view:res.company:0
-msgid "MRP & Logistic Scheduler"
+msgid "MRP & Logistics Scheduler"
msgstr ""
#. module: procurement
diff --git a/addons/procurement/i18n/mn.po b/addons/procurement/i18n/mn.po
index 02ab5806aa2..1a7b557422d 100644
--- a/addons/procurement/i18n/mn.po
+++ b/addons/procurement/i18n/mn.po
@@ -373,7 +373,7 @@ msgstr ""
#. module: procurement
#: view:res.company:0
-msgid "MRP & Logistic Scheduler"
+msgid "MRP & Logistics Scheduler"
msgstr "Үйлдвэрлэл & Логистик"
#. module: procurement
diff --git a/addons/procurement/i18n/nl.po b/addons/procurement/i18n/nl.po
index 978d027fb94..b426a7aa414 100644
--- a/addons/procurement/i18n/nl.po
+++ b/addons/procurement/i18n/nl.po
@@ -325,7 +325,7 @@ msgstr ""
#. module: procurement
#: view:res.company:0
-msgid "MRP & Logistic Scheduler"
+msgid "MRP & Logistics Scheduler"
msgstr ""
#. module: procurement
diff --git a/addons/procurement/i18n/pl.po b/addons/procurement/i18n/pl.po
index edf783bd6c4..737298169f3 100644
--- a/addons/procurement/i18n/pl.po
+++ b/addons/procurement/i18n/pl.po
@@ -344,7 +344,7 @@ msgstr ""
#. module: procurement
#: view:res.company:0
-msgid "MRP & Logistic Scheduler"
+msgid "MRP & Logistics Scheduler"
msgstr "MRP i planowanie logistyczne"
#. module: procurement
diff --git a/addons/procurement/i18n/procurement.pot b/addons/procurement/i18n/procurement.pot
index ccf727af0af..4c3a1dff71f 100644
--- a/addons/procurement/i18n/procurement.pot
+++ b/addons/procurement/i18n/procurement.pot
@@ -332,7 +332,7 @@ msgstr ""
#. module: procurement
#: view:res.company:0
-msgid "MRP & Logistic Scheduler"
+msgid "MRP & Logistics Scheduler"
msgstr ""
#. module: procurement
diff --git a/addons/procurement/i18n/ru.po b/addons/procurement/i18n/ru.po
index 3dab25cb2f6..ba77a1e4b57 100644
--- a/addons/procurement/i18n/ru.po
+++ b/addons/procurement/i18n/ru.po
@@ -342,7 +342,7 @@ msgstr ""
#. module: procurement
#: view:res.company:0
-msgid "MRP & Logistic Scheduler"
+msgid "MRP & Logistics Scheduler"
msgstr "ПМР и Логистическое планирование"
#. module: procurement
diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py
index 55ffd6d1f55..23cf0a18ff5 100644
--- a/addons/procurement/procurement.py
+++ b/addons/procurement/procurement.py
@@ -62,11 +62,11 @@ mrp_property()
class StockMove(osv.osv):
_inherit = 'stock.move'
-
+
_columns= {
'procurements': fields.one2many('procurement.order', 'move_id', 'Procurements'),
}
-
+
def copy(self, cr, uid, id, default=None, context=None):
default = default or {}
default['procurements'] = []
@@ -134,7 +134,7 @@ class procurement_order(osv.osv):
if s['state'] in ['draft','cancel']:
unlink_ids.append(s['id'])
else:
- raise osv.except_osv(_('Invalid action !'),
+ raise osv.except_osv(_('Invalid action !'),
_('Cannot delete Procurement Order(s) which are in %s State!') % \
s['state'])
return osv.osv.unlink(self, cr, uid, unlink_ids, context=context)
@@ -165,12 +165,13 @@ class procurement_order(osv.osv):
"""
return all(procurement.move_id.state == 'cancel' for procurement in self.browse(cr, uid, ids))
- def check_move_done(self, cr, uid, ids, context={}):
+ def check_move_done(self, cr, uid, ids, context=None):
""" Checks if move is done or not.
@return: True or False.
"""
- return all(procurement.move_id.state == 'done' for procurement in self.browse(cr, uid, ids))
-
+ if not context:
+ context = {}
+ return all(not procurement.move_id or procurement.move_id.state == 'done' for procurement in self.browse(cr, uid, ids, context=context))
#
# This method may be overrided by objects that override procurement.order
# for computing their own purpose
@@ -283,7 +284,7 @@ class procurement_order(osv.osv):
if procurement.product_id.product_tmpl_id.supply_method <> 'buy':
return False
if not procurement.product_id.seller_ids:
- cr.execute('update procurement_order set message=%s where id=%s',
+ cr.execute('update procurement_order set message=%s where id=%s',
(_('No supplier defined for this product !'), procurement.id))
return False
partner = procurement.product_id.seller_id #Taken Main Supplier of Product of Procurement.
@@ -293,7 +294,7 @@ class procurement_order(osv.osv):
return False
address_id = partner_obj.address_get(cr, uid, [partner.id], ['delivery'])['delivery']
if not address_id:
- cr.execute('update procurement_order set message=%s where id=%s',
+ cr.execute('update procurement_order set message=%s where id=%s',
(_('No address defined for the supplier'), procurement.id))
return False
return True
@@ -314,7 +315,7 @@ class procurement_order(osv.osv):
move_obj = self.pool.get('stock.move')
for procurement in self.browse(cr, uid, ids):
if procurement.product_qty <= 0.00:
- raise osv.except_osv(_('Data Insufficient !'),
+ raise osv.except_osv(_('Data Insufficient !'),
_('Please check the Quantity in Procurement Order(s), it should not be less than 1!'))
if procurement.product_id.type in ('product', 'consu'):
if not procurement.move_id:
@@ -342,7 +343,7 @@ class procurement_order(osv.osv):
""" Changes procurement state to Running and writes message.
@return: True
"""
- self.write(cr, uid, ids, {'state': 'running',
+ self.write(cr, uid, ids, {'state': 'running',
'message': _('from stock: products assigned.')})
return True
@@ -365,8 +366,8 @@ class procurement_order(osv.osv):
ok = ok and self.pool.get('stock.move').action_assign(cr, uid, [id])
cr.execute('select count(id) from stock_warehouse_orderpoint where product_id=%s', (procurement.product_id.id,))
if not cr.fetchone()[0]:
- cr.execute('update procurement_order set message=%s where id=%s',
- (_('Not enough stock and no minimum orderpoint rule defined.'),
+ cr.execute('update procurement_order set message=%s where id=%s',
+ (_('Not enough stock and no minimum orderpoint rule defined.'),
procurement.id))
message = _("Procurement '%s' is in exception: not enough stock.") % \
(procurement.name,)
@@ -479,7 +480,7 @@ class StockPicking(osv.osv):
wf_service.trg_validate(user, 'procurement.order',
procurement.id, 'button_check', cursor)
return res
-
+
StockPicking()
class stock_warehouse_orderpoint(osv.osv):
@@ -517,7 +518,7 @@ class stock_warehouse_orderpoint(osv.osv):
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.warehouse.orderpoint', context=c)
}
_sql_constraints = [
- ('qty_multiple_check', 'CHECK( qty_multiple > 0 )',
+ ('qty_multiple_check', 'CHECK( qty_multiple > 0 )',
_('Qty Multiple must be greater than zero.')),
]
@@ -531,7 +532,7 @@ class stock_warehouse_orderpoint(osv.osv):
v = {'location_id': w.lot_stock_id.id}
return {'value': v}
return {}
-
+
def onchange_product_id(self, cr, uid, ids, product_id, context={}):
""" Finds UoM for changed product.
@param product_id: Changed id of product.
@@ -542,7 +543,7 @@ class stock_warehouse_orderpoint(osv.osv):
v = {'product_uom': prod.uom_id.id}
return {'value': v}
return {}
-
+
def copy(self, cr, uid, id, default=None,context={}):
if not default:
default = {}
@@ -550,6 +551,6 @@ class stock_warehouse_orderpoint(osv.osv):
'name': self.pool.get('ir.sequence').get(cr, uid, 'stock.orderpoint') or '',
})
return super(stock_warehouse_orderpoint, self).copy(cr, uid, id, default, context)
-
+
stock_warehouse_orderpoint()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml
index 53f84367b17..96b96f3af21 100644
--- a/addons/procurement/procurement_view.xml
+++ b/addons/procurement/procurement_view.xml
@@ -262,7 +262,7 @@
src_model="procurement.order"/>
-
+
diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py
index f2eb3f28793..7d9aaa834f9 100644
--- a/addons/product/pricelist.py
+++ b/addons/product/pricelist.py
@@ -129,9 +129,9 @@ class product_pricelist(osv.osv):
#def price_get_multi(self, cr, uid, product_ids, context=None):
def price_get_multi(self, cr, uid, pricelist_ids, products_by_qty_by_partner, context=None):
"""multi products 'price_get'.
- @param pricelist_ids:
- @param products_by_qty:
- @param partner:
+ @param pricelist_ids:
+ @param products_by_qty:
+ @param partner:
@param context: {
'date': Date of the pricelist (%Y-%m-%d),}
@return: a dict of dict with product_id as key and a dict 'price by pricelist' as value
@@ -234,7 +234,7 @@ class product_pricelist(osv.osv):
else:
price_tmp = self.price_get(cr, uid,
[res['base_pricelist_id']], product_id,
- qty)[res['base_pricelist_id']]
+ qty, context=context)[res['base_pricelist_id']]
ptype_src = self.browse(cr, uid, res['base_pricelist_id']).currency_id.id
price = currency_obj.compute(cr, uid, ptype_src, res['currency_id'], price_tmp, round=False)
elif res['base'] == -2:
@@ -371,7 +371,7 @@ class product_pricelist(osv.osv):
'ORDER BY sequence',
(tmpl_id, prod_id, plversion['id'], qty))
res1 = cr.dictfetchall()
-
+
for res in res1:
item_id = 0
if res:
@@ -386,7 +386,7 @@ class product_pricelist(osv.osv):
res['base_pricelist_id']).currency_id.id
price = currency_obj.compute(cr, uid, ptype_src,
res['currency_id'], price_tmp, round=False)
- break
+ break
elif res['base'] == -2:
where = []
if partner:
@@ -413,7 +413,7 @@ class product_pricelist(osv.osv):
if price:
price_limit = price
-
+
price = price * (1.0+(res['price_discount'] or 0.0))
price = rounding(price, res['price_round'])
price += (res['price_surcharge'] or 0.0)
@@ -422,14 +422,14 @@ class product_pricelist(osv.osv):
if res['price_max_margin']:
price = min(price, price_limit+res['price_max_margin'])
item_id = res['id']
- break
+ break
else:
# False means no valid line found ! But we may not raise an
# exception here because it breaks the search
price = False
result[id] = price
- result['item_id'] = {id: item_id}
+ result['item_id'] = {id: item_id}
if context and ('uom' in context):
product = product_obj.browse(cr, uid, prod_id)
uom = product.uos_id or product.uom_id
@@ -559,7 +559,7 @@ class product_pricelist_item(osv.osv):
}
_constraints = [
- (_check_recursion, _('Error ! You cannot assign the Main Pricelist as Other Pricelist in PriceList Item!'), ['base_pricelist_id'])
+ (_check_recursion, 'Error ! You cannot assign the Main Pricelist as Other Pricelist in PriceList Item!', ['base_pricelist_id'])
]
def product_id_change(self, cr, uid, ids, product_id, context={}):
diff --git a/addons/product/product.py b/addons/product/product.py
index 09e7c3d8e19..2b99f48a062 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -24,12 +24,40 @@ import decimal_precision as dp
import math
from _common import rounding
-import re
+import re
from tools.translate import _
def is_pair(x):
return not x%2
+def check_ean(eancode):
+ if not eancode:
+ return True
+ if len(eancode) <> 13:
+ return False
+ try:
+ int(eancode)
+ except:
+ return False
+ oddsum=0
+ evensum=0
+ total=0
+ eanvalue=eancode
+ reversevalue = eanvalue[::-1]
+ finalean=reversevalue[1:]
+
+ for i in range(len(finalean)):
+ if is_pair(i):
+ oddsum += int(finalean[i])
+ else:
+ evensum += int(finalean[i])
+ total=(oddsum * 3) + evensum
+
+ check = int(10 - math.ceil(total % 10.0))
+
+ if check != int(eancode[-1]):
+ return False
+ return True
#----------------------------------------------------------
# UOM
#----------------------------------------------------------
@@ -69,7 +97,7 @@ class product_uom(osv.osv):
'name': fields.char('Name', size=64, required=True, translate=True),
'category_id': fields.many2one('product.uom.categ', 'UoM Category', required=True, ondelete='cascade',
help="Quantity conversions may happen automatically between Units of Measure in the same category, according to their respective ratios."),
- 'factor': fields.float('Ratio', required=True,digits=(12, 6),
+ 'factor': fields.float('Ratio', required=True,digits=(12, 12),
help='How many times this UoM is smaller than the reference UoM in this category:\n'\
'1 * (reference unit) = ratio * (this unit)'),
'factor_inv': fields.function(_factor_inv, digits_compute=dp.get_precision('Product UoM'),
@@ -106,9 +134,14 @@ class product_uom(osv.osv):
from_unit, to_unit = uoms[-1], uoms[0]
return self._compute_qty_obj(cr, uid, from_unit, qty, to_unit)
- def _compute_qty_obj(self, cr, uid, from_unit, qty, to_unit, context={}):
+ def _compute_qty_obj(self, cr, uid, from_unit, qty, to_unit, context=None):
+ if context is None:
+ context = {}
if from_unit.category_id.id <> to_unit.category_id.id:
- return qty
+ if context.get('raise-exception', True):
+ raise osv.except_osv(_('Error !'), _('Conversion from Product UoM m to Default UoM PCE is not possible as they both belong to different Category!.'))
+ else:
+ return qty
amount = qty / from_unit.factor
if to_unit:
amount = rounding(amount * to_unit.factor, to_unit.rounding)
@@ -342,7 +375,7 @@ class product_product(osv.osv):
def _product_price(self, cr, uid, ids, name, arg, context={}):
res = {}
- quantity = context.get('quantity', 1)
+ quantity = context.get('quantity') or 1.0
pricelist = context.get('pricelist', False)
if pricelist:
for id in ids:
@@ -423,7 +456,7 @@ class product_product(osv.osv):
'incoming_qty': fields.function(_product_incoming_qty, method=True, type='float', string='Incoming'),
'outgoing_qty': fields.function(_product_outgoing_qty, method=True, type='float', string='Outgoing'),
'price': fields.function(_product_price, method=True, type='float', string='Pricelist', digits_compute=dp.get_precision('Sale Price')),
- 'lst_price' : fields.function(_product_lst_price, method=True, type='float', string='List Price', digits_compute=dp.get_precision('Sale Price')),
+ 'lst_price' : fields.function(_product_lst_price, method=True, type='float', string='Public Price', digits_compute=dp.get_precision('Sale Price')),
'code': fields.function(_product_code, method=True, type='char', string='Reference'),
'partner_ref' : fields.function(_product_partner_ref, method=True, type='char', string='Customer ref'),
'default_code' : fields.char('Reference', size=64),
@@ -447,32 +480,18 @@ class product_product(osv.osv):
return False
def _check_ean_key(self, cr, uid, ids):
- for partner in self.browse(cr, uid, ids):
- if not partner.ean13:
- continue
- if len(partner.ean13) <> 13:
- return False
- try:
- int(partner.ean13)
- except:
- return False
- sum=0
- for i in range(12):
- if is_pair(i):
- sum += int(partner.ean13[i])
- else:
- sum += 3 * int(partner.ean13[i])
- check = int(math.ceil(sum / 10.0) * 10 - sum)
- if check != int(partner.ean13[12]):
- return False
- return True
+ for product in self.browse(cr, uid, ids):
+ res = check_ean(product.ean13)
+ return res
_constraints = [(_check_ean_key, 'Error: Invalid ean code', ['ean13'])]
def on_order(self, cr, uid, ids, orderline, quantity):
pass
- def name_get(self, cr, user, ids, context={}):
+ def name_get(self, cr, user, ids, context=None):
+ if context is None:
+ context = {}
if not len(ids):
return []
def _name_get(d):
@@ -480,10 +499,26 @@ class product_product(osv.osv):
code = d.get('default_code',False)
if code:
name = '[%s] %s' % (code,name)
- if d['variants']:
+ if d.get('variants'):
name = name + ' - %s' % (d['variants'],)
return (d['id'], name)
- result = map(_name_get, self.read(cr, user, ids, ['variants','name','default_code'], context))
+
+ partner_id = context.get('partner_id', False)
+
+ result = []
+ for product in self.browse(cr, user, ids, context=context):
+ sellers = filter(lambda x: x.name.id == partner_id, product.seller_ids)
+ if sellers:
+ for s in sellers:
+ mydict = {
+ 'id': product.id,
+ 'name': s.product_name or product.name,
+ 'default_code': s.product_code or product.default_code,
+ 'variants': product.variants
+ }
+ result.append(_name_get(mydict))
+ else:
+ result.append(_name_get(self.read(cr, user, product.id, ['variants','name','default_code'], context)))
return result
def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=100):
@@ -595,6 +630,13 @@ class product_packaging(osv.osv):
}
+ def _check_ean_key(self, cr, uid, ids):
+ for pack in self.browse(cr, uid, ids):
+ res = check_ean(pack.ean)
+ return res
+
+ _constraints = [(_check_ean_key, 'Error: Invalid ean code', ['ean'])]
+
def name_get(self, cr, uid, ids, context={}):
if not len(ids):
return []
@@ -649,7 +691,7 @@ class product_supplierinfo(osv.osv):
return res and res[0] or False
_columns = {
- 'name' : fields.many2one('res.partner', 'Supplier', required=True, ondelete='cascade', help="Supplier of this product"),
+ 'name' : fields.many2one('res.partner', 'Supplier', required=True,domain = [('supplier','=',True)], ondelete='cascade', help="Supplier of this product"),
'product_name': fields.char('Supplier Product Name', size=128, help="This supplier's product name will be used when printing a request for quotation. Keep empty to use the internal one."),
'product_code': fields.char('Supplier Product Code', size=64, help="This supplier's product code will be used when printing a request for quotation. Keep empty to use the internal one."),
'sequence' : fields.integer('Sequence', help="Assigns the priority to the list of product supplier."),
diff --git a/addons/product/product_demo.xml b/addons/product/product_demo.xml
index 92d0df088ef..d8c1e29749b 100644
--- a/addons/product/product_demo.xml
+++ b/addons/product/product_demo.xml
@@ -1,10 +1,15 @@
-
+
+
+
+
+
+
Sellable
@@ -52,40 +57,40 @@
-
- Marketable Products
-
-
-
-
-
- Shelves
-
-
-
-
- Other Products
-
-
-
-
-
- Raw Materials
-
-
-
-
-
- Marketable Services
-
-
-
-
-
- Misc
-
+
+ Marketable Products
+
+
+
+
+
+ Shelves
+
+
+
+
+ Other Products
+
+
+
+
+
+ Raw Materials
+
+
+
+
+
+ Marketable Services
+
+
+
+
+
+ Misc
+
+
-
Box 20x20x40
box
@@ -94,11 +99,11 @@
Box 30x40x60
box
-
+
-
+
38.25
25.5
@@ -126,6 +131,7 @@
2.0
Basic PC
+ product
@@ -138,6 +144,7 @@
make_to_order
18.0
Basic+ PC (assembly on order)
+ product
@@ -149,6 +156,7 @@
3.0
Medium PC
+ product
@@ -160,6 +168,7 @@
make_to_order
Customizable PC
+ product
end
@@ -171,6 +180,7 @@
1.0
Mainboard ASUStek A7N8X
+ product
@@ -181,6 +191,7 @@
1.0
Mainboard ASUStek A7V8X-X
+ product
draft
@@ -192,6 +203,7 @@
1.0
Processor AMD Athlon XP 1800+
+ product
@@ -202,6 +214,7 @@
1.0
Processor AMD Athlon XP 2200+
+ product
@@ -212,6 +225,7 @@
1.0
HDD Seagate 7200.8 80GB
+ product
@@ -222,6 +236,7 @@
1.0
HDD Seagate 7200.8 120GB
+ product
@@ -233,6 +248,7 @@
make_to_order
1.0
HDD Seagate 7200.8 160GB
+ product
@@ -243,6 +259,7 @@
1.0
Regular case fan 80mm
+ product
@@ -253,6 +270,7 @@
1.0
Silent fan
+ product
@@ -265,6 +283,7 @@
1.0
Regular processor config
make_to_order
+ product
@@ -275,6 +294,7 @@
1.0
DDR 256MB PC400
+ product
@@ -285,6 +305,7 @@
1.0
DDR 512MB PC400
+ product
@@ -297,6 +318,7 @@
make_to_order
1.0
High speed processor config
+ product
@@ -307,6 +329,7 @@
1.0
ATX Mid-size Tower
+ product
@@ -319,6 +342,7 @@
make_to_order
1.0
HDD on demand
+ product
@@ -331,6 +355,7 @@
RAM on demand
+ product
@@ -341,6 +366,7 @@
Processor on demand
+ product
@@ -352,6 +378,7 @@
Complete PC With Peripherals
+ product
@@ -362,6 +389,7 @@
Keyboard
AZERTY
+ product
@@ -371,6 +399,7 @@
Mouse
+ product
@@ -381,6 +410,7 @@
Kit Keyboard + Mouse
+ product
@@ -388,213 +418,223 @@
Resource: product.product NEW EVV
-->
-
+
SHE100
produce
130.0
50.0
-
-
- Shelf of 100cm
+
+
+ Shelf of 100cm
+ product
-
-
-
+
+
+
SHE200
produce
210.0
80.0
-
-
- Shelf of 200cm
-
-
-
+
+
+ Shelf of 200cm
+ product
+
+
+
WOOD002
buy
5.0
-
-
- Wood 2mm
-
-
-
-
+
+
+ Wood 2mm
+
+
+ product
+
+
-
+
PROJ
produce
service
90.0
20.0
-
-
- Kitchen Design Project
-
-
+
+
+ Kitchen Design Project
+
+
-
+
EMPL
produce
service
200.0
50.0
-
-
- Employee
-
-
+
+
+ Employee
+
+
-
+
REST
produce
- consu
1.0
1.0
-
-
- Restaurant Expenses
-
-
+
+
+ Restaurant Expenses
+
+
-
- WORK
- produce
- service
-
-
-
- 20.0
-
-
- Worker
-
-
+
+ WORK
+ produce
+ service
+
+
+
+ 20.0
+
+
+ Worker
+
+
-
+
RPAN100
buy
10.0
-
-
- Rear Panel SHE100
+
+
+ Rear Panel SHE100
-
-
+ product
+
+
-
+
RPAN200
buy
13.0
-
-
- Rear Panel SHE200
+
+
+ Rear Panel SHE200
-
-
+ product
+
+
-
+
SIDEPAN
buy
3.0
-
-
- Side Panel
+
+
+ Side Panel
-
-
+ product
+
+
-
+
RCK100
buy
5.0
-
-
- Rack 100cm
+
+
+ Rack 100cm
-
-
+ product
+
+
-
+
RCK200
buy
4.0
-
-
- Rack 200cm
+
+
+ Rack 200cm
-
-
+ product
+
+
-
+
PROFIL
produce
1.0
2.0
-
-
- Assembly Section
+
+
+ Assembly Section
+ product
-
+
-
+
LIN40
buy
8.0
-
-
- Wood Lintel 4m
+
+
+ Wood Lintel 4m
-
-
+ product
+
+
-
+
METC000
buy
-
-
- Metal Cleats
+
+
+ Metal Cleats
-
-
+ product
+
+
-
+
HOT
produce
- consu
1.0
1.0
-
-
- Hotel Expenses
-
-
+
+
+ Hotel Expenses
+
+
-
+
SHE100KIT
produce
110.0
48.0
-
-
- KIT Shelf of 100cm
+
+
+ KIT Shelf of 100cm
-
-
+ product
+
+
-
+
10
1
-
+
-
+
5
1
-
-
+
+
-
-
+
+
5
1
-
-
+
+
-
-
+
+
5
1
-
-
+
+
-
-
+
+
8
1
-
-
+
+
-
-
+
+
8
1
-
-
+
+
-
-
+
+
2
1
-
-
+
+
-
-
+
+
10
1
-
-
+
+
-
-
+
+
20
1
-
-
-
+
+
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index 2bd4e95f29d..a78de705e57 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -51,8 +51,8 @@
-
+
diff --git a/addons/product_expiry/product_expiry.py b/addons/product_expiry/product_expiry.py
index 01ce50dead8..fb53d9d0c03 100644
--- a/addons/product_expiry/product_expiry.py
+++ b/addons/product_expiry/product_expiry.py
@@ -45,19 +45,19 @@ class stock_production_lot(osv.osv):
_columns = {
'life_date': fields.datetime('End of Life Date',
- help='The date the lot may become dangerous and should not be consumed.'),
+ help='The date on which the lot may become dangerous and should not be consumed.'),
'use_date': fields.datetime('Best before Date',
- help='The date the lot starts deteriorating without becoming dangerous.'),
+ help='The date on which the lot starts deteriorating without becoming dangerous.'),
'removal_date': fields.datetime('Removal Date',
- help='The date the lot should be removed.'),
- 'alert_date': fields.datetime('Alert Date', help="The date signifying an alert to notify about the production lot."),
+ help='The date on which the lot should be removed.'),
+ 'alert_date': fields.datetime('Alert Date', help="The date on which an alert should be notified about the production lot."),
}
# Assign dates according to products data
def create(self, cr, uid, vals, context=None):
newid = super(stock_production_lot, self).create(cr, uid, vals, context=context)
obj = self.browse(cr, uid, newid, context=context)
towrite = []
- for f in ('life_date','use_date','removal_date','alert_date'):
+ for f in ('life_date', 'use_date', 'removal_date', 'alert_date'):
if not getattr(obj, f):
towrite.append(f)
context = context or {}
@@ -82,8 +82,7 @@ class product_product(osv.osv):
help='The number of days before a production lot starts deteriorating without becoming dangerous.'),
'removal_time': fields.integer('Product Removal Time',
help='The number of days before a production lot should be removed.'),
- 'alert_time': fields.integer('Product Alert Time', help="The number of days after which, needs an alert to notify about the production lot."),
+ 'alert_time': fields.integer('Product Alert Time', help="The number of days after which an alert should be notified about the production lot."),
}
product_product()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/product_visible_discount/product_visible_discount.py b/addons/product_visible_discount/product_visible_discount.py
index 9fd331e1792..cab071c34f2 100644
--- a/addons/product_visible_discount/product_visible_discount.py
+++ b/addons/product_visible_discount/product_visible_discount.py
@@ -43,7 +43,7 @@ class sale_order_line(osv.osv):
uom=False, qty_uos=0, uos=False, name='', partner_id=False,
lang=False, update_tax=True,date_order=False,packaging=False,fiscal_position=False, flag=False):
- def get_real_price(res_dict, product_id, pricelist):
+ def get_real_price(res_dict, product_id, qty, uom, pricelist):
item_obj = self.pool.get('product.pricelist.item')
price_type_obj = self.pool.get('product.price.type')
product_obj = self.pool.get('product.product')
@@ -56,10 +56,17 @@ class sale_order_line(osv.osv):
if item_base > 0:
field_name = price_type_obj.browse(cr, uid, item_base).field
- product_tmpl_id = product_obj.browse(cr, uid, product_id, context).product_tmpl_id.id
+ product = product_obj.browse(cr, uid, product_id, context)
+ product_tmpl_id = product.product_tmpl_id.id
product_read = template_obj.read(cr, uid, product_tmpl_id, [field_name], context)
- return product_read[field_name]
+
+ factor = 1.0
+ if uom and uom != product.uom_id.id:
+ product_uom_obj = self.pool.get('product.uom')
+ uom_data = product_uom_obj.browse(cr, uid, product.uom_id.id)
+ factor = uom_data.factor
+ return product_read[field_name] * factor
res=super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty,
@@ -84,7 +91,7 @@ class sale_order_line(osv.osv):
pricelists = pricelist_obj.read(cr,uid,[pricelist],['visible_discount'])
old_uom = product.uos_id or product.uom_id
- new_list_price = get_real_price(list_price, product.id, pricelist)
+ new_list_price = get_real_price(list_price, product.id, qty, uom, pricelist)
if(len(pricelists)>0 and pricelists[0]['visible_discount'] and list_price[pricelist] != 0):
discount = (new_list_price - price) / new_list_price * 100
result['price_unit'] = new_list_price
@@ -101,7 +108,7 @@ class account_invoice_line(osv.osv):
def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, fposition_id=False, price_unit=False, address_invoice_id=False, currency_id=False, context={}):
res = super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, fposition_id, price_unit, address_invoice_id, currency_id, context)
- def get_real_price(res_dict, product_id, pricelist):
+ def get_real_price(res_dict, product_id, qty, uom, pricelist):
item_obj = self.pool.get('product.pricelist.item')
price_type_obj = self.pool.get('product.price.type')
product_obj = self.pool.get('product.product')
@@ -114,10 +121,17 @@ class account_invoice_line(osv.osv):
if item_base > 0:
field_name = price_type_obj.browse(cr, uid, item_base).field
- product_tmpl_id = product_obj.browse(cr, uid, product_id, context).product_tmpl_id.id
+ product = product_obj.browse(cr, uid, product_id, context)
+ product_tmpl_id = product.product_tmpl_id.id
product_read = template_obj.read(cr, uid, product_tmpl_id, [field_name], context)
- return product_read[field_name]
+
+ factor = 1.0
+ if uom and uom != product.uom_id.id:
+ product_uom_obj = self.pool.get('product.uom')
+ uom_data = product_uom_obj.browse(cr, uid, product.uom_id.id)
+ factor = uom_data.factor
+ return product_read[field_name] * factor
if product:
pricelist_obj = self.pool.get('product.pricelist')
@@ -133,7 +147,7 @@ class account_invoice_line(osv.osv):
raise osv.except_osv(_('No Purchase Pricelist Found !'),_("You must first define a pricelist for Supplier !"))
price_unit_res = pricelist_obj.price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom})[pricelist]
price_unit = price_unit_res[pricelist]
- real_price = get_real_price(price_unit_res, product.id, pricelist)
+ real_price = get_real_price(price_unit_res, product.id, qty, uom, pricelist)
else:
if partner_id:
pricelist = partner_obj.browse(cr, uid, partner_id).property_product_pricelist.id
@@ -142,7 +156,7 @@ class account_invoice_line(osv.osv):
price_unit_res = pricelist_obj.price_get(cr, uid, [pricelist], product.id, qty or 1.0, partner_id, {'uom': uom})
price_unit = price_unit_res[pricelist]
- real_price = get_real_price(price_unit_res, product.id, pricelist)
+ real_price = get_real_price(price_unit_res, product.id, qty, uom, pricelist)
if pricelist:
pricelists=pricelist_obj.read(cr,uid,[pricelist],['visible_discount'])
if(len(pricelists)>0 and pricelists[0]['visible_discount'] and real_price != 0):
diff --git a/addons/project/project.py b/addons/project/project.py
index 2e034872d1f..7aa94fba079 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -86,7 +86,7 @@ class project(osv.osv):
cr.execute('''SELECT
project_id, sum(planned_hours), sum(total_hours), sum(effective_hours), SUM(remaining_hours)
FROM
- project_task
+ project_task
WHERE
project_id in %s AND
state<>'cancelled'
@@ -476,7 +476,7 @@ class task(osv.osv):
return True
_constraints = [
- (_check_recursion, _('Error ! You cannot create recursive tasks.'), ['parent_ids'])
+ (_check_recursion, 'Error ! You cannot create recursive tasks.', ['parent_ids'])
]
#
# Override view according to the company definition
diff --git a/addons/project/project_demo.xml b/addons/project/project_demo.xml
index b0cfc8c716b..98efff361b3 100644
--- a/addons/project/project_demo.xml
+++ b/addons/project/project_demo.xml
@@ -4,7 +4,7 @@
-
+
diff --git a/addons/purchase/board_purchase_view.xml b/addons/purchase/board_purchase_view.xml
index c4f8d447a21..26743e413ef 100644
--- a/addons/purchase/board_purchase_view.xml
+++ b/addons/purchase/board_purchase_view.xml
@@ -131,7 +131,6 @@
-
-
+
-
-
+
+
-
+
-
-
+
+
diff --git a/addons/purchase/security/ir.model.access.csv b/addons/purchase/security/ir.model.access.csv
index ef854f8f038..693452d4e09 100644
--- a/addons/purchase/security/ir.model.access.csv
+++ b/addons/purchase/security/ir.model.access.csv
@@ -7,8 +7,8 @@
"access_stock_warehouse_purchase_user","stock.warehouse","stock.model_stock_warehouse","group_purchase_user",1,0,0,0
"access_stock_picking_purchase_user","stock.picking","stock.model_stock_picking","group_purchase_user",1,1,1,1
"access_stock_move_purchase_user","stock.move","stock.model_stock_move","group_purchase_user",1,1,1,1
-"access_purchase_order_stock_worker","purchase.order","model_purchase_order","stock.group_stock_user",1,0,0,0
-"access_purchase_order_line_stock_worker","purchase.order.line","model_purchase_order_line","stock.group_stock_user",1,0,0,0
+"access_purchase_order_stock_worker","purchase.order","model_purchase_order","stock.group_stock_user",1,1,1,0
+"access_purchase_order_line_stock_worker","purchase.order.line","model_purchase_order_line","stock.group_stock_user",1,0,1,0
"access_account_tax_purchase_user","account.tax","account.model_account_tax","group_purchase_user",1,0,0,0
"access_report_purchase_order","purchase.report","model_purchase_report","group_purchase_manager",1,1,1,1
"access_report_purchase_order_user","purchase.report user","model_purchase_report","group_purchase_user",1,0,0,0
@@ -42,3 +42,5 @@
"access_account_move_reconcile","account.move.reconcile","account.model_account_move_reconcile","group_purchase_user",1,1,1,1
"access_report_stock_move","report.stock.move.manager","stock.model_report_stock_move","group_purchase_manager",1,1,1,1
"access_report_stock_move_user","report.stock.move.user","stock.model_report_stock_move","group_purchase_user",1,0,0,0
+"access_stock_production_lot_user","stock.production.lot user","stock.model_stock_production_lot","group_purchase_user",1,0,1,0
+"access_stock_production_lot_revision","stock.production.lot.revision","stock.model_stock_production_lot_revision","group_purchase_user",1,0,1,0
diff --git a/addons/purchase/security/purchase_security.xml b/addons/purchase/security/purchase_security.xml
index 1848e9a7c61..e1149c91466 100644
--- a/addons/purchase/security/purchase_security.xml
+++ b/addons/purchase/security/purchase_security.xml
@@ -9,7 +9,6 @@
Purchase / User
-
Purchase Order multi-company
diff --git a/addons/purchase/stock.py b/addons/purchase/stock.py
index ea9cacd7979..987c76e372d 100644
--- a/addons/purchase/stock.py
+++ b/addons/purchase/stock.py
@@ -37,7 +37,7 @@ class stock_move(osv.osv):
"""
reference_amount, reference_currency_id = super(stock_move, self)._get_reference_accounting_values_for_valuation(cr, uid, move, context=context)
if move.product_id.cost_method != 'average' or not move.price_unit:
- # no average price costing or cost not specified during picking validation, we will
+ # no average price costing or cost not specified during picking validation, we will
# plug the purchase line values if they are found.
if move.purchase_line_id and move.picking_id.purchase_id.pricelist_id:
reference_amount, reference_currency_id = move.purchase_line_id.price_unit, move.picking_id.purchase_id.pricelist_id.currency_id.id
@@ -123,6 +123,8 @@ class stock_partial_picking(osv.osv_memory):
for pick in pick_obj.browse(cr, uid, context.get('active_ids', [])):
has_product_cost = (pick.type == 'in' and pick.purchase_id)
for m in pick.move_lines:
+ if m.state in ('done','cancel') :
+ continue
if has_product_cost and m.product_id.cost_method == 'average' and m.purchase_line_id:
# We use the original PO unit purchase price as the basis for the cost, expressed
# in the currency of the PO (i.e the PO's pricelist currency)
diff --git a/addons/purchase/test/purchase_from_manual.yml b/addons/purchase/test/purchase_from_manual.yml
index 0c406635b85..6b95748bc4d 100644
--- a/addons/purchase/test/purchase_from_manual.yml
+++ b/addons/purchase/test/purchase_from_manual.yml
@@ -21,17 +21,16 @@
warranty: 0.0
weight: 0.0
weight_net: 0.0
--
+-
In order to test the purchase flow,I create a new record where "invoice_method" is From Manual
-
I create purchase order for iPod.
--
+-
!record {model: purchase.order, id: purchase_order_po1}:
company_id: base.main_company
date_order: '2010-05-11'
invoice_method: manual
location_id: stock.stock_location_stock
- name: PO00010
order_line:
- date_planned: '2010-05-13'
name: iPod
@@ -47,16 +46,16 @@
Initially purchase order is in the draft state
-
!assert {model: purchase.order, id: purchase_order_po1}:
- - state == 'draft'
+ - state == 'draft'
-
I confirm the purchase order.
-
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po1}
--
+-
I check that the order which was initially in the draft state has transit to confirm state.
-
!assert {model: purchase.order, id: purchase_order_po1}:
- - state == 'approved'
+ - state == 'approved'
-
I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line
-
@@ -68,7 +67,7 @@
assert search_ids, _('Purchase order line is not created!')
-
To check that wizard "Create Invoices" gets opened
--
+-
I create purchase order line invoice entry.
-
!record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}:
@@ -77,7 +76,7 @@
I create invoice for products in the purchase order.
-
!python {model: purchase.order.line_invoice}: |
- pur_obj=self.pool.get('purchase.order')
+ pur_obj=self.pool.get('purchase.order')
ids = []
pur_id1=pur_obj.browse(cr, uid, ref("purchase_order_po1"))
for line in pur_id1.order_line:
@@ -99,13 +98,13 @@
from tools.translate import _
pur_id1=self.browse(cr, uid, ref("purchase_order_po1"))
account_obj = self.pool.get('account.invoice')
- ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)])
+ ids = account_obj.search(cr, uid, [('origin', '=', 'PO-'+str(pur_id1.id))])
assert ids, _('Pending Invoice is not created!')
-
I check that the order which was initially in the confirmed state has transit to approved state.
-
!assert {model: purchase.order, id: purchase_order_po1}:
- - state == 'approved'
+ - state == 'approved'
-
I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved.
-
diff --git a/addons/purchase/test/purchase_from_picking.yml b/addons/purchase/test/purchase_from_picking.yml
index 20dd3f0f907..e68668f408d 100644
--- a/addons/purchase/test/purchase_from_picking.yml
+++ b/addons/purchase/test/purchase_from_picking.yml
@@ -21,17 +21,16 @@
warranty: 0.0
weight: 0.0
weight_net: 0.0
--
+-
In order to test the purchase flow,I create a new record where "invoice_method" is From Picking
-
I create purchase order for iPod.
--
+-
!record {model: purchase.order, id: purchase_order_po2}:
company_id: base.main_company
date_order: '2010-05-11'
invoice_method: picking
location_id: stock.stock_location_stock
- name: PO00008
order_line:
- date_planned: '2010-05-13'
name: iPod
@@ -47,16 +46,16 @@
Initially purchase order is in the draft state.
-
!assert {model: purchase.order, id: purchase_order_po2}:
- - state == 'draft'
+ - state == 'draft'
-
I confirm the purchase order for iPod.
-
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po2}
--
+-
I check that the order which was initially in the draft state has transit to confirm state.
-
!assert {model: purchase.order, id: purchase_order_po2}:
- - state == 'approved'
+ - state == 'approved'
-
I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line.
-
@@ -68,7 +67,7 @@
assert search_ids, _('Purchase order line is not created!')
-
To check that wizard "Create Invoices" gets opened.
--
+-
I create purchase order line invoice entry.
-
!record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}:
@@ -77,7 +76,7 @@
I create invoice for products in the purchase order.
-
!python {model: purchase.order.line_invoice}: |
- pur_obj=self.pool.get('purchase.order')
+ pur_obj=self.pool.get('purchase.order')
ids = []
pur_id1=pur_obj.browse(cr, uid, ref("purchase_order_po2"))
for line in pur_id1.order_line:
@@ -99,21 +98,21 @@
from tools.translate import _
pur_id1=self.browse(cr, uid, ref("purchase_order_po2"))
account_obj = self.pool.get('account.invoice')
- ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)])
+ ids = account_obj.search(cr, uid, [('origin', '=', 'PO-'+str(pur_id1.id))])
assert ids, _('Pending Invoice is not created!')
-
I check that the order which was initially in the confirmed state has transit to approved state.
-
!assert {model: purchase.order, id: purchase_order_po2}:
- - state == 'approved'
+ - state == 'approved'
-
- I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved.
+ I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved.
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po2"))
assert(pur_id.date_approve)
-
- I check that an entry gets created in the stock.picking.
+ I check that an entry gets created in the stock.picking.
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po2"))
@@ -130,15 +129,15 @@
search_id = move_obj.search(cr, uid, [('picking_id', '=', pick_id.name)])
assert search_id, 'No Incoming Product!'
-
- Then I create an invoice from picking by clicking on "Create Invoice" wizard
--
+ Then I create an invoice from picking by clicking on "Create Invoice" wizard
+-
!python {model: stock.invoice.onshipping}: |
pur_obj=self.pool.get('purchase.order')
pur_id1=pur_obj.browse(cr, uid, ref("purchase_order_po2"))
pick_ids = [x.id for x in pur_id1.picking_ids]
id = self.create(cr, uid, {'invoice_date': '2010-05-11', 'journal_id': ref('account.expenses_journal')},
{'active_ids': pick_ids})
- self.create_invoice(cr, uid, [id], {"active_ids": pick_ids})
+ self.create_invoice(cr, uid, [id], {"active_ids": pick_ids, "active_id": pick_ids[0]})
-
I check that an invoice_id field of Delivery&Invoices gets bind with the value.
-
diff --git a/addons/purchase_requisition/i18n/purchase_requisition.pot b/addons/purchase_requisition/i18n/purchase_requisition.pot
index 7df8f5f0fdb..be8a7ddf2b2 100644
--- a/addons/purchase_requisition/i18n/purchase_requisition.pot
+++ b/addons/purchase_requisition/i18n/purchase_requisition.pot
@@ -398,3 +398,14 @@ msgstr ""
msgid "Purchase Orders"
msgstr ""
+#. module: purchase_requisition
+#: code:addons/purchase_requisition/wizard/purchase_requisition_partner.py:0
+#, python-format
+msgid "Error!"
+msgstr ""
+
+#. module: purchase_requisition
+#: code:addons/purchase_requisition/wizard/purchase_requisition_partner.py:0
+#, python-format
+msgid "No Product in Tender"
+msgstr ""
diff --git a/addons/purchase_requisition/purchase_requisition_demo.xml b/addons/purchase_requisition/purchase_requisition_demo.xml
index ff9bba7c700..225137416bf 100644
--- a/addons/purchase_requisition/purchase_requisition_demo.xml
+++ b/addons/purchase_requisition/purchase_requisition_demo.xml
@@ -1,27 +1,30 @@
-
+
+
+
+
+
-
+
TE0001
multiple
2010/09/16 15:56:14
-
+
-
+
-
+
-
+
5
-
-
+
+
-
\ No newline at end of file
diff --git a/addons/purchase_requisition/security/ir.model.access.csv b/addons/purchase_requisition/security/ir.model.access.csv
index d3c6b66de92..4e14688ecc5 100644
--- a/addons/purchase_requisition/security/ir.model.access.csv
+++ b/addons/purchase_requisition/security/ir.model.access.csv
@@ -3,3 +3,5 @@
"access_purchase_requisition_line","purchase.requisition.line","model_purchase_requisition_line","purchase.group_purchase_user",1,1,1,1
"access_purchase_requisition_manager","purchase.requisition manager","model_purchase_requisition","purchase.group_purchase_manager",1,0,0,0
"access_purchase_requisition_line_manager","purchase.requisition.line manager","model_purchase_requisition_line","purchase.group_purchase_manager",1,0,0,0
+"access_purchase_requisition","purchase.requisition","model_purchase_requisition","stock.group_stock_manager",1,0,1,0
+"access_purchase_requisition_line","purchase.requisition.line","model_purchase_requisition_line","stock.group_stock_manager",1,0,1,0
diff --git a/addons/purchase_requisition/security/purchase_tender.xml b/addons/purchase_requisition/security/purchase_tender.xml
index 9ccab8fdbb9..595b71008ef 100644
--- a/addons/purchase_requisition/security/purchase_tender.xml
+++ b/addons/purchase_requisition/security/purchase_tender.xml
@@ -5,6 +5,7 @@
Purchase Requisition / Manager
+
Purchase Requisition / User
diff --git a/addons/purchase_requisition/wizard/purchase_requisition_partner.py b/addons/purchase_requisition/wizard/purchase_requisition_partner.py
index ad2478cb7a5..a5a291b545d 100644
--- a/addons/purchase_requisition/wizard/purchase_requisition_partner.py
+++ b/addons/purchase_requisition/wizard/purchase_requisition_partner.py
@@ -24,6 +24,7 @@ from datetime import datetime
from dateutil.relativedelta import relativedelta
from osv import fields, osv
from osv.orm import browse_record, browse_null
+from tools.translate import _
class purchase_requisition_partner(osv.osv_memory):
_name = "purchase.requisition.partner"
@@ -38,7 +39,7 @@ class purchase_requisition_partner(osv.osv_memory):
record_id = context and context.get('active_id', False) or False
tender = self.pool.get('purchase.requisition').browse(cr, uid, record_id)
if not tender.line_ids:
- raise osv.except_osv('Error!','No Product in Tender')
+ raise osv.except_osv(_('Error!'), _('No Product in Tender'))
True
def onchange_partner_id(self, cr, uid, ids, partner_id):
diff --git a/addons/sale/i18n/ar.po b/addons/sale/i18n/ar.po
index de033e1a379..c61b42d7501 100644
--- a/addons/sale/i18n/ar.po
+++ b/addons/sale/i18n/ar.po
@@ -1453,7 +1453,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
diff --git a/addons/sale/i18n/bg.po b/addons/sale/i18n/bg.po
index 469e72f6b8e..cf82dd2f508 100644
--- a/addons/sale/i18n/bg.po
+++ b/addons/sale/i18n/bg.po
@@ -1460,7 +1460,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2114,7 +2114,7 @@ msgstr "Фактура базирана на доставки"
#~ msgid "My sales in shipping exception"
#~ msgstr "Моите продажби с грешка при доставка"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Конфигуриране на реда на доставка при продажба"
#~ msgid "Sales Configuration"
diff --git a/addons/sale/i18n/bs.po b/addons/sale/i18n/bs.po
index c65a9e3e0cd..c121e6dfc39 100644
--- a/addons/sale/i18n/bs.po
+++ b/addons/sale/i18n/bs.po
@@ -1457,7 +1457,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2215,7 +2215,7 @@ msgstr "Račun sa referencom na isporuku"
#~ "Ovaj korak pri konfiguraciji se koristi da bi se definisalo podrazumjevanje "
#~ "opcija izbora u toku kreiranja naloga za prodaju"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Konfigurisanje logistike prodajnog naloga"
#~ msgid "Sales Configuration"
diff --git a/addons/sale/i18n/ca.po b/addons/sale/i18n/ca.po
index 497996e82ba..1303d15c48e 100644
--- a/addons/sale/i18n/ca.po
+++ b/addons/sale/i18n/ca.po
@@ -1465,7 +1465,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2038,7 +2038,7 @@ msgstr "Factura des d'albarans"
#~ msgid "Manual in progress"
#~ msgstr "Manual en procés"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Configureu la logística de les comandes de venda"
#~ msgid "You invoice has been successfully created !"
diff --git a/addons/sale/i18n/cs.po b/addons/sale/i18n/cs.po
index 47f616f52da..c84a67d748b 100644
--- a/addons/sale/i18n/cs.po
+++ b/addons/sale/i18n/cs.po
@@ -1453,7 +1453,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
diff --git a/addons/sale/i18n/de.po b/addons/sale/i18n/de.po
index c6c50f09d2c..8609d87781f 100644
--- a/addons/sale/i18n/de.po
+++ b/addons/sale/i18n/de.po
@@ -1559,7 +1559,8 @@ msgstr "Verkäufe nach Verkäufer"
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+
+msgid "Logistics"
msgstr "Logistik"
#. module: sale
@@ -2340,7 +2341,7 @@ msgstr "Rechnung durch Lieferung"
#~ msgid "Sale Procurement"
#~ msgstr "Auftragsbezogene Beschaffung"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Konfiguriere Packliste für Auftrag"
#~ msgid "Status"
diff --git a/addons/sale/i18n/el.po b/addons/sale/i18n/el.po
index 1d25e64630d..5c2c3eae3e2 100644
--- a/addons/sale/i18n/el.po
+++ b/addons/sale/i18n/el.po
@@ -1502,7 +1502,7 @@ msgstr "Πωλήσεις ανά Πωλητή"
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2422,8 +2422,8 @@ msgstr "Τιμολόγηση Βασισμένη Σε Παραδόσεις"
#~ "'Waiting Schedule' state is set when the invoice is confirmed but waiting "
#~ "for the scheduler to be on the date 'Date Ordered'."
-#~ msgid "Configure Sale Order Logistic"
-#~ msgstr "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
+#~ msgstr "Configure Sale Order Logistics"
#, python-format
#~ msgid ""
diff --git a/addons/sale/i18n/es.po b/addons/sale/i18n/es.po
index d5c73a6b071..73d93b81e6a 100644
--- a/addons/sale/i18n/es.po
+++ b/addons/sale/i18n/es.po
@@ -2200,7 +2200,7 @@ msgstr "Facturar desde albaranes"
#~ msgid "In progress"
#~ msgstr "En progreso"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Configurar la logística de los pedidos de venta"
#~ msgid "Recreate Procurement"
diff --git a/addons/sale/i18n/es_AR.po b/addons/sale/i18n/es_AR.po
index 0c847f65824..9bb7c8b758c 100644
--- a/addons/sale/i18n/es_AR.po
+++ b/addons/sale/i18n/es_AR.po
@@ -1462,7 +1462,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2190,7 +2190,7 @@ msgstr "Facturar desde órdenes de entrega"
#~ msgid "Status"
#~ msgstr "Estado"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Configurar logística de orden de venta"
#~ msgid "Create Advance Invoice"
diff --git a/addons/sale/i18n/et.po b/addons/sale/i18n/et.po
index 771d2773c54..fe91c762189 100644
--- a/addons/sale/i18n/et.po
+++ b/addons/sale/i18n/et.po
@@ -1485,7 +1485,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2154,7 +2154,7 @@ msgstr "Arve kohaletoimetamiste põhjal"
#~ msgstr ""
#~ "Müügikorraldusel hankimine igale reale ja see muutub hankekorralduseks."
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Seadista müügikorralduse logistika"
#~ msgid "Packing Policy"
diff --git a/addons/sale/i18n/fi.po b/addons/sale/i18n/fi.po
index d5867287896..d2c463e1d6c 100644
--- a/addons/sale/i18n/fi.po
+++ b/addons/sale/i18n/fi.po
@@ -1460,7 +1460,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2224,7 +2224,7 @@ msgstr "Lasku perustuen toimitettuihin"
#~ msgid "Packing Policy"
#~ msgstr "Pakkauskäytäntö"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Myyntitilauksien logistiikan asetukset"
#~ msgid "One procurement for each product."
diff --git a/addons/sale/i18n/fr.po b/addons/sale/i18n/fr.po
index 6fff9c6361c..49d7167ef9c 100644
--- a/addons/sale/i18n/fr.po
+++ b/addons/sale/i18n/fr.po
@@ -1518,7 +1518,7 @@ msgstr "Ventes par vendeur"
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr "Logistique"
#. module: sale
@@ -2160,7 +2160,7 @@ msgstr "Facture basé sur les livraisons"
#~ msgid "Sale Procurement"
#~ msgstr "Approvisionnement des ventes"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Configurer la logistique des commandes de ventes"
#~ msgid "Sale Order Procurement"
diff --git a/addons/sale/i18n/hr.po b/addons/sale/i18n/hr.po
index 6a521c55975..a0e3c69fba7 100644
--- a/addons/sale/i18n/hr.po
+++ b/addons/sale/i18n/hr.po
@@ -1458,7 +1458,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2174,7 +2174,7 @@ msgstr "Račun na temelju dostava"
#~ msgid "Sale Procurement"
#~ msgstr "Pribavljanje za Prodaju"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Konfiguriraj logistiku Prodajne Narudžbe"
#~ msgid "Status"
diff --git a/addons/sale/i18n/hu.po b/addons/sale/i18n/hu.po
index 2c3b328219c..7f2bca798d8 100644
--- a/addons/sale/i18n/hu.po
+++ b/addons/sale/i18n/hu.po
@@ -1453,7 +1453,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
diff --git a/addons/sale/i18n/id.po b/addons/sale/i18n/id.po
index eb66cb0bf91..db2832bdd81 100644
--- a/addons/sale/i18n/id.po
+++ b/addons/sale/i18n/id.po
@@ -1458,7 +1458,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
diff --git a/addons/sale/i18n/it.po b/addons/sale/i18n/it.po
index 51cad856b37..d573d68187f 100644
--- a/addons/sale/i18n/it.po
+++ b/addons/sale/i18n/it.po
@@ -1494,7 +1494,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2213,7 +2213,7 @@ msgstr "Fattura basata su Consegne"
#~ msgid "Sale Procurement"
#~ msgstr "Vendita appalti"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Configura la logistica di ordine di vendita"
#~ msgid "Status"
diff --git a/addons/sale/i18n/ko.po b/addons/sale/i18n/ko.po
index daa426d1cf4..37bd9b4d242 100644
--- a/addons/sale/i18n/ko.po
+++ b/addons/sale/i18n/ko.po
@@ -1454,7 +1454,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2206,7 +2206,7 @@ msgstr "베송에 기초한 인보이스"
#~ "order"
#~ msgstr "판매 주문 작성 시, 디폴트 피킹 정책을 설정하는 구성 과정"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "판매 주문 물류 구성"
#~ msgid "Quantity (UOS)"
diff --git a/addons/sale/i18n/lt.po b/addons/sale/i18n/lt.po
index 35180aaeb1d..a044f016e62 100644
--- a/addons/sale/i18n/lt.po
+++ b/addons/sale/i18n/lt.po
@@ -1461,7 +1461,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2235,7 +2235,7 @@ msgstr "Sąskaita faktūra iš pristatymo užsakymo"
#~ msgid "Sale Procurement"
#~ msgstr "Planiniai užsakymai"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Konfigūruoti pardavimo užsakymo logistiką"
#~ msgid "Packing Policy"
diff --git a/addons/sale/i18n/lv.po b/addons/sale/i18n/lv.po
index b72e429313d..e92aa05e425 100644
--- a/addons/sale/i18n/lv.po
+++ b/addons/sale/i18n/lv.po
@@ -1454,7 +1454,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
diff --git a/addons/sale/i18n/nl.po b/addons/sale/i18n/nl.po
index da7086887fc..32539b346d8 100644
--- a/addons/sale/i18n/nl.po
+++ b/addons/sale/i18n/nl.po
@@ -1458,7 +1458,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2160,7 +2160,7 @@ msgstr "Facturatie gebaseer op leveringen"
#~ msgid "Sale Procurement"
#~ msgstr "Uitlevering verkoop"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Stel verkooplogistiek in"
#~ msgid "Status"
diff --git a/addons/sale/i18n/nl_BE.po b/addons/sale/i18n/nl_BE.po
index d609b1b857e..6ed2db9718e 100644
--- a/addons/sale/i18n/nl_BE.po
+++ b/addons/sale/i18n/nl_BE.po
@@ -699,7 +699,7 @@ msgstr ""
#. module: sale
#: view:sale.config.picking_policy:0
-msgid "Configure Sale Order Logistic"
+msgid "Configure Sale Order Logistics"
msgstr ""
#. module: sale
diff --git a/addons/sale/i18n/pl.po b/addons/sale/i18n/pl.po
index 68e389e9634..61ada27b0be 100644
--- a/addons/sale/i18n/pl.po
+++ b/addons/sale/i18n/pl.po
@@ -1528,7 +1528,7 @@ msgstr "Sprzedaż wg sprzedawców"
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr "Logistyka"
#. module: sale
@@ -2206,7 +2206,7 @@ msgstr "Faktura wg dostaw"
#~ msgid "Sales Process"
#~ msgstr "Proces sprzedaży"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Konfiguruj ligistykę zamówienia sprzedaży"
#~ msgid "One procurement for each product."
diff --git a/addons/sale/i18n/pt.po b/addons/sale/i18n/pt.po
index 8f1f7b132f8..2d6e3d27de6 100644
--- a/addons/sale/i18n/pt.po
+++ b/addons/sale/i18n/pt.po
@@ -1457,7 +1457,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2208,7 +2208,7 @@ msgstr "Facturar com base na expedição"
#~ msgid "Procurement for each line"
#~ msgstr "Aprovisionamento para cada linha"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Configurar a logística da ordem de venda"
#~ msgid "Sales Configuration"
diff --git a/addons/sale/i18n/pt_BR.po b/addons/sale/i18n/pt_BR.po
index 09d11af73ce..d1132d4c1c9 100644
--- a/addons/sale/i18n/pt_BR.po
+++ b/addons/sale/i18n/pt_BR.po
@@ -1566,7 +1566,7 @@ msgstr "Vendas por Representante"
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr "Logistica"
#. module: sale
diff --git a/addons/sale/i18n/ro.po b/addons/sale/i18n/ro.po
index 755529d8146..dd68a487a4e 100644
--- a/addons/sale/i18n/ro.po
+++ b/addons/sale/i18n/ro.po
@@ -1453,7 +1453,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
diff --git a/addons/sale/i18n/ru.po b/addons/sale/i18n/ru.po
index 46b68f13499..1873236086a 100644
--- a/addons/sale/i18n/ru.po
+++ b/addons/sale/i18n/ru.po
@@ -1528,7 +1528,7 @@ msgstr "Продажи по менеджеру продаж"
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr "Логистика"
#. module: sale
diff --git a/addons/sale/i18n/sale.pot b/addons/sale/i18n/sale.pot
index 785e86fbeed..141edcbba48 100644
--- a/addons/sale/i18n/sale.pot
+++ b/addons/sale/i18n/sale.pot
@@ -1406,7 +1406,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
diff --git a/addons/sale/i18n/sk.po b/addons/sale/i18n/sk.po
index 759f08e932a..6d460268901 100644
--- a/addons/sale/i18n/sk.po
+++ b/addons/sale/i18n/sk.po
@@ -1454,7 +1454,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
diff --git a/addons/sale/i18n/sl.po b/addons/sale/i18n/sl.po
index 15f81f76eee..e93421dc470 100644
--- a/addons/sale/i18n/sl.po
+++ b/addons/sale/i18n/sl.po
@@ -1454,7 +1454,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
diff --git a/addons/sale/i18n/sq.po b/addons/sale/i18n/sq.po
index a677946c53e..1e67a58edfe 100644
--- a/addons/sale/i18n/sq.po
+++ b/addons/sale/i18n/sq.po
@@ -1454,7 +1454,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
diff --git a/addons/sale/i18n/sr.po b/addons/sale/i18n/sr.po
index 8a1463fb750..d20dfd8cc29 100644
--- a/addons/sale/i18n/sr.po
+++ b/addons/sale/i18n/sr.po
@@ -2303,7 +2303,7 @@ msgstr "Račun na osnovu isporuke"
#~ msgid "Sales Configuration"
#~ msgstr "Konfiguracija prodaje"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Konfigurisanje logistike naloga za prodaju"
#~ msgid "Status"
diff --git a/addons/sale/i18n/sv.po b/addons/sale/i18n/sv.po
index deec9719884..e88cf5d02e3 100644
--- a/addons/sale/i18n/sv.po
+++ b/addons/sale/i18n/sv.po
@@ -1492,7 +1492,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2250,7 +2250,7 @@ msgstr "Fakturera utgående ifrån leveranser"
#~ msgid "Procurement Corrected"
#~ msgstr "Anskaffning justeras"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Konfigurera kundorder logistik"
#~ msgid "Sale Procurement"
diff --git a/addons/sale/i18n/tlh.po b/addons/sale/i18n/tlh.po
index 91409bfe880..0917dc6147f 100644
--- a/addons/sale/i18n/tlh.po
+++ b/addons/sale/i18n/tlh.po
@@ -1453,7 +1453,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
diff --git a/addons/sale/i18n/tr.po b/addons/sale/i18n/tr.po
index 0f19f853131..a4aad4e217b 100644
--- a/addons/sale/i18n/tr.po
+++ b/addons/sale/i18n/tr.po
@@ -1455,7 +1455,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2119,7 +2119,7 @@ msgstr "Teslimatlara Bağlı Fatura"
#~ msgid "Sale Procurement"
#~ msgstr "Satış Satınalması"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "Satış Sipariş Lojistiğini Ayarla"
#~ msgid "Status"
diff --git a/addons/sale/i18n/uk.po b/addons/sale/i18n/uk.po
index 4c3f124421e..1ae4fb3fd2a 100644
--- a/addons/sale/i18n/uk.po
+++ b/addons/sale/i18n/uk.po
@@ -1454,7 +1454,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
diff --git a/addons/sale/i18n/vi.po b/addons/sale/i18n/vi.po
index ad75188e865..e6871765e92 100644
--- a/addons/sale/i18n/vi.po
+++ b/addons/sale/i18n/vi.po
@@ -1494,7 +1494,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
diff --git a/addons/sale/i18n/zh_CN.po b/addons/sale/i18n/zh_CN.po
index 08519599ba4..514c8c3ece9 100644
--- a/addons/sale/i18n/zh_CN.po
+++ b/addons/sale/i18n/zh_CN.po
@@ -1453,7 +1453,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
@@ -2220,7 +2220,7 @@ msgstr "发票基于送货单"
#~ msgid "Sale Procurement"
#~ msgstr "销售产品需求"
-#~ msgid "Configure Sale Order Logistic"
+#~ msgid "Configure Sale Order Logistics"
#~ msgstr "设置销售订单逻辑"
#~ msgid "Packing Policy"
diff --git a/addons/sale/i18n/zh_TW.po b/addons/sale/i18n/zh_TW.po
index 46046d713af..4c600190c3d 100644
--- a/addons/sale/i18n/zh_TW.po
+++ b/addons/sale/i18n/zh_TW.po
@@ -1453,7 +1453,7 @@ msgstr ""
#. module: sale
#: view:sale.order:0
-msgid "Logistic"
+msgid "Logistics"
msgstr ""
#. module: sale
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index 82ec4d68bac..adafd1938fa 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -138,7 +138,7 @@
+ on_change="product_uom_change(parent.pricelist_id,product_id,product_uom_qty,product_uom,product_uos_qty,product_uos,name,parent.partner_id, 'lang' in context and context['lang'], False, parent.date_order)" domain="[('category_id','=', product_id.uom_id.category_id.id)]"/>
-
+
@@ -540,7 +540,7 @@
Sales Application Configuration
- Configure Sales Order Logistic
+ Configure Sales Order Logistics
Setup your sales workflow and default values.
diff --git a/addons/sale/security/ir.model.access.csv b/addons/sale/security/ir.model.access.csv
index 11718051d04..39b1996ee88 100644
--- a/addons/sale/security/ir.model.access.csv
+++ b/addons/sale/security/ir.model.access.csv
@@ -1,5 +1,5 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_sale_shop","sale.shop","model_sale_shop","base.group_user",1,0,0,0
+"access_sale_shop","sale.shop","model_sale_shop","base.group_user",1,1,0,0
"access_sale_order","sale.order","model_sale_order","base.group_sale_salesman",1,1,1,0
"access_sale_order_line","sale.order.line","model_sale_order_line","base.group_sale_salesman",1,1,1,1
"access_account_invoice_tax_salesman","account_invoice_tax salesman","account.model_account_invoice_tax","base.group_sale_salesman",1,1,1,0
diff --git a/addons/sale/stock.py b/addons/sale/stock.py
index f9e0c38494b..2855323c7a0 100644
--- a/addons/sale/stock.py
+++ b/addons/sale/stock.py
@@ -69,6 +69,13 @@ class stock_picking(osv.osv):
def _get_price_unit_invoice(self, cursor, user, move_line, type):
if move_line.sale_line_id and move_line.sale_line_id.product_id.id == move_line.product_id.id:
+ uom_id = move_line.product_id.uom_id.id
+ uos_id = move_line.product_id.uos_id and move_line.product_id.uos_id.id or False
+ price = move_line.sale_line_id.price_unit
+ coeff = move_line.product_id.uos_coeff
+ if uom_id != uos_id and coeff != 0:
+ price_unit = price / coeff
+ return price_unit
return move_line.sale_line_id.price_unit
return super(stock_picking, self)._get_price_unit_invoice(cursor, user, move_line, type)
diff --git a/addons/sale/test/invoice_on_shipped_qty.yml b/addons/sale/test/invoice_on_shipped_qty.yml
index 3ed4387067a..fb217302ce4 100644
--- a/addons/sale/test/invoice_on_shipped_qty.yml
+++ b/addons/sale/test/invoice_on_shipped_qty.yml
@@ -74,7 +74,7 @@
ids = [x.id for x in sale_id.picking_ids]
wiz_id = self.create(cr, uid, {'invoice_date': '2010-07-17', 'journal_id': ref('account.sales_journal')},
{'active_ids': ids})
- self.create_invoice(cr, uid, [wiz_id], {"active_ids": ids})
+ self.create_invoice(cr, uid, [wiz_id], {"active_ids": ids, "active_id": ids[0]})
-
I verify whether the invoice has been generated for SO
-
diff --git a/addons/sale/test/manual_order_policy.yml b/addons/sale/test/manual_order_policy.yml
index 7cb253a2bfb..74fb95b19f7 100644
--- a/addons/sale/test/manual_order_policy.yml
+++ b/addons/sale/test/manual_order_policy.yml
@@ -24,13 +24,13 @@
picking_policy: direct
pricelist_id: product.list0
shop_id: sale.shop
--
+-
I confirm the Sale Order.
--
+-
!workflow {model: sale.order, action: order_confirm, ref: sale_order_so0}
-
I click on Create Invoice button to create the invoice.
--
+-
!workflow {model: sale.order, action: manual_invoice, ref: sale_order_so0}
-
@@ -38,7 +38,7 @@
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so0"))
- assert so.invoice_ids, "Invoices has not been generated for sale_order_so0"
+ assert so.invoice_ids, "Invoices has not been generated for sale_order_so0"
-
I open the Invoice for the SO.
-
@@ -69,7 +69,7 @@
assert inv_brw.move_id, "Journal Entries has not been created"
-
Assign analytic journal into bank journal
--
+-
!record {model: account.journal, id: sale.account_journal_bankjournal0}:
analytic_journal_id: account.cose_journal_sale
-
@@ -85,7 +85,7 @@
ref('account.period_8'), ref('sale.account_journal_bankjournal0'),
name='test')
-
- I verify the invoice is in done state.
+ I verify the invoice is in done state.
-
!python {model: account.invoice}: |
sale_order_obj = self.pool.get('sale.order')
@@ -98,9 +98,9 @@
!python {model: sale.order}: |
sale_id=self.browse(cr, uid, ref("sale_order_so0"))
assert(sale_id.invoiced == True), "Paid has not been set to true"
--
+-
I verify that the picking has been generated for the sale order
--
+-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so0"))
assert so.picking_ids,"Picking has not been generated for sale_order_so0"
@@ -111,7 +111,7 @@
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
picking_id = self.search(cr, uid, [('origin','=',so.name)])
- assert (picking_id),"Delivery order has not been generated"
+ assert(picking_id),"Delivery order has not been generated"
-
I verify that a procurement has been generated for so
-
@@ -120,7 +120,7 @@
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
proc_ids = self.search(cr, uid, [('origin','=',so.name)])
- assert proc_ids, _('No Procurements!')
+ assert(proc_ids),"No Procurements!"
-
Then I click on the "Run Procurement" button
-
@@ -144,7 +144,7 @@
sale_order_obj = self.pool.get('sale.order')
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
proc_ids = self.search(cr, uid, [('origin','=',so.name),('state','=','running')])
- assert proc_ids, _('Procurement is not in the running state!')
+ assert(proc_ids),"Procurement is not in the running state!"
-
I verify that a purchase order has been generated
-
@@ -157,8 +157,8 @@
so = self.browse(cr, uid, ref("sale_order_so0"))
pur_obj=self.pool.get('purchase.order')
pur_id=pur_obj.search(cr, uid, [('origin','=',so.name)])
- assert pur_id, _('Purchase order has not been generated')
-
+ assert(pur_id),"Purchase order has not been generated"
+
-
I click on the "Confirm" button to confirm the purchase order
-
@@ -175,7 +175,7 @@
pur_ids = pur_obj.search(cr, uid, [('origin','=',so.name)])
for pur in pur_ids:
wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_confirm', cr)
--
+-
I click on the "Approved by supplier" button to approve the purchase order
-
!python {model: sale.order}: |
@@ -192,7 +192,7 @@
for pur in pur_ids:
wf_service.trg_validate(uid, 'purchase.order',pur,'purchase_approve', cr)
-
- I verify that a picking related to purchase order has been generated.
+ I verify that a picking related to purchase order has been generated.
-
!python {model: sale.order}: |
modules = self.pool.get('ir.module.module')
@@ -204,7 +204,7 @@
pur_id = pur_obj.search(cr, uid, [('origin','=',so.name)])
po = pur_obj.browse(cr, uid, pur_id)[0]
assert(po.picking_ids),"Picking for purchase order has not been generated"
--
+-
Then I click on the "Products Received" button of Incoming Shipments
-
!record {model: stock.partial.picking, id: stock_partial_picking_0}:
@@ -242,10 +242,10 @@
po = pur_obj.browse(cr, uid, pur_id)[0]
picking_obj = self.pool.get('stock.picking')
ids = picking_obj.search(cr, uid, [('purchase_id', '=', po.id ),('state', '=', 'done')])
- assert ids, _('Picking is not in the done state!')
+ assert(ids),"Picking is not in the done state!"
-
Then I done the picking
--
+-
!python {model: stock.picking }: |
import time
sale_order_obj = self.pool.get('sale.order')
@@ -264,7 +264,7 @@
'product_id': move.product_id.id,
'product_qty': move.product_qty,
'product_uom': move.product_uom.id,
- }
+ }
self.do_partial(cr, uid, [pick.id],partial_datas)
-
I verify that picking for sale order is in done state.
@@ -274,7 +274,7 @@
so = sale_order_obj.browse(cr, uid, ref("sale_order_so0"))
picking_id = self.search(cr, uid, [('origin','=',so.name),('type','=','out')])
pick = self.browse(cr,uid,picking_id[0])
- assert (pick.state) =='done', "Picking for SO is not in done state."
+ assert (pick.state) =='done', "Picking for SO is not in done state."
-
Then I done the delivery order
-
@@ -296,8 +296,8 @@
'product_id': move.product_id.id,
'product_qty': move.product_qty,
'product_uom': move.product_uom.id,
- }
- self.do_partial(cr, uid, [pick.id],partial_datas)
+ }
+ self.do_partial(cr, uid, [pick.id],partial_datas)
-
I verify that delivery state is done
-
@@ -308,7 +308,7 @@
pick = self.browse(cr,uid,picking_id[0])
assert (pick.state) =='done', "Picking for SO is not in done state."
-
- I verify that a "Picked" has been set to true
+ I verify that a "Picked" has been set to true
-
!python {model: sale.order}: |
so = self.browse(cr, uid, ref("sale_order_so0"))
diff --git a/addons/sale/test/picking_order_policy.yml b/addons/sale/test/picking_order_policy.yml
index b12bddd7ecc..de18c1c4426 100644
--- a/addons/sale/test/picking_order_policy.yml
+++ b/addons/sale/test/picking_order_policy.yml
@@ -67,7 +67,7 @@
ids = [x.id for x in sale_id.picking_ids]
wiz_id = self.create(cr, uid, {'invoice_date': '2010-07-15', 'journal_id': ref('account.sales_journal')},
{'active_ids': ids})
- self.create_invoice(cr, uid, [wiz_id], {"active_ids": ids})
+ self.create_invoice(cr, uid, [wiz_id], {"active_ids": ids, "active_id": ids[0]})
-
I check that an invoice has been created.
-
diff --git a/addons/sale_mrp/__openerp__.py b/addons/sale_mrp/__openerp__.py
index a8380dcb370..e9eb4cbba92 100644
--- a/addons/sale_mrp/__openerp__.py
+++ b/addons/sale_mrp/__openerp__.py
@@ -35,6 +35,8 @@
'depends': ['mrp', 'sale'],
'init_xml': [],
'update_xml': [
+ 'security/sale_mrp_security.xml',
+ 'security/ir.model.access.csv',
'sale_mrp_view.xml',
],
'demo_xml': [],
diff --git a/addons/sale_mrp/security/ir.model.access.csv b/addons/sale_mrp/security/ir.model.access.csv
new file mode 100644
index 00000000000..90ff5ac06e2
--- /dev/null
+++ b/addons/sale_mrp/security/ir.model.access.csv
@@ -0,0 +1,3 @@
+"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
+"access_mrp_bom_user","mrp.bom","mrp.model_mrp_bom","base.group_sale_salesman",1,0,0,0
+"access_mrp_bom_manager","mrp.bom","mrp.model_mrp_bom","base.group_sale_manager",1,0,0,0
diff --git a/addons/sale_mrp/security/sale_mrp_security.xml b/addons/sale_mrp/security/sale_mrp_security.xml
new file mode 100644
index 00000000000..c0139329d1e
--- /dev/null
+++ b/addons/sale_mrp/security/sale_mrp_security.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ Sales / Manager
+
+
+
+ Sales / User
+
+
+
+
diff --git a/addons/share/__openerp__.py b/addons/share/__openerp__.py
index 768d24974a5..c7218568b0e 100644
--- a/addons/share/__openerp__.py
+++ b/addons/share/__openerp__.py
@@ -41,6 +41,7 @@
""",
'website': 'http://www.openerp.com',
+ 'demo_xml': ['share_demo.xml'],
'data': [
'security/share_security.xml',
'share_view.xml',
diff --git a/addons/share/security/share_security.xml b/addons/share/security/share_security.xml
index 0b2e8c4c1fd..ea27101fd53 100644
--- a/addons/share/security/share_security.xml
+++ b/addons/share/security/share_security.xml
@@ -4,5 +4,6 @@
Sharing / User
+
diff --git a/addons/share/share_demo.xml b/addons/share/share_demo.xml
new file mode 100644
index 00000000000..139c81d4dd3
--- /dev/null
+++ b/addons/share/share_demo.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/addons/stock/board_warehouse_view.xml b/addons/stock/board_warehouse_view.xml
index b073be73575..a4b0054a124 100644
--- a/addons/stock/board_warehouse_view.xml
+++ b/addons/stock/board_warehouse_view.xml
@@ -13,7 +13,7 @@
form
tree,form
[('state','in',('confirmed','assigned')),'|','&',('picking_id','=',False),('location_id.usage', 'in', ['customer','supplier']),'&',('picking_id','!=',False),('picking_id.type','=','in')]
-
+
@@ -23,7 +23,7 @@
form
tree,form
[('state','in',('confirmed','assigned')),'|','&',('picking_id','=',False),('location_dest_id.usage', 'in', ['customer','supplier']),'&',('picking_id','!=',False),('picking_id.type','=','out')]
-
+
diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot
index d8eb6873725..7d37603ff95 100644
--- a/addons/stock/i18n/stock.pot
+++ b/addons/stock/i18n/stock.pot
@@ -3481,10 +3481,17 @@ msgstr ""
#: code:addons/stock/product.py:0
#: code:addons/stock/stock.py:0
#: code:addons/stock/wizard/stock_splitinto.py:0
+#: code:addons/stock/wizard/stock_fill_inventory.py:0
#, python-format
msgid "Error!"
msgstr ""
+#. module: stock
+#: code:addons/stock/wizard/stock_fill_inventory.py:0
+#, python-format
+msgid "Stock Inventory is done"
+msgstr ""
+
#. module: stock
#: code:addons/stock/stock.py:0
#, python-format
diff --git a/addons/stock/product.py b/addons/stock/product.py
index 615ef20c516..b412d8f9782 100644
--- a/addons/stock/product.py
+++ b/addons/stock/product.py
@@ -188,7 +188,7 @@ class product_product(osv.osv):
if not ids:
return res
- # TODO: write in more ORM way, less queries, more pg84 magic
+ # TODO: write in more ORM way, less queries, more pg84 magic
if context.get('shop', False):
cr.execute('select warehouse_id from sale_shop where id=%s', (int(context['shop']),))
res2 = cr.fetchone()
@@ -241,13 +241,13 @@ class product_product(osv.osv):
where.append(tuple([to_date]))
elif from_date:
date_str = "date>=%s"
- date_values = [from_date]
+ date_values = [from_date]
elif to_date:
date_str = "date<=%s"
date_values = [to_date]
-
- # TODO: perhaps merge in one query.
+
+ # TODO: perhaps merge in one query.
if date_values:
where.append(tuple(date_values))
if 'in' in what:
@@ -280,15 +280,17 @@ class product_product(osv.osv):
uoms = filter(lambda x: x not in uoms_o.keys(), uoms)
if uoms:
uoms = uom_obj.browse(cr, uid, list(set(uoms)), context=context)
- for o in uoms:
- uoms_o[o.id] = o
+ for o in uoms:
+ uoms_o[o.id] = o
+ #TOCHECK: before change uom of product, stock move line are in old uom.
+ context.update({'raise-exception': False})
for amount, prod_id, prod_uom in results:
amount = uom_obj._compute_qty_obj(cr, uid, uoms_o[prod_uom], amount,
- uoms_o[context.get('uom', False) or product2uom[prod_id]])
+ uoms_o[context.get('uom', False) or product2uom[prod_id]], context=context)
res[prod_id] += amount
for amount, prod_id, prod_uom in results2:
amount = uom_obj._compute_qty_obj(cr, uid, uoms_o[prod_uom], amount,
- uoms_o[context.get('uom', False) or product2uom[prod_id]])
+ uoms_o[context.get('uom', False) or product2uom[prod_id]], context=context)
res[prod_id] -= amount
return res
@@ -328,7 +330,7 @@ class product_product(osv.osv):
'track_outgoing': fields.boolean('Track Outgoing Lots', help="Forces to specify a Production Lot for all moves containing this product and going to a Customer Location"),
'location_id': fields.dummy(string='Stock Location', relation='stock.location', type='many2one'),
'valuation':fields.selection([('manual_periodic', 'Periodical (manual)'),
- ('real_time','Real Time (automated)'),], 'Inventory Valuation',
+ ('real_time','Real Time (automated)'),], 'Inventory Valuation',
help="If real-time valuation is enabled for a product, the system will automatically write journal entries corresponding to stock moves." \
"The inventory variation account set on the product category will represent the current inventory value, and the stock input and stock output account will hold the counterpart moves for incoming and outgoing products."
, required=True),
diff --git a/addons/stock/report/report_stock_move.py b/addons/stock/report/report_stock_move.py
index 49c3f8fb327..15e430d0599 100644
--- a/addons/stock/report/report_stock_move.py
+++ b/addons/stock/report/report_stock_move.py
@@ -62,7 +62,7 @@ class report_stock_move(osv.osv):
CREATE OR REPLACE view report_stock_move AS (
SELECT
min(sm_id) as id,
- al.dp as date,
+ date_trunc('day',al.dp) as date,
al.curr_year as year,
al.curr_month as month,
al.curr_day as day,
diff --git a/addons/stock/security/ir.model.access.csv b/addons/stock/security/ir.model.access.csv
index 4d9c44edd79..e1a22e9fb69 100644
--- a/addons/stock/security/ir.model.access.csv
+++ b/addons/stock/security/ir.model.access.csv
@@ -10,11 +10,11 @@
"access_stock_tracking_user","stock.tracking user","model_stock_tracking","stock.group_stock_user",1,1,1,1
"access_stock_tracking_manager","stock.tracking manager","model_stock_tracking","stock.group_stock_manager",1,0,0,0
"access_stock_picking_user","stock.picking user","model_stock_picking","stock.group_stock_user",1,1,1,1
-"access_stock_picking_manager","stock.picking manager","model_stock_picking","stock.group_stock_manager",1,0,0,0
+"access_stock_picking_manager","stock.picking manager","model_stock_picking","stock.group_stock_manager",1,1,0,0
"access_stock_production_lot_manager","stock.production.lot manager","model_stock_production_lot","stock.group_stock_manager",1,0,0,0
"access_stock_production_lot_user","stock.production.lot user","model_stock_production_lot","stock.group_stock_user",1,1,1,1
"access_stock_production_lot_revision","stock.production.lot.revision","model_stock_production_lot_revision","stock.group_stock_user",1,1,1,1
-"access_stock_move_manager","stock.move manager","model_stock_move","stock.group_stock_manager",1,0,0,0
+"access_stock_move_manager","stock.move manager","model_stock_move","stock.group_stock_manager",1,1,0,0
"access_stock_move_user","stock.move user","model_stock_move","stock.group_stock_user",1,1,1,1
"access_stock_inventory_user","stock.inventory user","model_stock_inventory","stock.group_stock_user",1,1,1,1
"access_stock_inventory_manager","stock.inventory manager","model_stock_inventory","stock.group_stock_manager",1,0,0,0
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 6b82c72a5dc..fd0c8597a6e 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -356,7 +356,7 @@ class stock_location(osv.osv):
Attempt to find a quantity ``product_qty`` (in the product's default uom or the uom passed in ``context``) of product ``product_id``
in locations with id ``ids`` and their child locations. If ``lock`` is True, the stock.move lines
of product with id ``product_id`` in the searched location will be write-locked using Postgres's
- "FOR UPDATE NOWAIT" option until the transaction is committed or rolled back, to prevent reservin
+ "FOR UPDATE NOWAIT" option until the transaction is committed or rolled back, to prevent reservin
twice the same products.
If ``lock`` is True and the lock cannot be obtained (because another transaction has locked some of
the same stock.move lines), a log line will be output and False will be returned, as if there was
@@ -501,14 +501,14 @@ class stock_tracking(osv.osv):
def unlink(self, cr, uid, ids, context=None):
raise osv.except_osv(_('Error'), _('You can not remove a lot line !'))
-
+
def action_traceability(self, cr, uid, ids, context={}):
""" It traces the information of a product
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param ids: List of IDs selected
- @param context: A standard dictionary
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
@return: A dictionary of values
"""
value={}
@@ -577,8 +577,8 @@ class stock_picking(osv.osv):
return res
cr.execute("""select
picking_id,
- min(date),
- max(date)
+ min(date_expected),
+ max(date_expected)
from
stock_move
where
@@ -632,11 +632,11 @@ class stock_picking(osv.osv):
'move_lines': fields.one2many('stock.move', 'picking_id', 'Internal Moves', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
'auto_picking': fields.boolean('Auto-Picking'),
'address_id': fields.many2one('res.partner.address', 'Address', help="Address of partner"),
- 'partner_id': fields.related('address_id','partner_id',type='many2one',relation='res.partner',string='Partner'),
+ 'partner_id': fields.related('address_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True),
'invoice_state': fields.selection([
("invoiced", "Invoiced"),
("2binvoiced", "To Be Invoiced"),
- ("none", "Not from Picking")], "Invoice Control",
+ ("none", "Not Applicable")], "Invoice Control",
select=True, required=True, readonly=True, states={'draft': [('readonly', False)]}),
'company_id': fields.many2one('res.company', 'Company', required=True, select=True),
}
@@ -682,7 +682,7 @@ class stock_picking(osv.osv):
picking_obj = self.browse(cr, uid, [res], context)[0]
for move in picking_obj.move_lines:
move_obj.write(cr, uid, [move.id], {'tracking_id': False,'prodlot_id':False})
- return res
+ return res
def onchange_partner_in(self, cr, uid, context=None, partner_id=None):
return {}
@@ -930,6 +930,25 @@ class stock_picking(osv.osv):
'''Call after the creation of the invoice'''
return
+ def _get_invoice_type(self, pick):
+ src_usage = dest_usage = None
+ inv_type = None
+ if pick.invoice_state == '2binvoiced':
+ if pick.move_lines:
+ src_usage = pick.move_lines[0].location_id.usage
+ dest_usage = pick.move_lines[0].location_dest_id.usage
+ if pick.type == 'out' and dest_usage == 'supplier':
+ inv_type = 'in_refund'
+ elif pick.type == 'out' and dest_usage == 'customer':
+ inv_type = 'out_invoice'
+ elif pick.type == 'in' and src_usage == 'supplier':
+ inv_type = 'in_invoice'
+ elif pick.type == 'in' and src_usage == 'customer':
+ inv_type = 'out_refund'
+ else:
+ inv_type = 'out_invoice'
+ return inv_type
+
def action_invoice_create(self, cr, uid, ids, journal_id=False,
group=False, type='out_invoice', context=None):
""" Creates invoice based on the invoice state selected for picking.
@@ -945,7 +964,7 @@ class stock_picking(osv.osv):
invoice_line_obj = self.pool.get('account.invoice.line')
invoices_group = {}
res = {}
-
+ inv_type = type
for picking in self.browse(cr, uid, ids, context=context):
if picking.invoice_state != '2binvoiced':
continue
@@ -955,7 +974,10 @@ class stock_picking(osv.osv):
raise osv.except_osv(_('Error, no partner !'),
_('Please put a partner on the picking list if you want to generate invoice.'))
- if type in ('out_invoice', 'out_refund'):
+ if not inv_type:
+ inv_type = self._get_invoice_type(picking)
+
+ if inv_type in ('out_invoice', 'out_refund'):
account_id = partner.property_account_receivable.id
payment_term_id = self._get_payment_term(cr, uid, picking)
else:
@@ -980,7 +1002,7 @@ class stock_picking(osv.osv):
invoice_vals = {
'name': picking.name,
'origin': (picking.name or '') + (picking.origin and (':' + picking.origin) or ''),
- 'type': type,
+ 'type': inv_type,
'account_id': account_id,
'partner_id': partner.id,
'address_invoice_id': address_invoice_id,
@@ -1012,7 +1034,7 @@ class stock_picking(osv.osv):
else:
name = move_line.name
- if type in ('out_invoice', 'out_refund'):
+ if inv_type in ('out_invoice', 'out_refund'):
account_id = move_line.product_id.product_tmpl_id.\
property_account_income.id
if not account_id:
@@ -1026,14 +1048,14 @@ class stock_picking(osv.osv):
property_account_expense_categ.id
price_unit = self._get_price_unit_invoice(cr, uid,
- move_line, type)
+ move_line, inv_type)
discount = self._get_discount_invoice(cr, uid, move_line)
- tax_ids = self._get_taxes_invoice(cr, uid, move_line, type)
+ tax_ids = self._get_taxes_invoice(cr, uid, move_line, inv_type)
account_analytic_id = self._get_account_analytic_invoice(cr, uid, picking, move_line)
#set UoS if it's a sale and the picking doesn't have one
uos_id = move_line.product_uos and move_line.product_uos.id or False
- if not uos_id and type in ('out_invoice', 'out_refund'):
+ if not uos_id and inv_type in ('out_invoice', 'out_refund'):
uos_id = move_line.product_uom.id
account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, partner.property_account_position, account_id)
@@ -1053,7 +1075,7 @@ class stock_picking(osv.osv):
self._invoice_line_hook(cr, uid, move_line, invoice_line_id)
invoice_obj.button_compute(cr, uid, [invoice_id], context=context,
- set_total=(type in ('in_invoice', 'in_refund')))
+ set_total=(inv_type in ('in_invoice', 'in_refund')))
self.write(cr, uid, [picking.id], {
'invoice_state': 'invoiced',
}, context=context)
@@ -1087,14 +1109,14 @@ class stock_picking(osv.osv):
if move.state not in ('cancel',):
return False
return True
-
+
def allow_cancel(self, cr, uid, ids, context={}):
for pick in self.browse(cr, uid, ids, context=context):
if not pick.move_lines:
return True
for move in pick.move_lines:
if move.state == 'done':
- raise osv.except_osv(_('Error'), _('You cannot cancel picking because stock move is in done state !'))
+ raise osv.except_osv(_('Error'), _('You cannot cancel picking because stock move is in done state !'))
return True
def unlink(self, cr, uid, ids, context=None):
move_obj = self.pool.get('stock.move')
@@ -1182,7 +1204,7 @@ class stock_picking(osv.osv):
# Record the values that were chosen in the wizard, so they can be
# used for inventory valuation if real-time valuation is enabled.
- move_obj.write(cr, uid, [move.id],
+ move_obj.write(cr, uid, [move.id],
{'price_unit': product_price,
'price_currency_id': product_currency})
@@ -1350,12 +1372,12 @@ class stock_production_lot(osv.osv):
return ids
_columns = {
- 'name': fields.char('Serial Number', size=64, required=True, help="Unique serial number, will be displayed as: PREFIX/SERIAL [INT_REF]"),
+ 'name': fields.char('Production Lot', size=64, required=True, help="Unique production lot, will be displayed as: PREFIX/SERIAL [INT_REF]"),
'ref': fields.char('Internal Reference', size=256, help="Internal reference number in case it differs from the manufacturer's serial number"),
'prefix': fields.char('Prefix', size=64, help="Optional prefix to prepend when displaying this serial number: PREFIX/SERIAL [INT_REF]"),
- 'product_id': fields.many2one('product.product', 'Product', required=True),
+ 'product_id': fields.many2one('product.product', 'Product', required=True, domain=[('type', '<>', 'service')]),
'date': fields.datetime('Creation Date', required=True),
- 'stock_available': fields.function(_get_stock, fnct_search=_stock_search, method=True, type="float", string="Available", select=True,
+ 'stock_available': fields.function(_get_stock, fnct_search=_stock_search, method=True, type="float", string="Available", select=True,
help="Current quantity of products with this Production Lot Number available in company warehouses",
digits_compute=dp.get_precision('Product UoM')),
'revisions': fields.one2many('stock.production.lot.revision', 'lot_id', 'Revisions'),
@@ -1368,15 +1390,15 @@ class stock_production_lot(osv.osv):
'product_id': lambda x, y, z, c: c.get('product_id', False),
}
_sql_constraints = [
- ('name_ref_uniq', 'unique (name, ref)', _('The combination of serial number and internal reference must be unique !')),
+ ('name_ref_uniq', 'unique (name, ref)', 'The combination of serial number and internal reference must be unique !'),
]
def action_traceability(self, cr, uid, ids, context={}):
""" It traces the information of a product
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
- @param ids: List of IDs selected
- @param context: A standard dictionary
+ @param ids: List of IDs selected
+ @param context: A standard dictionary
@return: A dictionary of values
"""
value=self.pool.get('action.traceability').action_traceability(cr,uid,ids,context)
@@ -1480,7 +1502,7 @@ class stock_move(osv.osv):
'move_dest_id': fields.many2one('stock.move', 'Destination Move', help="Optional: next stock move when chaining them", select=True),
'move_history_ids': fields.many2many('stock.move', 'stock_move_history_ids', 'parent_id', 'child_id', 'Move History (child moves)'),
'move_history_ids2': fields.many2many('stock.move', 'stock_move_history_ids', 'child_id', 'parent_id', 'Move History (parent moves)'),
- 'picking_id': fields.many2one('stock.picking', 'Picking List', select=True,states={'done': [('readonly', True)]}),
+ 'picking_id': fields.many2one('stock.picking', 'Reference', select=True,states={'done': [('readonly', True)]}),
'note': fields.text('Notes'),
'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True,
help='When the stock move is created it is in the \'Draft\' state.\n After that it is set to \'Confirmed\' state.\n If stock is available state is set to \'Available\'.\n When the picking is done the state is \'Done\'.\
@@ -1510,7 +1532,7 @@ class stock_move(osv.osv):
if context.get('move_line', []):
if context['move_line'][0]:
if isinstance(context['move_line'][0], (tuple, list)):
- return context['move_line'][0][2] and context['move_line'][0][2].get('location_dest_id',False)
+ return context['move_line'][0][2] and context['move_line'][0][2].get('location_dest_id',False)
else:
move_list = self.pool.get('stock.move').read(cr, uid, context['move_line'][0], ['location_dest_id'])
return move_list and move_list['location_dest_id'][0] or False
@@ -1588,7 +1610,7 @@ class stock_move(osv.osv):
warning = {}
if (location.usage == 'internal') and (product_qty > (prodlot.stock_available or 0.0)):
warning = {
- 'title': _('Bad Lot Assignation !'),
+ 'title': _('Insufficient Stock in Lot !'),
'message': _('You are moving %.2f products but only %.2f available in this lot.') % (product_qty, prodlot.stock_available or 0.0)
}
return {'warning': warning}
@@ -1897,7 +1919,7 @@ class stock_move(osv.osv):
"""
Return the accounts and journal to use to post Journal Entries for the real-time
valuation of the move.
-
+
:param context: context dictionary that can explicitly mention the company to consider via the 'force_company' key
:raise: osv.except_osv() is any mandatory account or journal is not defined.
"""
@@ -1937,13 +1959,13 @@ class stock_move(osv.osv):
default_uom = move.product_id.uom_id.id
qty = product_uom_obj._compute_qty(cr, uid, move.product_uom.id, move.product_qty, default_uom)
- # if product is set to average price and a specific value was entered in the picking wizard,
+ # if product is set to average price and a specific value was entered in the picking wizard,
# we use it
if move.product_id.cost_method == 'average' and move.price_unit:
reference_amount = qty * move.price_unit
reference_currency_id = move.price_currency_id.id or reference_currency_id
- # Otherwise we default to the company's valuation price type, considering that the values of the
+ # Otherwise we default to the company's valuation price type, considering that the values of the
# valuation field are expressed in the default currency of the move's company.
else:
if context is None:
@@ -1985,7 +2007,7 @@ class stock_move(osv.osv):
move_obj = self.pool.get('account.move')
for j_id, move_lines in account_moves:
- move_obj.create(cr, uid,
+ move_obj.create(cr, uid,
{'name': move.name,
'journal_id': j_id,
'line_id': move_lines,
@@ -2042,10 +2064,10 @@ class stock_move(osv.osv):
def _create_account_move_line(self, cr, uid, move, src_account_id, dest_account_id, reference_amount, reference_currency_id, context=None):
"""
- Generate the account.move.line values to post to track the stock valuation difference due to the
+ Generate the account.move.line values to post to track the stock valuation difference due to the
processing of the given stock move.
"""
- # prepare default values considering that the destination accounts have the reference_currency_id as their main currency
+ # prepare default values considering that the destination accounts have the reference_currency_id as their main currency
partner_id = (move.picking_id.address_id and move.picking_id.address_id.partner_id and move.picking_id.address_id.partner_id.id) or False
debit_line_vals = {
'name': move.name,
@@ -2069,7 +2091,7 @@ class stock_move(osv.osv):
}
# if we are posting to accounts in a different currency, provide correct values in both currencies correctly
- # when compatible with the optional secondary currency on the account.
+ # when compatible with the optional secondary currency on the account.
# Financial Accounts only accept amounts in secondary currencies if there's no secondary currency on the account
# or if it's the same as that of the secondary amount being posted.
account_obj = self.pool.get('account.account')
@@ -2257,7 +2279,7 @@ class stock_move(osv.osv):
quantity_rest = quantity
uos_qty_rest = uos_qty
if move.product_id.track_production and location_id:
- res += self.split_lines(cr, uid, [move.id], quantity_rest, split_by_qty=1, context=context)
+ res += self.action_split(cr, uid, [move.id], quantity_rest, split_by_qty=1, context=context)
else:
res += [move.id]
update_val = {
@@ -2337,7 +2359,7 @@ class stock_move(osv.osv):
# Record the values that were chosen in the wizard, so they can be
# used for inventory valuation if real-time valuation is enabled.
- self.write(cr, uid, [move.id],
+ self.write(cr, uid, [move.id],
{'price_unit': product_price,
'price_currency_id': product_currency,
})
@@ -2402,7 +2424,7 @@ class stock_inventory(osv.osv):
'date_done': fields.datetime('Date done'),
'inventory_line_id': fields.one2many('stock.inventory.line', 'inventory_id', 'Inventories', states={'done': [('readonly', True)]}),
'move_ids': fields.many2many('stock.move', 'stock_inventory_move_rel', 'inventory_id', 'move_id', 'Created Moves'),
- 'state': fields.selection( (('draft', 'Draft'), ('done', 'Done'), ('cancel','Cancelled')), 'State', readonly=True, select=True),
+ 'state': fields.selection( (('draft', 'Draft'), ('done', 'Done'), ('confirm','Confirmed'),('cancel','Cancelled')), 'State', readonly=True, select=True),
'company_id': fields.many2one('res.company','Company',required=True,select=True),
}
_defaults = {
@@ -2410,7 +2432,7 @@ class stock_inventory(osv.osv):
'state': 'draft',
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.inventory', context=c)
}
-
+
def _inventory_line_hook(self, cr, uid, inventory_line, move_vals):
""" Creates a stock move from an inventory line
@param inventory_line:
@@ -2420,6 +2442,13 @@ class stock_inventory(osv.osv):
return self.pool.get('stock.move').create(cr, uid, move_vals)
def action_done(self, cr, uid, ids, context=None):
+ move_obj = self.pool.get('stock.move')
+ for inv in self.browse(cr, uid, ids, context=context):
+ move_obj.action_done(cr, uid, [x.id for x in inv.move_ids], context=context)
+ self.write(cr, uid, [inv.id], {'state':'done', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S')}, context=context)
+ return True
+
+ def action_confirm(self, cr, uid, ids, context=None):
""" Finishes the inventory and writes its finished date
@return: True
"""
@@ -2448,7 +2477,6 @@ class stock_inventory(osv.osv):
'prodlot_id': lot_id,
'date': inv.date,
'date': inv.date,
- 'state': 'done'
}
if change > 0:
value.update( {
@@ -2470,7 +2498,7 @@ class stock_inventory(osv.osv):
move_ids.append(self._inventory_line_hook(cr, uid, line, value))
message = _('Inventory') + " '" + inv.name + "' "+ _("is done.")
self.log(cr, uid, inv.id, message)
- self.write(cr, uid, [inv.id], {'state': 'done', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S'), 'move_ids': [(6, 0, move_ids)]})
+ self.write(cr, uid, [inv.id], {'state': 'confirm', 'move_ids': [(6, 0, move_ids)]})
return True
def action_cancel(self, cr, uid, ids, context=None):
diff --git a/addons/stock/stock_demo.xml b/addons/stock/stock_demo.xml
index bdc11f208ca..5de12effd2b 100644
--- a/addons/stock/stock_demo.xml
+++ b/addons/stock/stock_demo.xml
@@ -2,6 +2,10 @@
+
+
+
+
@@ -167,10 +171,15 @@
-
-
+
+
+
+
+
+
+
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 900629570ad..eeb0a92d019 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -103,7 +103,7 @@
+ type="action" icon="terp-stock_effects-object-colorize" states="draft,confirm"/>
-
+
+
+
+
@@ -135,13 +147,15 @@
-
-
+
+
+
+
-
+
+
-
@@ -307,7 +321,7 @@
-
+
@@ -320,7 +334,7 @@
-
+
@@ -452,7 +466,7 @@
-
+
@@ -661,6 +675,10 @@
groups="base.group_extended"
icon="terp-stock_effects-object-colorize"
states="draft,assigned,confirmed,done"/>
+
@@ -729,7 +747,7 @@
-
+
@@ -769,7 +787,7 @@
-
+
@@ -914,7 +932,7 @@
-
+
@@ -922,7 +940,8 @@
-
+
+
@@ -1142,8 +1161,9 @@
-
+
+
@@ -1464,9 +1484,9 @@
Reception Picking (By Stock Move)
====================================
-
-
-
+
+
+
stock.move.tree2
stock.move
@@ -1526,7 +1546,7 @@
-
+
stock.move.form2
diff --git a/addons/stock/test/stock_test.yml b/addons/stock/test/stock_test.yml
index 8b54e555a7b..696dd0900c6 100644
--- a/addons/stock/test/stock_test.yml
+++ b/addons/stock/test/stock_test.yml
@@ -247,6 +247,7 @@
I confirm the Inventory for HP CD writers.
-
!python {model: stock.inventory}: |
+ self.action_confirm(cr,uid,[ref('stock_inventory_physicalinventoy0')])
self.action_done(cr,uid,[ref('stock_inventory_physicalinventoy0')])
-
I create stock.fill.inventory .
diff --git a/addons/stock/wizard/stock_fill_inventory.py b/addons/stock/wizard/stock_fill_inventory.py
index 599377fec1e..83bfdaf9a4c 100644
--- a/addons/stock/wizard/stock_fill_inventory.py
+++ b/addons/stock/wizard/stock_fill_inventory.py
@@ -45,7 +45,7 @@ class stock_fill_inventory(osv.osv_memory):
if context.get('active_id', False):
stock = self.pool.get('stock.inventory').browse(cr, uid, context.get('active_id', False))
if stock.state=='done':
- raise osv.except_osv('Error!','Stock Inventory is done')
+ raise osv.except_osv(_('Error!'), _('Stock Inventory is done'))
True
def fill_inventory(self, cr, uid, ids, context=None):
diff --git a/addons/stock/wizard/stock_invoice_onshipping.py b/addons/stock/wizard/stock_invoice_onshipping.py
index 37d3634a988..9af23888b4d 100644
--- a/addons/stock/wizard/stock_invoice_onshipping.py
+++ b/addons/stock/wizard/stock_invoice_onshipping.py
@@ -24,14 +24,51 @@ from osv import fields, osv
from tools.translate import _
class stock_invoice_onshipping(osv.osv_memory):
+
+ def _get_journal_id(self, cr, uid, context=None):
+ if context is None:
+ context = {}
+
+ model = context.get('active_model')
+ if not model or model != 'stock.picking':
+ return []
+
+ model_pool = self.pool.get(model)
+ acct_obj = self.pool.get('account.journal')
+ res_ids = context and context.get('active_ids', [])
+ vals=[]
+ pick_types = list(set(map(lambda x: x.type, model_pool.browse(cr, uid, res_ids, context=context))))
+ for type in pick_types:
+ if type == 'out':
+ value = acct_obj.search(cr, uid, [('type', 'in',('sale','sale_refund') )])
+ for jr_type in acct_obj.browse(cr, uid, value, context=context):
+ t1 = jr_type.id,jr_type.name
+ vals.append(t1)
+
+ elif type == 'in':
+ value = acct_obj.search(cr, uid, [('type', 'in',('purchase','purchase_refund') )])
+ for jr_type in acct_obj.browse(cr, uid, value, context=context):
+ t1 = jr_type.id,jr_type.name
+ vals.append(t1)
+ else:
+ value = acct_obj.search(cr, uid, [('type', 'in',('cash','bank','general','situation') )])
+ for jr_type in acct_obj.browse(cr, uid, value, context=context):
+ t1 = jr_type.id,jr_type.name
+ vals.append(t1)
+ return vals
+
+
_name = "stock.invoice.onshipping"
_description = "Stock Invoice Onshipping"
+
+
_columns = {
- 'journal_id': fields.many2one('account.journal', 'Destination Journal', required=True),
+ 'journal_id': fields.selection(_get_journal_id, 'Destination Journal',required=True),
'group': fields.boolean("Group by partner"),
'invoice_date': fields.date('Invoiced date'),
}
+
def view_init(self, cr, uid, fields_list, context=None):
if context is None:
context = {}
@@ -48,30 +85,13 @@ class stock_invoice_onshipping(osv.osv_memory):
raise osv.except_osv(_('Warning !'), _('None of these picking lists require invoicing.'))
return res
- def _get_type(self, pick):
- src_usage = dest_usage = None
- pick_type = None
- if pick.invoice_state=='2binvoiced':
- if pick.move_lines:
- src_usage = pick.move_lines[0].location_id.usage
- dest_usage = pick.move_lines[0].location_dest_id.usage
- if pick.type == 'out' and dest_usage == 'supplier':
- pick_type = 'in_refund'
- elif pick.type == 'out' and dest_usage == 'customer':
- pick_type = 'out_invoice'
- elif pick.type == 'in' and src_usage == 'supplier':
- pick_type = 'in_invoice'
- elif pick.type == 'in' and src_usage == 'customer':
- pick_type = 'out_refund'
- else:
- pick_type = 'out_invoice'
- return pick_type
+
def create_invoice(self, cr, uid, ids, context=None):
if context is None:
context = {}
- result = []
- picking_obj = self.pool.get('stock.picking')
+ picking_pool = self.pool.get('stock.picking')
+ data_pool = self.pool.get('ir.model.data')
onshipdata_obj = self.read(cr, uid, ids[0], ['journal_id', 'group', 'invoice_date'])
if context.get('new_picking', False):
onshipdata_obj['id'] = onshipdata_obj.new_picking
@@ -79,33 +99,33 @@ class stock_invoice_onshipping(osv.osv_memory):
context['date_inv'] = onshipdata_obj['invoice_date']
invoice_ids = []
- for picking in picking_obj.browse(cr, uid, context.get('active_ids', []), context=context):
- if picking.invoice_state == '2binvoiced':
- res = picking_obj.action_invoice_create(cr, uid, [picking.id],
- journal_id = onshipdata_obj['journal_id'],
- group=onshipdata_obj['group'],
- type=self._get_type(picking),
- context=context)
- invoice_ids.extend(res.values())
- context['journal_type'] = {
- 'out_invoice': 'sale',
- 'out_refund': 'sale_refund',
- 'in_invoice': 'purchase',
- 'in_refund': 'purchase_refund'
- }.get(self._get_type(picking), 'sale')
+ active_ids = context.get('active_ids', [])
+ active_picking = picking_pool.browse(cr, uid, context.get('active_id',False), context=context)
+ inv_type = picking_pool._get_invoice_type(active_picking)
+ res = picking_pool.action_invoice_create(cr, uid, active_ids,
+ journal_id = onshipdata_obj['journal_id'],
+ group = onshipdata_obj['group'],
+ type = None,
+ context=context)
+ invoice_ids += res.values()
if not invoice_ids:
- raise osv.except_osv(_('Error'), _('No invoice were created'))
-
- return {
- 'domain': "[('id','in', ["+','.join(map(str,invoice_ids))+"])]",
- 'name' : _('Invoices'),
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'account.invoice',
- 'context': context,
- 'type': 'ir.actions.act_window',
- }
+ raise osv.except_osv(_('Error'), _('No Invoices were created'))
+ action_model = False
+ action = {}
+ if inv_type == "out_invoice":
+ action_model,action_id = data_pool.get_object_reference(cr, uid, 'account', "action_invoice_tree1")
+ elif inv_type == "in_invoice":
+ action_model,action_id = data_pool.get_object_reference(cr, uid, 'account', "action_invoice_tree2")
+ elif inv_type == "out_refund":
+ action_model,action_id = data_pool.get_object_reference(cr, uid, 'account', "action_invoice_tree3")
+ elif inv_type == "in_refund":
+ action_model,action_id = data_pool.get_object_reference(cr, uid, 'account', "action_invoice_tree4")
+ if action_model:
+ action_pool = self.pool.get(action_model)
+ action = action_pool.read(cr, uid, action_id, context=context)
+ action['domain'] = "[('id','in', ["+','.join(map(str,invoice_ids))+"])]"
+ return action
stock_invoice_onshipping()
diff --git a/addons/stock/wizard/stock_move.py b/addons/stock/wizard/stock_move.py
index 08df30e7ea8..c10a0e63ec3 100644
--- a/addons/stock/wizard/stock_move.py
+++ b/addons/stock/wizard/stock_move.py
@@ -218,10 +218,14 @@ class split_in_production_lot(osv.osv_memory):
@param context: A standard dictionary
@return:
"""
+ if context is None:
+ context = {}
+ inventory_id = context.get('inventory_id', False)
prodlot_obj = self.pool.get('stock.production.lot')
+ inventory_obj = self.pool.get('stock.inventory')
move_obj = self.pool.get('stock.move')
new_move = []
- for data in self.browse(cr, uid, ids):
+ for data in self.browse(cr, uid, ids, context=context):
for move in move_obj.browse(cr, uid, move_ids):
move_qty = move.product_qty
quantity_rest = move.product_qty
@@ -247,8 +251,11 @@ class split_in_production_lot(osv.osv_memory):
'state': move.state
}
if quantity_rest > 0:
- current_move = move_obj.copy(cr, uid, move.id, default_val)
+ current_move = move_obj.copy(cr, uid, move.id, default_val, context=context)
+ if inventory_id and current_move:
+ inventory_obj.write(cr, uid, inventory_id, {'move_ids': [(4, current_move)]}, context=context)
new_move.append(current_move)
+
if quantity_rest == 0:
current_move = move.id
prodlot_id = False
@@ -259,7 +266,7 @@ class split_in_production_lot(osv.osv_memory):
'name': line.name,
'product_id': move.product_id.id},
context=context)
-
+
move_obj.write(cr, uid, [current_move], {'prodlot_id': prodlot_id, 'state':move.state})
update_val = {}
@@ -268,7 +275,9 @@ class split_in_production_lot(osv.osv_memory):
update_val['product_uos_qty'] = uos_qty_rest
update_val['state'] = move.state
move_obj.write(cr, uid, [move.id], update_val)
+
return new_move
+
split_in_production_lot()
class stock_move_split_lines_exist(osv.osv_memory):
diff --git a/addons/stock/wizard/stock_move_view.xml b/addons/stock/wizard/stock_move_view.xml
index 06f6822e3c7..baaa581b4f3 100644
--- a/addons/stock/wizard/stock_move_view.xml
+++ b/addons/stock/wizard/stock_move_view.xml
@@ -40,7 +40,7 @@