- [[ formatLang(line.date_value,date = True) ]]
+ [[ formatLang(line.date_value,date=True) ]]
[[ line.name or '' ]] [[ line.description or '' ]]
@@ -259,7 +259,7 @@
- [[ setTag('para','xpre') ]] [[ o.note or '' ]]
+ [[ o.note or '' ]] [[ setTag('para','xpre') ]]
diff --git a/addons/hr_holidays/migrations/1.5/post-01-convert-limits-into-requests.py b/addons/hr_holidays/migrations/1.5/post-01-convert-limits-into-requests.py
index 5ee6e894cf5..a59dbbf85eb 100644
--- a/addons/hr_holidays/migrations/1.5/post-01-convert-limits-into-requests.py
+++ b/addons/hr_holidays/migrations/1.5/post-01-convert-limits-into-requests.py
@@ -21,14 +21,15 @@
__name__ = "Convert the Holidays Per User limits into positive leave request"
def migrate(cr, version):
- cr.execute("""SELECT id, employee_id, holiday_status, max_leaves, notes, create_uid
- FROM hr_holidays_per_user;""")
- for record in cr.fetchall():
- cr.execute("""INSERT INTO hr_holidays
- (employee_id, type, allocation_type, name, holiday_status_id,
- state, number_of_days, notes, manager_id) VALUES
- (%s, 'add', 'company', 'imported holiday_per_user', %s,
- 'validated', %s, %s, %s) """, (record[1],record[2],record[3],record[4],record[5]))
+# cr.execute("""SELECT id, employee_id, holiday_status, max_leaves, notes, create_uid
+# FROM hr_holidays_per_user;""")
+# for record in cr.fetchall():
+# cr.execute("""INSERT INTO hr_holidays
+# (employee_id, type, allocation_type, name, holiday_status_id,
+# state, number_of_days, notes, manager_id) VALUES
+# (%s, 'add', 'company', 'imported holiday_per_user', %s,
+# 'validated', %s, %s, %s) """, (record[1],record[2],record[3],record[4],record[5]))
+ return {}
diff --git a/addons/hr_holidays/report/hr_custom_default.xsl b/addons/hr_holidays/report/hr_custom_default.xsl
index 39e71d6d53e..e8b133da1b0 100644
--- a/addons/hr_holidays/report/hr_custom_default.xsl
+++ b/addons/hr_holidays/report/hr_custom_default.xsl
@@ -9,8 +9,6 @@
-
- /
1.3cm 19.3cm 28.5cm 19.3cm
@@ -23,8 +21,6 @@
-
- /
1.3cm 19.3cm 28.5cm 19.3cm
diff --git a/addons/hr_payroll/i18n/de.po b/addons/hr_payroll/i18n/de.po
index 0f7cee2b8d1..0780f644296 100644
--- a/addons/hr_payroll/i18n/de.po
+++ b/addons/hr_payroll/i18n/de.po
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2009-11-25 13:16+0000\n"
-"PO-Revision-Date: 2010-10-10 11:08+0000\n"
-"Last-Translator: Ferdinand @ ChriCar \n"
+"PO-Revision-Date: 2010-10-11 07:18+0000\n"
+"Last-Translator: Ferdinand-chricar \n"
"Language-Team: German \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-10-11 04:45+0000\n"
+"X-Launchpad-Export-Date: 2010-10-12 04:51+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: hr_payroll
diff --git a/addons/hr_payroll/report/report_employees_detail.py b/addons/hr_payroll/report/report_employees_detail.py
index f3ecb56aa0b..efa4c1ee236 100644
--- a/addons/hr_payroll/report/report_employees_detail.py
+++ b/addons/hr_payroll/report/report_employees_detail.py
@@ -48,10 +48,14 @@ class employees_salary_report(rml_parse.rml_parse):
m = datetime.date(cy, cm, 1).strftime('%b')
mnth_name.append(m)
self.mnths.append(str(cm)+'-'+str(cy))
+
if cm == 12:
cm = 0
cy = ly
cm = cm +1
+ for c in range(0,(12-no_months)):
+ mnth_name.append('None')
+ self.mnths.append('None')
return [mnth_name]
def get_employee(self,form):
@@ -134,11 +138,14 @@ class employees_salary_report(rml_parse.rml_parse):
category_name = self.pool.get('hr.allounce.deduction.categoty').read(self.cr, self.uid, [category],['name','type'])[0]
result.append(category_name['name'])
for mnth in self.mnths:
- if len(mnth) != 7:
- mnth = '0' + str(mnth)
- query = "select id from hr_payslip where employee_id = "+str(emp_id)+" and to_char(date,'mm-yyyy') like '%"+mnth+"%' and state = 'done' "
- self.cr.execute(query)
- payslip_id = self.cr.dictfetchone()
+ if mnth <> 'None':
+ if len(mnth) != 7:
+ mnth = '0' + str(mnth)
+ query = "select id from hr_payslip where employee_id = "+str(emp_id)+" and to_char(date,'mm-yyyy') like '%"+mnth+"%' and state = 'done' "
+ self.cr.execute(query)
+ payslip_id = self.cr.dictfetchone()
+ else:
+ payslip_id = False
if payslip_id:
payslip_obj = self.pool.get('hr.payslip').browse(self.cr, self.uid, payslip_id['id'])
if not category:
@@ -211,7 +218,7 @@ class employees_salary_report(rml_parse.rml_parse):
def get_monthly_total(self):
return self.month_total_list
-report_sxw.report_sxw('report.employees.salary', 'hr.payslip', 'hr_payroll/report/report_employees_detail.rml', parser=employees_salary_report,header=3)
+report_sxw.report_sxw('report.employees.salary', 'hr.payslip', 'hr_payroll/report/report_employees_detail.rml', parser=employees_salary_report,header='internal landscape')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_payroll/report/report_employees_detail.rml b/addons/hr_payroll/report/report_employees_detail.rml
index e1bd6c3b3c8..542e370eb34 100644
--- a/addons/hr_payroll/report/report_employees_detail.rml
+++ b/addons/hr_payroll/report/report_employees_detail.rml
@@ -184,6 +184,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -329,46 +343,46 @@
[[ repeatIn(get_periods(data['form']),'m') ]] [[ get_employee_detail(o) ]]
-
+
Title
- [[ m[0] ]]
+ [[ m[0] != 'None' and m[0] or '' ]]
- [[ m[1] ]]
+ [[ m[1] != 'None' and m[1] or '' ]]
- [[ m[2] ]]
+ [[ m[2] != 'None' and m[2] or '' ]]
- [[ m[3] ]]
+ [[ m[3] != 'None' and m[3] or '' ]]
- [[ m[4] ]]
+ [[ m[4] != 'None' and m[4] or '' ]]
- [[ m[5] ]]
+ [[ m[5] != 'None' and m[5] or '' ]]
- [[ m[6] ]]
+ [[ m[6] != 'None' and m[6] or '' ]]
- [[ m[7] ]]
+ [[ m[7] != 'None' and m[7] or '' ]]
- [[ m[8] ]]
+ [[ m[8] != 'None' and m[8] or '' ]]
- [[ m[9] ]]
+ [[ m[9] != 'None' and m[9] or '' ]]
- [[ m[10] ]]
+ [[ m[10] != 'None' and m[10] or '' ]]
- [[ m[11] ]]
+ [[ m[11] != 'None' and m[11] or '' ]]
Total
@@ -379,9 +393,6 @@
-
-
-
@@ -390,8 +401,8 @@
- [[ repeatIn(get_allow(),'e1') ]]
-
+ [[ repeatIn(get_allow(),'e1') ]]
+
[[ e1[0] ]]
@@ -437,9 +448,6 @@
-
-
-
@@ -449,8 +457,8 @@
- [[ repeatIn(get_deduct(),'e2') ]]
-
+ [[ repeatIn(get_deduct(),'e2') ]]
+
[[ e2[0] ]]
@@ -496,9 +504,6 @@
-
-
-
@@ -508,8 +513,8 @@
- [[ repeatIn(get_other(),'e3') ]]
-
+ [[ repeatIn(get_other(),'e3') ]]
+
[[ e3[0] ]]
@@ -555,18 +560,9 @@
-
-
-
-
-
-
-
-
-
-
+
[[ get_monthly_total()[0] ]]
@@ -616,11 +612,8 @@
-
-
-
-
+
\ No newline at end of file
diff --git a/addons/hr_payroll/report/report_year_report.rml b/addons/hr_payroll/report/report_year_report.rml
index 052af6f4701..212bb59e7b3 100755
--- a/addons/hr_payroll/report/report_year_report.rml
+++ b/addons/hr_payroll/report/report_year_report.rml
@@ -63,11 +63,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
@@ -133,58 +146,55 @@
- [[ repeatIn(get_periods(data['form']),'m') ]]
+ [[ repeatIn(get_periods(data['form']),'m') ]]
Name
- [[ m[0] ]]
+ [[ m[0] != 'None' and m[0] or '' ]]
- [[ m[1] ]]
+ [[ m[1] != 'None' and m[1] or '' ]]
- [[ m[2] ]]
+ [[ m[2] != 'None' and m[2] or '' ]]
- [[ m[3] ]]
+ [[ m[3] != 'None' and m[3] or '' ]]
- [[ m[4] ]]
+ [[ m[4] != 'None' and m[4] or '' ]]
- [[ m[5] ]]
+ [[ m[5] != 'None' and m[5] or '' ]]
- [[ m[6] ]]
+ [[ m[6] != 'None' and m[6] or '' ]]
- [[ m[7] ]]
+ [[ m[7] != 'None' and m[7] or '' ]]
- [[ m[8] ]]
+ [[ m[8] != 'None' and m[8] or '' ]]
- [[ m[9] ]]
+ [[ m[9] != 'None' and m[9] or '' ]]
- [[ m[10] ]]
+ [[ m[10] != 'None' and m[10] or '' ]]
- [[ m[11] ]]
+ [[ m[11] != 'None' and m[11] or '' ]]
Total
-
-
-
- [[ repeatIn(get_employee(data['form']),'e') ]]
+ [[ repeatIn(get_employee(data['form']),'e') ]]
@@ -231,19 +241,10 @@
-
-
-
-
-
-
-
-
-
- [[ repeatIn(get_months_tol(),'t') ]]
+ [[ repeatIn(get_months_tol(),'t') ]]
@@ -294,8 +295,5 @@
-
-
-
-
+
\ No newline at end of file
diff --git a/addons/hr_payroll/report/report_year_salary.py b/addons/hr_payroll/report/report_year_salary.py
index b23effbeccb..0a7857582d4 100755
--- a/addons/hr_payroll/report/report_year_salary.py
+++ b/addons/hr_payroll/report/report_year_salary.py
@@ -43,6 +43,9 @@ class year_salary_report(rml_parse.rml_parse):
cm = 0
cy = ly
cm = cm +1
+ for c in range(0,(12-no_months)):
+ mnth_name.append('None')
+ self.mnths.append('None')
return [mnth_name]
def get_employee(self,form):
@@ -58,11 +61,14 @@ class year_salary_report(rml_parse.rml_parse):
ls1.append(emp_id.name)
tol = 0.0
for mnth in self.mnths:
- if len(mnth) != 7:
- mnth = '0' + str(mnth)
- query = "select net from hr_payslip where employee_id = "+str(emp_id.id)+" and to_char(date,'mm-yyyy') like '%"+mnth+"%' and state = 'done' "
- self.cr.execute(query)
- sal = self.cr.fetchall()
+ if mnth <> 'None':
+ if len(mnth) != 7:
+ mnth = '0' + str(mnth)
+ query = "select net from hr_payslip where employee_id = "+str(emp_id.id)+" and to_char(date,'mm-yyyy') like '%"+mnth+"%' and state = 'done' "
+ self.cr.execute(query)
+ sal = self.cr.fetchall()
+ else:
+ sal = [(0.0,)]
try:
ls1.append(sal[0][0])
except:
@@ -89,7 +95,7 @@ class year_salary_report(rml_parse.rml_parse):
self.total += item[count]
return self.total
-report_sxw.report_sxw('report.year.salary', 'hr.payslip', 'hr_payroll/report/report_year_report.rml', parser=year_salary_report,header=3)
+report_sxw.report_sxw('report.year.salary', 'hr.payslip', 'hr_payroll/report/report_year_report.rml', parser=year_salary_report,header='internal landscape')
diff --git a/addons/hr_payroll/report/rml_parse.py b/addons/hr_payroll/report/rml_parse.py
index 2e3ca9dc019..7abb29711b6 100755
--- a/addons/hr_payroll/report/rml_parse.py
+++ b/addons/hr_payroll/report/rml_parse.py
@@ -151,10 +151,10 @@ class rml_parse(report_sxw.rml_parse):
print Stringer
return Stringer
- def _add_header(self, node, header=1):
- if header==2:
+ def _add_header(self, node, header='external'):
+ if header=='internal':
rml_head = self.rml_header2
- elif header==3:
+ elif header=='internal landscape':
rml_head = self.rml_header3
else:
rml_head = self.rml_header
diff --git a/addons/hr_timesheet/report/custom_default.xsl b/addons/hr_timesheet/report/custom_default.xsl
index 39e71d6d53e..e8b133da1b0 100644
--- a/addons/hr_timesheet/report/custom_default.xsl
+++ b/addons/hr_timesheet/report/custom_default.xsl
@@ -9,8 +9,6 @@
-
- /
1.3cm 19.3cm 28.5cm 19.3cm
@@ -23,8 +21,6 @@
-
- /
1.3cm 19.3cm 28.5cm 19.3cm
diff --git a/addons/hr_timesheet_invoice/__openerp__.py b/addons/hr_timesheet_invoice/__openerp__.py
index f45490867c2..dfcda5ec534 100644
--- a/addons/hr_timesheet_invoice/__openerp__.py
+++ b/addons/hr_timesheet_invoice/__openerp__.py
@@ -31,9 +31,9 @@ reports, eso.""",
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['account', 'hr_timesheet'],
- 'init_xml': [],
- 'update_xml': [
+ 'data': [
'security/ir.model.access.csv',
+ 'hr_timesheet_invoice_data.xml',
'hr_timesheet_invoice_view.xml',
'hr_timesheet_invoice_wizard.xml',
'hr_timesheet_invoice_report.xml',
@@ -45,11 +45,12 @@ reports, eso.""",
'wizard/hr_timesheet_invoice_create_final_view.xml',
'board_hr_timesheet_invoice.xml',
],
- 'demo_xml': ['hr_timesheet_invoice_demo.xml',
- ],
+ 'demo': [
+ 'hr_timesheet_invoice_demo.xml',
+ ],
'test': ['test/test_hr_timesheet_invoice.yml',
'test/hr_timesheet_invoice_report.yml',
- ],
+ ],
'installable': True,
'active': False,
'certificate': '0056091842381',
diff --git a/addons/hr_timesheet_invoice/board_hr_timesheet_invoice.xml b/addons/hr_timesheet_invoice/board_hr_timesheet_invoice.xml
index ff61617661c..792ea34ae53 100644
--- a/addons/hr_timesheet_invoice/board_hr_timesheet_invoice.xml
+++ b/addons/hr_timesheet_invoice/board_hr_timesheet_invoice.xml
@@ -11,7 +11,7 @@
graph,tree
-
+
-
+
timesheet.uninvoiced.line.tree
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_data.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_data.xml
new file mode 100644
index 00000000000..a81af0788b6
--- /dev/null
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_data.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ Yes (100%)
+ 100%
+ 0.0
+
+
+
diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice_demo.xml b/addons/hr_timesheet_invoice/hr_timesheet_invoice_demo.xml
index adc9e47b033..ee6bdf23538 100644
--- a/addons/hr_timesheet_invoice/hr_timesheet_invoice_demo.xml
+++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice_demo.xml
@@ -1,36 +1,24 @@
-
-
- 100%
-
- 0.0
-
-
50%
50% Discount
50.0
-
Gratis
Offered developments
100.0
-
-
-
-
diff --git a/addons/hr_timesheet_invoice/report/cost_ledger.py b/addons/hr_timesheet_invoice/report/cost_ledger.py
index 8daf40fded6..18de548ad1c 100644
--- a/addons/hr_timesheet_invoice/report/cost_ledger.py
+++ b/addons/hr_timesheet_invoice/report/cost_ledger.py
@@ -167,7 +167,7 @@ report_sxw.report_sxw(
'report.hr.timesheet.invoice.account.analytic.account.cost_ledger',
'account.analytic.account',
'addons/hr_timesheet_invoice/report/cost_ledger.rml',
- parser=account_analytic_cost_ledger, header=False)
+ parser=account_analytic_cost_ledger, header='internal')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/membership/membership_view.xml b/addons/membership/membership_view.xml
index ad9c3bcf772..afa1ee9bebe 100644
--- a/addons/membership/membership_view.xml
+++ b/addons/membership/membership_view.xml
@@ -140,7 +140,8 @@
parent="menu_membership"
id="menu_membership_products"
action="action_membership_products"
- sequence="1"/>
+ sequence="1"
+ groups="base.group_partner_manager"/>
diff --git a/addons/membership/report/report_membership_view.xml b/addons/membership/report/report_membership_view.xml
index abe8b44bcba..291efee4834 100644
--- a/addons/membership/report/report_membership_view.xml
+++ b/addons/membership/report/report_membership_view.xml
@@ -116,7 +116,8 @@
+ id="menu_report_membership"
+ groups="base.group_partner_manager"/>
diff --git a/addons/membership/security/ir.model.access.csv b/addons/membership/security/ir.model.access.csv
index 6cf3eb755c2..f3d91646c44 100644
--- a/addons/membership/security/ir.model.access.csv
+++ b/addons/membership/security/ir.model.access.csv
@@ -1,4 +1,4 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
-"access_membership_membership_line_partner_manager","membership.membership_line partner_manager","model_membership_membership_line","base.group_partner_manager",1,0,0,0
+"access_membership_membership_line_partner_manager","membership.membership_line partner_manager","model_membership_membership_line","base.group_partner_manager",1,1,1,1
"access_membership_membership_line","membership.membership_line","model_membership_membership_line",,1,0,0,0
"access_report_membership","report.membership","model_report_membership","base.group_partner_manager",1,0,0,0
diff --git a/addons/mrp/board_manufacturing_view.xml b/addons/mrp/board_manufacturing_view.xml
index aa8bd2ab69e..c5474670d9b 100644
--- a/addons/mrp/board_manufacturing_view.xml
+++ b/addons/mrp/board_manufacturing_view.xml
@@ -15,7 +15,7 @@
-
+
diff --git a/addons/mrp/i18n/ar.po b/addons/mrp/i18n/ar.po
index f2b3d711f2e..3c0a5730203 100644
--- a/addons/mrp/i18n/ar.po
+++ b/addons/mrp/i18n/ar.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/bg.po b/addons/mrp/i18n/bg.po
index 44e7b102d18..a1bd0ba39d7 100644
--- a/addons/mrp/i18n/bg.po
+++ b/addons/mrp/i18n/bg.po
@@ -565,7 +565,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/bs.po b/addons/mrp/i18n/bs.po
index 4d3fd7169e9..6114a513680 100644
--- a/addons/mrp/i18n/bs.po
+++ b/addons/mrp/i18n/bs.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/ca.po b/addons/mrp/i18n/ca.po
index 6a674f9d1c3..ed1ee7ba401 100644
--- a/addons/mrp/i18n/ca.po
+++ b/addons/mrp/i18n/ca.po
@@ -584,7 +584,7 @@ msgid "Time in hours for doing one cycle."
msgstr "Temps en hores per realitzar un cicle."
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Data final"
diff --git a/addons/mrp/i18n/cs.po b/addons/mrp/i18n/cs.po
index cf9c4b7dbc1..012d1c2eae0 100644
--- a/addons/mrp/i18n/cs.po
+++ b/addons/mrp/i18n/cs.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/de.po b/addons/mrp/i18n/de.po
index e6a45d18a49..2e84ba9f1e2 100644
--- a/addons/mrp/i18n/de.po
+++ b/addons/mrp/i18n/de.po
@@ -585,7 +585,7 @@ msgid "Time in hours for doing one cycle."
msgstr "Zeit in Stunden für einen (Auftrags-) Zyklus"
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Endedatum"
diff --git a/addons/mrp/i18n/el.po b/addons/mrp/i18n/el.po
index fc5cb55363f..6904be353b3 100644
--- a/addons/mrp/i18n/el.po
+++ b/addons/mrp/i18n/el.po
@@ -585,7 +585,7 @@ msgid "Time in hours for doing one cycle."
msgstr "Χρόνος ενός κύκλου σε ώρες"
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Ημερ/νία Τέλους"
diff --git a/addons/mrp/i18n/es.po b/addons/mrp/i18n/es.po
index 9212132769a..d2568c453cf 100644
--- a/addons/mrp/i18n/es.po
+++ b/addons/mrp/i18n/es.po
@@ -585,7 +585,7 @@ msgid "Time in hours for doing one cycle."
msgstr "Tiempo en horas para realizar un ciclo."
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Fecha final"
diff --git a/addons/mrp/i18n/es_AR.po b/addons/mrp/i18n/es_AR.po
index c1c0ee7e6b9..6146c57db3d 100644
--- a/addons/mrp/i18n/es_AR.po
+++ b/addons/mrp/i18n/es_AR.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/es_EC.po b/addons/mrp/i18n/es_EC.po
index d86a3f54173..ff994127269 100644
--- a/addons/mrp/i18n/es_EC.po
+++ b/addons/mrp/i18n/es_EC.po
@@ -585,7 +585,7 @@ msgid "Time in hours for doing one cycle."
msgstr "Tiempo en horas para realizar un ciclo."
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Fecha final"
diff --git a/addons/mrp/i18n/et.po b/addons/mrp/i18n/et.po
index 434a4622aa5..1e78dd6168b 100644
--- a/addons/mrp/i18n/et.po
+++ b/addons/mrp/i18n/et.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr "Aeg tundides mis kulub ühes tsükklis."
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Lõppkuupäev"
diff --git a/addons/mrp/i18n/fi.po b/addons/mrp/i18n/fi.po
index 8610bec1dea..1d33d2dedff 100644
--- a/addons/mrp/i18n/fi.po
+++ b/addons/mrp/i18n/fi.po
@@ -580,7 +580,7 @@ msgid "Time in hours for doing one cycle."
msgstr "Yhden kierron kesto tunneissa."
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Lopetuspäivämäärä"
diff --git a/addons/mrp/i18n/fr.po b/addons/mrp/i18n/fr.po
index 51287167558..a39551a404d 100644
--- a/addons/mrp/i18n/fr.po
+++ b/addons/mrp/i18n/fr.po
@@ -600,7 +600,7 @@ msgid "Time in hours for doing one cycle."
msgstr "Temps nécessaire à la réalisation d'un cycle"
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Date de fin"
diff --git a/addons/mrp/i18n/hi.po b/addons/mrp/i18n/hi.po
index 96be03f1000..d8352b7d12d 100644
--- a/addons/mrp/i18n/hi.po
+++ b/addons/mrp/i18n/hi.po
@@ -562,7 +562,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "समाप्ति तिथि"
diff --git a/addons/mrp/i18n/hr.po b/addons/mrp/i18n/hr.po
index 652303d8bb4..17504495bf8 100644
--- a/addons/mrp/i18n/hr.po
+++ b/addons/mrp/i18n/hr.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/hu.po b/addons/mrp/i18n/hu.po
index 10d9b0da8ba..fb78fa66ed3 100644
--- a/addons/mrp/i18n/hu.po
+++ b/addons/mrp/i18n/hu.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/id.po b/addons/mrp/i18n/id.po
index c91d0f8438e..23308aeca00 100644
--- a/addons/mrp/i18n/id.po
+++ b/addons/mrp/i18n/id.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/it.po b/addons/mrp/i18n/it.po
index c001e0a2d6e..148820c77f9 100644
--- a/addons/mrp/i18n/it.po
+++ b/addons/mrp/i18n/it.po
@@ -586,7 +586,7 @@ msgid "Time in hours for doing one cycle."
msgstr "Tempo in ore per completare un ciclo."
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Data di fine"
diff --git a/addons/mrp/i18n/ko.po b/addons/mrp/i18n/ko.po
index 1068e604527..8df359442fb 100644
--- a/addons/mrp/i18n/ko.po
+++ b/addons/mrp/i18n/ko.po
@@ -567,7 +567,7 @@ msgid "Time in hours for doing one cycle."
msgstr "한 사이클을 수행하는 시간"
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "마감 날짜"
diff --git a/addons/mrp/i18n/lt.po b/addons/mrp/i18n/lt.po
index 677f640b861..faae3ef23ce 100644
--- a/addons/mrp/i18n/lt.po
+++ b/addons/mrp/i18n/lt.po
@@ -575,7 +575,7 @@ msgid "Time in hours for doing one cycle."
msgstr "Vieno ciklo laikas valandomis."
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Pabaigos data"
diff --git a/addons/mrp/i18n/mrp.pot b/addons/mrp/i18n/mrp.pot
index d576151f247..913acfe3f9f 100644
--- a/addons/mrp/i18n/mrp.pot
+++ b/addons/mrp/i18n/mrp.pot
@@ -546,7 +546,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/nl.po b/addons/mrp/i18n/nl.po
index 97c4f6ee79c..4faad6c115e 100644
--- a/addons/mrp/i18n/nl.po
+++ b/addons/mrp/i18n/nl.po
@@ -584,7 +584,7 @@ msgid "Time in hours for doing one cycle."
msgstr "Tijd in uren voor één productiecyclus."
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Einddatum"
diff --git a/addons/mrp/i18n/nl_BE.po b/addons/mrp/i18n/nl_BE.po
index a6bea998b5f..a4df723195a 100644
--- a/addons/mrp/i18n/nl_BE.po
+++ b/addons/mrp/i18n/nl_BE.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/pl.po b/addons/mrp/i18n/pl.po
index d65d0617e75..37985293f94 100644
--- a/addons/mrp/i18n/pl.po
+++ b/addons/mrp/i18n/pl.po
@@ -582,7 +582,7 @@ msgid "Time in hours for doing one cycle."
msgstr "Czas wykonania jednego cyklu w godzinach"
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Data końcowa"
diff --git a/addons/mrp/i18n/pt.po b/addons/mrp/i18n/pt.po
index 71ea973805e..39c9c359335 100644
--- a/addons/mrp/i18n/pt.po
+++ b/addons/mrp/i18n/pt.po
@@ -564,7 +564,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Data de finalização"
diff --git a/addons/mrp/i18n/pt_BR.po b/addons/mrp/i18n/pt_BR.po
index b348ca0faee..ba0de24330e 100644
--- a/addons/mrp/i18n/pt_BR.po
+++ b/addons/mrp/i18n/pt_BR.po
@@ -567,7 +567,7 @@ msgid "Time in hours for doing one cycle."
msgstr "Tempo em hora para fazer um ciclo."
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Data final"
diff --git a/addons/mrp/i18n/ro.po b/addons/mrp/i18n/ro.po
index 11f24dae6c9..346792757ce 100644
--- a/addons/mrp/i18n/ro.po
+++ b/addons/mrp/i18n/ro.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/ru.po b/addons/mrp/i18n/ru.po
index 3f227b676ac..b0a01bfe8f2 100644
--- a/addons/mrp/i18n/ru.po
+++ b/addons/mrp/i18n/ru.po
@@ -567,7 +567,7 @@ msgid "Time in hours for doing one cycle."
msgstr "Время в часах на выполнение одного цикла"
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Дата окончания"
diff --git a/addons/mrp/i18n/sk.po b/addons/mrp/i18n/sk.po
index e9bdba85b42..5cad0bfc519 100644
--- a/addons/mrp/i18n/sk.po
+++ b/addons/mrp/i18n/sk.po
@@ -562,7 +562,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/sl.po b/addons/mrp/i18n/sl.po
index 1c314829f6a..16c4b4c8067 100644
--- a/addons/mrp/i18n/sl.po
+++ b/addons/mrp/i18n/sl.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Končni datum"
diff --git a/addons/mrp/i18n/sq.po b/addons/mrp/i18n/sq.po
index ba8543fe2f7..bbd4051e28a 100644
--- a/addons/mrp/i18n/sq.po
+++ b/addons/mrp/i18n/sq.po
@@ -562,7 +562,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/sv.po b/addons/mrp/i18n/sv.po
index d3865dd7691..c086b7f24f1 100644
--- a/addons/mrp/i18n/sv.po
+++ b/addons/mrp/i18n/sv.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Slutdatum"
diff --git a/addons/mrp/i18n/tlh.po b/addons/mrp/i18n/tlh.po
index 81ba3486333..5ac8e02d5aa 100644
--- a/addons/mrp/i18n/tlh.po
+++ b/addons/mrp/i18n/tlh.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/tr.po b/addons/mrp/i18n/tr.po
index be3a69b6415..ee6b7017c3b 100644
--- a/addons/mrp/i18n/tr.po
+++ b/addons/mrp/i18n/tr.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Bitiş Tarihi"
diff --git a/addons/mrp/i18n/uk.po b/addons/mrp/i18n/uk.po
index a5824ca6d96..fcbd14cb9e7 100644
--- a/addons/mrp/i18n/uk.po
+++ b/addons/mrp/i18n/uk.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "Кінцева дата"
diff --git a/addons/mrp/i18n/vi.po b/addons/mrp/i18n/vi.po
index 516438d2dfc..6c620e01062 100644
--- a/addons/mrp/i18n/vi.po
+++ b/addons/mrp/i18n/vi.po
@@ -562,7 +562,7 @@ msgid "Time in hours for doing one cycle."
msgstr ""
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/zh_CN.po b/addons/mrp/i18n/zh_CN.po
index b4b04af2f15..1fb75aececc 100644
--- a/addons/mrp/i18n/zh_CN.po
+++ b/addons/mrp/i18n/zh_CN.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr "一个周期的工作小时数"
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr "结束日期"
diff --git a/addons/mrp/i18n/zh_HK.po b/addons/mrp/i18n/zh_HK.po
index 88ec10de504..43c27d45606 100644
--- a/addons/mrp/i18n/zh_HK.po
+++ b/addons/mrp/i18n/zh_HK.po
@@ -562,7 +562,7 @@ msgid "Time in hours for doing one cycle."
msgstr "一個循環所須的小時數"
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/i18n/zh_TW.po b/addons/mrp/i18n/zh_TW.po
index b0be94ac800..08120747e9a 100644
--- a/addons/mrp/i18n/zh_TW.po
+++ b/addons/mrp/i18n/zh_TW.po
@@ -561,7 +561,7 @@ msgid "Time in hours for doing one cycle."
msgstr "一個循環所須的小時數"
#. module: mrp
-#: field:mrp.production,date_finnished:0
+#: field:mrp.production,date_finished:0
msgid "End Date"
msgstr ""
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index 1a71114c336..5f2695cf3a7 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -456,7 +456,7 @@ class mrp_production(osv.osv):
'date_planned_date': fields.function(_production_date, method=True, type='date', string='Scheduled Date'),
'date_planned': fields.datetime('Scheduled date', required=True, select=1),
'date_start': fields.datetime('Start Date'),
- 'date_finnished': fields.datetime('End Date'),
+ 'date_finished': fields.datetime('End Date'),
'bom_id': fields.many2one('mrp.bom', 'Bill of Material', domain=[('bom_id','=',False)]),
'routing_id': fields.many2one('mrp.routing', string='Routing', on_delete='set null', help="The list of operations (list of workcenters) to produce the finished product. The routing is mainly used to compute workcenter costs during operations and to plan future loads on workcenters based on production plannification."),
@@ -658,7 +658,7 @@ class mrp_production(osv.osv):
"""
for production in self.browse(cr, uid, ids):
self._costs_generate(cr, uid, production)
- return self.write(cr, uid, ids, {'state': 'done', 'date_finnished': time.strftime('%Y-%m-%d %H:%M:%S')})
+ return self.write(cr, uid, ids, {'state': 'done', 'date_finished': time.strftime('%Y-%m-%d %H:%M:%S')})
def test_production_done(self, cr, uid, ids):
""" Tests whether production is done or not.
@@ -861,7 +861,7 @@ class mrp_production(osv.osv):
source = production.product_id.product_tmpl_id.property_stock_production.id
data = {
'name':'PROD:' + production.name,
- 'date_planned': production.date_planned,
+ 'date': production.date_planned,
'product_id': production.product_id.id,
'product_qty': production.product_qty,
'product_uom': production.product_uom.id,
@@ -883,7 +883,7 @@ class mrp_production(osv.osv):
if line.product_id.type in ('product', 'consu'):
res_dest_id = move_obj.create(cr, uid, {
'name':'PROD:' + production.name,
- 'date_planned': production.date_planned,
+ 'date': production.date_planned,
'product_id': line.product_id.id,
'product_qty': line.product_qty,
'product_uom': line.product_uom.id,
@@ -904,7 +904,7 @@ class mrp_production(osv.osv):
'product_uom': line.product_uom.id,
'product_uos_qty': line.product_uos and line.product_uos_qty or False,
'product_uos': line.product_uos and line.product_uos.id or False,
- 'date_planned': newdate,
+ 'date': newdate,
'move_dest_id': res_dest_id,
'location_id': production.location_src_id.id,
'location_dest_id': routing_loc or production.location_src_id.id,
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index 39ecec5ad95..7addfbc3194 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -5,10 +5,9 @@
-
-
+
-
-
-
-
-
-
-
-
-
-
mrp.production.tree
mrp.production
@@ -545,7 +529,7 @@
mrp.production
gantt
-
+
@@ -604,8 +588,8 @@
-
-
+
+
-
-
+
+
@@ -658,8 +642,8 @@
-
-
+
+
-
-
+
+
-
+
diff --git a/addons/mrp/process/procurement_process.xml b/addons/mrp/process/procurement_process.xml
index 5b9c8d8f661..eac65932bc0 100644
--- a/addons/mrp/process/procurement_process.xml
+++ b/addons/mrp/process/procurement_process.xml
@@ -16,7 +16,7 @@
-
+
@@ -26,7 +26,7 @@
-
+
@@ -38,7 +38,7 @@
-
+
@@ -50,7 +50,7 @@
-
+
@@ -62,7 +62,7 @@
-
+
@@ -74,7 +74,7 @@
-
+
@@ -85,7 +85,7 @@
-
+
@@ -118,7 +118,7 @@
Process Transition
-->
-
+
diff --git a/addons/mrp/process/service_product_process.xml b/addons/mrp/process/service_product_process.xml
index 74353d02e8c..281c53c80ee 100644
--- a/addons/mrp/process/service_product_process.xml
+++ b/addons/mrp/process/service_product_process.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/addons/mrp/process/stockable_product_process.xml b/addons/mrp/process/stockable_product_process.xml
index c845801194b..8c07b5c6fb2 100644
--- a/addons/mrp/process/stockable_product_process.xml
+++ b/addons/mrp/process/stockable_product_process.xml
@@ -17,7 +17,7 @@
-->
-
+
@@ -28,7 +28,7 @@
-
+
diff --git a/addons/mrp/report/custom_default.xsl b/addons/mrp/report/custom_default.xsl
index 103128eb9f4..aa5eb22d8e0 100644
--- a/addons/mrp/report/custom_default.xsl
+++ b/addons/mrp/report/custom_default.xsl
@@ -19,8 +19,6 @@
-
- /
1.3cm 28.1cm 20cm 28.1cm
@@ -35,8 +33,6 @@
-
- /
1.3cm 28.1cm 20cm 28.1cm
diff --git a/addons/mrp/report/mrp_production_order.py b/addons/mrp/report/mrp_production_order.py
index 9aeae1781cd..3ad4184c413 100644
--- a/addons/mrp/report/mrp_production_order.py
+++ b/addons/mrp/report/mrp_production_order.py
@@ -51,7 +51,7 @@ class mrp_production_order(osv.osv):
'date_planned':fields.date('Scheduled Date'),
'location_src_id': fields.many2one('stock.location', 'Raw Materials Location', readonly=True),
'date_start': fields.datetime('Start Date',readonly=True),
- 'date_finnished': fields.datetime('End Date',readonly=True),
+ 'date_finished': fields.datetime('End Date',readonly=True),
'location_dest_id': fields.many2one('stock.location', 'Finished Products Location', readonly=True),
'company_id': fields.many2one('res.company','Company',readonly=True),
'bom_id': fields.many2one('mrp.bom', 'Bill of Material',readonly=True),
@@ -100,7 +100,7 @@ class mrp_production_order(osv.osv):
s.routing_id,
s.picking_id,
s.date_start,
- s.date_finnished,
+ s.date_finished,
to_date(to_char(s.date_planned, 'dd-MM-YYYY'),'dd-MM-YYYY') as date_planned,
s.origin,
s.priority,
@@ -128,7 +128,7 @@ class mrp_production_order(osv.osv):
to_date(to_char(s.date_planned, 'dd-MM-YYYY'),'dd-MM-YYYY'),
s.origin,
s.date_start,
- s.date_finnished,
+ s.date_finished,
s.company_id
)""")
mrp_production_order()
diff --git a/addons/mrp/report/mrp_production_order_view.xml b/addons/mrp/report/mrp_production_order_view.xml
index ea1f15bc3ea..6f88981fd5f 100644
--- a/addons/mrp/report/mrp_production_order_view.xml
+++ b/addons/mrp/report/mrp_production_order_view.xml
@@ -58,7 +58,7 @@
@@ -80,7 +80,7 @@
-
+
diff --git a/addons/mrp/report/mrp_report.py b/addons/mrp/report/mrp_report.py
index 6ae1b2e63e5..d677184586e 100644
--- a/addons/mrp/report/mrp_report.py
+++ b/addons/mrp/report/mrp_report.py
@@ -71,7 +71,7 @@ class report_mrp_inout(osv.osv):
create or replace view report_mrp_inout as (
select
min(sm.id) as id,
- to_char(sm.date_planned,'YYYY:IW') as date,
+ to_char(sm.date,'YYYY:IW') as date,
sum(case when (sl.usage='internal') then
pt.standard_price * sm.product_qty
else
@@ -94,7 +94,7 @@ class report_mrp_inout(osv.osv):
where
sm.state in ('waiting','confirmed','assigned')
group by
- to_char(sm.date_planned,'YYYY:IW')
+ to_char(sm.date,'YYYY:IW')
)""")
report_mrp_inout()
diff --git a/addons/mrp/report/mrp_report_view.xml b/addons/mrp/report/mrp_report_view.xml
index 1bf82338cdd..dcb2bcb3566 100644
--- a/addons/mrp/report/mrp_report_view.xml
+++ b/addons/mrp/report/mrp_report_view.xml
@@ -101,7 +101,8 @@
graph,tree
Weekly Stock Value Variation enables you to track stock value evolution as a result of manufacturing activities (consumption of raw materials, production of finished goods, added accounting value of stock by the creation of value following the transformation of products).
-
+
diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv
index 79c5de9a505..e63ced14997 100644
--- a/addons/mrp/security/ir.model.access.csv
+++ b/addons/mrp/security/ir.model.access.csv
@@ -5,12 +5,14 @@
"access_mrp_bom","mrp.bom","model_mrp_bom","group_mrp_user",1,1,1,0
"access_mrp_bom_revision","mrp.bom.revision","model_mrp_bom_revision","group_mrp_user",1,0,0,0
"access_mrp_production","mrp.production user","model_mrp_production","mrp.group_mrp_user",1,1,1,1
+"access_mrp_property_group","mrp.property.group","procurement.model_mrp_property_group","mrp.group_mrp_manager",1,1,1,1
+"access_mrp_property","mrp.property","procurement.model_mrp_property","mrp.group_mrp_manager",1,1,1,1
"access_mrp_production_product_line","mrp.production.product.line","model_mrp_production_product_line","mrp.group_mrp_user",1,1,1,1
"access_procurement","procurement.order","model_procurement_order","mrp.group_mrp_user",1,1,1,1
-"access_mrp_workcenter_manager","mrp.workcenter.manager","model_mrp_workcenter","mrp.group_mrp_manager",1,1,1,1
+"access_mrp_workcenter_manager","mrp.workcenter.manager","model_mrp_workcenter","mrp.group_mrp_manager",1,0,0,0
"access_mrp_routing_manager","mrp.routing.manager","model_mrp_routing","mrp.group_mrp_manager",1,1,1,1
"access_mrp_routing_workcenter_manager","mrp.routing.workcenter.manager","model_mrp_routing_workcenter","mrp.group_mrp_manager",1,1,1,1
-"access_mrp_bom_manager","mrp.bom.manager","model_mrp_bom","mrp.group_mrp_manager",1,0,0,0
+"access_mrp_bom_manager","mrp.bom.manager","model_mrp_bom","mrp.group_mrp_manager",1,0,0,1
"access_mrp_bom_revision_manager","mrp.bom.revision.manager","model_mrp_bom_revision","mrp.group_mrp_manager",1,1,1,1
"access_stock_location_mrp_worker","stock.location mrp_worker","stock.model_stock_location","mrp.group_mrp_user",1,0,0,0
"access_stock_move_mrp_worker","stock.move mrp_worker","stock.model_stock_move","mrp.group_mrp_user",1,1,1,0
@@ -20,14 +22,15 @@
"access_account_account","account.account mrp_worker","account.model_account_account","mrp.group_mrp_user",1,0,0,0
"access_purchase_order_mrp_worker","purchase.order mrp_worker","purchase.model_purchase_order","mrp.group_mrp_user",1,1,1,1
"access_purchase_order_line_mrp_worker","purchase.order.line mrp_worker","purchase.model_purchase_order_line","mrp.group_mrp_user",1,0,0,0
-"access_hr_timesheet_group_mrp_worker","resource.calendar mrp_worker","resource.model_resource_calendar","base.group_system",1,1,1,1
+"access_hr_timesheet_group_mrp_worker","resource.calendar mrp_manager","resource.model_resource_calendar","mrp.group_mrp_manager",1,1,1,1
"access_procurement_stock_worker","procurement.order stock_worker","model_procurement_order","stock.group_stock_user",1,1,1,1
"access_procurement_user","procurement.order.user","model_procurement_order","base.group_user",1,1,1,1
"access_mrp_production_stock_worker","mrp.production stock_worker","model_mrp_production","stock.group_stock_user",1,0,0,0
"access_mrp_production_order","mrp.production.order","model_mrp_production_order","mrp.group_mrp_manager",1,1,1,1
-"access_report_workcenter_load","report.workcenter.load","model_report_workcenter_load","mrp.group_mrp_manager",1,0,0,0
-"access_report_mrp_inout","report.mrp.inout","model_report_mrp_inout","mrp.group_mrp_manager",1,0,0,0
-"access_product_product_manager","product.product manager","model_product_product","mrp.group_mrp_manager",1,1,1,1
+"access_report_workcenter_load","report.workcenter.load","model_report_workcenter_load","mrp.group_mrp_manager",1,1,1,1
+"access_report_mrp_inout","report.mrp.inout","model_report_mrp_inout","mrp.group_mrp_manager",1,1,1,1
+"access_product_product_manager","product.product manager","model_product_product","mrp.group_mrp_manager",1,0,0,0
+"access_ir_property_manager","ir.property manager","base.model_ir_property","mrp.group_mrp_manager",1,1,1,1
"access_account_sequence_fiscalyear","account.sequence.fiscalyear","account.model_account_sequence_fiscalyear","mrp.group_mrp_user",1,1,1,1
"access_product_product_user","product.product user","model_product_product","mrp.group_mrp_user",1,1,1,1
"access_product_template_user","product.template user","product.model_product_template","mrp.group_mrp_user",1,1,1,1
@@ -39,6 +42,7 @@
"access_workcenter_user","mrp.production.workcenter.line.user","model_mrp_production_workcenter_line","mrp.group_mrp_user",1,1,1,1
"access_resource_calendar_leaves_user","mrp.resource.calendar.leaves.user","resource.model_resource_calendar_leaves","mrp.group_mrp_user",1,1,1,1
"access_resource_calendar_leaves_manager","mrp.resource.calendar.leaves.manager","resource.model_resource_calendar_leaves","mrp.group_mrp_manager",1,0,0,0
+"access_resource_calendar_attendance_manager","mrp.resource.calendar.attendance.manager","resource.model_resource_calendar_attendance","mrp.group_mrp_manager",1,1,1,1
"access_product_puom_categ","product.uom.categ","product.model_product_uom_categ","mrp.group_mrp_user",1,1,1,0
"access_resource_resource","resource.resource","resource.model_resource_resource","mrp.group_mrp_user",1,1,1,0
"access_board_board_user","mrp.board.board","board.model_board_board","mrp.group_mrp_user",1,1,1,0
@@ -55,7 +59,7 @@
"access_mrp_production_manager","mrp.production manager","model_mrp_production","mrp.group_mrp_manager",1,0,0,0
"access_procurement_manager","procurement.order","model_procurement_order","mrp.group_mrp_manager",1,0,0,0
"access_workcenter_manager","mrp.production.workcenter.line","model_mrp_production_workcenter_line","mrp.group_mrp_manager",1,0,0,0
-"access_stock_move_mrp_manager","stock.move mrp_manager","stock.model_stock_move","mrp.group_mrp_manager",1,0,0,0
+"access_stock_move_mrp_manager","stock.move mrp_manager","stock.model_stock_move","mrp.group_mrp_manager",1,0,0,1
"access_mrp_production_product_line_manager","mrp.production.product.line manager","model_mrp_production_product_line","mrp.group_mrp_manager",1,0,0,0
"access_account_sequence_fiscalyear_system","account.sequence.fiscalyear.system","account.model_account_sequence_fiscalyear","mrp.group_mrp_manager",1,0,0,0
"access_product_template_system","product.template mgr.system","product.model_product_template","base.group_system",1,0,0,0
@@ -87,6 +91,6 @@
"access_mrp_production_system","mrp.production system","model_mrp_production","base.group_system",1,0,0,0
"access_stock_production_lot_user","stock.production.lot","stock.model_stock_production_lot","mrp.group_mrp_user",1,1,1,1
"access_stock_warehouse_orderpoint_manager","stock.warehouse.orderpoint","procurement.model_stock_warehouse_orderpoint","mrp.group_mrp_manager",1,0,0,0
-"access_stock_picking_mrp_manager","stock.picking mrp_manager","stock.model_stock_picking","mrp.group_mrp_manager",1,1,1,1
+"access_stock_picking_mrp_manager","stock.picking mrp_manager","stock.model_stock_picking","mrp.group_mrp_manager",1,0,0,0
"access_report_mrp_inout_user","report.mrp.inout user","model_report_mrp_inout","mrp.group_mrp_user",1,0,0,0
"access_report_workcenter_load_user","report.workcenter.load.user","model_report_workcenter_load","mrp.group_mrp_user",1,0,0,0
diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py
index 248e39989d8..9f149dda6bd 100644
--- a/addons/mrp/stock.py
+++ b/addons/mrp/stock.py
@@ -79,7 +79,7 @@ class StockMove(osv.osv):
proc_id = procurement_obj.create(cr, uid, {
'name': (move.picking_id.origin or ''),
'origin': (move.picking_id.origin or ''),
- 'date_planned': move.date_planned,
+ 'date_planned': move.date,
'product_id': line['product_id'],
'product_qty': line['product_qty'],
'product_uom': line['product_uom'],
diff --git a/addons/mrp/test/mrp_phantom_bom.yml b/addons/mrp/test/mrp_phantom_bom.yml
index 46b1d19244a..08a0bc31c86 100644
--- a/addons/mrp/test/mrp_phantom_bom.yml
+++ b/addons/mrp/test/mrp_phantom_bom.yml
@@ -230,17 +230,6 @@
wf_service = netsvc.LocalService("workflow")
for p_id in purch_ids:
wf_service.trg_validate(uid, 'purchase.order', p_id, 'purchase_confirm', cr)
--
- I get the approval from both the suppliers. So I approve my purchase orders.
--
- !python {model: purchase.order}: |
- from tools.translate import _
- import netsvc
- purch_ids = self.search(cr, uid, [('state','=','confirmed')])
- assert purch_ids, _('No Confirmed Purchase Orders found!')
- wf_service = netsvc.LocalService("workflow")
- for p_id in purch_ids:
- wf_service.trg_validate(uid, 'purchase.order', p_id, 'purchase_approve', cr)
-
I see two incoming pickings for Orange and Sugar.
-
diff --git a/addons/mrp/test/mrp_procurement.yml b/addons/mrp/test/mrp_procurement.yml
index 7435503bac9..4e01062d7b2 100644
--- a/addons/mrp/test/mrp_procurement.yml
+++ b/addons/mrp/test/mrp_procurement.yml
@@ -177,18 +177,8 @@
purch_ids = self.search(cr, uid, [('partner_id.name','=','Maxtor')])
wf_service = netsvc.LocalService("workflow")
for p_id in purch_ids:
- wf_service.trg_validate(uid, 'purchase.order', p_id, 'purchase_confirm', cr)
--
- I get the approval from the supplier. So I approve my purchase orders.
--
- !python {model: purchase.order}: |
- from tools.translate import _
- import netsvc
- purch_ids = self.search(cr, uid, [('state','=','confirmed')])
- assert purch_ids, _('No Confirmed Purchase Orders found!')
- wf_service = netsvc.LocalService("workflow")
- for p_id in purch_ids:
- wf_service.trg_validate(uid, 'purchase.order', p_id, 'purchase_approve', cr)
+ wf_service.trg_validate(uid, 'purchase.order', p_id, 'purchase_confirm', cr)
+
-
I confirm purchase order for Buttons.
-
@@ -197,18 +187,8 @@
purch_ids = self.search(cr, uid, [('partner_id.name','=','ASUStek')])
wf_service = netsvc.LocalService("workflow")
for p_id in purch_ids:
- wf_service.trg_validate(uid, 'purchase.order', p_id, 'purchase_confirm', cr)
--
- I get the approval from the supplier. So I approve my purchase orders.
--
- !python {model: purchase.order}: |
- from tools.translate import _
- import netsvc
- purch_ids = self.search(cr, uid, [('state','=','confirmed')])
- assert purch_ids, _('No Confirmed Purchase Orders found!')
- wf_service = netsvc.LocalService("workflow")
- for p_id in purch_ids:
- wf_service.trg_validate(uid, 'purchase.order', p_id, 'purchase_approve', cr)
+ wf_service.trg_validate(uid, 'purchase.order', p_id, 'purchase_confirm', cr)
+
-
I Check incoming shipments for cloth. And receive products.
-
@@ -304,7 +284,7 @@
assert prod_ids, _('No Ready Manufacturing Orders found!')
wf_service = netsvc.LocalService("workflow")
for p_id in prod_ids:
- wf_service.trg_validate(uid, 'mrp.production', p_id, 'button_produce', cr)
+ wf_service.trg_validate(uid, 'mrp.production', p_id, 'button_produce', cr)
-
I create record for producing products with quantity 5.00.
-
diff --git a/addons/mrp/wizard/change_production_qty.py b/addons/mrp/wizard/change_production_qty.py
index 5f7aa0754e1..f5d62d535c9 100644
--- a/addons/mrp/wizard/change_production_qty.py
+++ b/addons/mrp/wizard/change_production_qty.py
@@ -87,10 +87,10 @@ class change_production_qty(osv.osv_memory):
factor = prod.product_qty * prod.product_uom.factor / bom_point.product_uom.factor
res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, [])
for r in res[0]:
- if r['product_id']== move.product_id.id:
- move_lines_obj.write(cr, uid,move.id, {'product_qty' : r['product_qty']})
+ if r['product_id'] == move.product_id.id:
+ move_lines_obj.write(cr, uid, [move.id], {'product_qty' : r['product_qty']})
for m in prod.move_created_ids:
- move_lines_obj.write(cr, uid,m.id, {'product_qty': wiz_qty.product_qty})
+ move_lines_obj.write(cr, uid, [m.id], {'product_qty': wiz_qty.product_qty})
return {}
diff --git a/addons/mrp_operations/i18n/ar.po b/addons/mrp_operations/i18n/ar.po
index 0546e0d4ce5..ab7c0e86910 100644
--- a/addons/mrp_operations/i18n/ar.po
+++ b/addons/mrp_operations/i18n/ar.po
@@ -246,7 +246,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/bg.po b/addons/mrp_operations/i18n/bg.po
index f67c785f82e..39a5d93bdb5 100644
--- a/addons/mrp_operations/i18n/bg.po
+++ b/addons/mrp_operations/i18n/bg.po
@@ -248,7 +248,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/bs.po b/addons/mrp_operations/i18n/bs.po
index ff9a28f1473..f1f31cefc6b 100644
--- a/addons/mrp_operations/i18n/bs.po
+++ b/addons/mrp_operations/i18n/bs.po
@@ -246,7 +246,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/ca.po b/addons/mrp_operations/i18n/ca.po
index fd8d311dcc4..6567a54a457 100644
--- a/addons/mrp_operations/i18n/ca.po
+++ b/addons/mrp_operations/i18n/ca.po
@@ -249,7 +249,7 @@ msgid "mrp_operations.operation"
msgstr "mrp_operations.operation"
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/cs.po b/addons/mrp_operations/i18n/cs.po
index 0546e0d4ce5..ab7c0e86910 100644
--- a/addons/mrp_operations/i18n/cs.po
+++ b/addons/mrp_operations/i18n/cs.po
@@ -246,7 +246,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/de.po b/addons/mrp_operations/i18n/de.po
index 2c4800228d0..82d75040b9e 100644
--- a/addons/mrp_operations/i18n/de.po
+++ b/addons/mrp_operations/i18n/de.po
@@ -250,7 +250,7 @@ msgid "mrp_operations.operation"
msgstr "mrp_operations.operation"
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/es.po b/addons/mrp_operations/i18n/es.po
index e973ddb2381..2b0bf5b7c50 100644
--- a/addons/mrp_operations/i18n/es.po
+++ b/addons/mrp_operations/i18n/es.po
@@ -251,7 +251,7 @@ msgid "mrp_operations.operation"
msgstr "mrp_operations.operation"
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/es_AR.po b/addons/mrp_operations/i18n/es_AR.po
index d0589260312..3c140fd1541 100644
--- a/addons/mrp_operations/i18n/es_AR.po
+++ b/addons/mrp_operations/i18n/es_AR.po
@@ -248,7 +248,7 @@ msgid "mrp_operations.operation"
msgstr "mrp_operations.operation"
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/es_EC.po b/addons/mrp_operations/i18n/es_EC.po
index b0caeb9a279..730a921b999 100644
--- a/addons/mrp_operations/i18n/es_EC.po
+++ b/addons/mrp_operations/i18n/es_EC.po
@@ -251,7 +251,7 @@ msgid "mrp_operations.operation"
msgstr "mrp_operations.operation"
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/et.po b/addons/mrp_operations/i18n/et.po
index 493f060565b..de913493585 100644
--- a/addons/mrp_operations/i18n/et.po
+++ b/addons/mrp_operations/i18n/et.po
@@ -247,7 +247,7 @@ msgid "mrp_operations.operation"
msgstr "mrp_operations.operation"
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/fi.po b/addons/mrp_operations/i18n/fi.po
index 0f94be1c01a..27936f066f7 100644
--- a/addons/mrp_operations/i18n/fi.po
+++ b/addons/mrp_operations/i18n/fi.po
@@ -249,7 +249,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/fr.po b/addons/mrp_operations/i18n/fr.po
index 4e818c3655a..a5f40616d0a 100644
--- a/addons/mrp_operations/i18n/fr.po
+++ b/addons/mrp_operations/i18n/fr.po
@@ -248,7 +248,7 @@ msgid "mrp_operations.operation"
msgstr "mrp_operations.operation"
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/hi.po b/addons/mrp_operations/i18n/hi.po
index cdd3e5fd4a4..865f2353a13 100644
--- a/addons/mrp_operations/i18n/hi.po
+++ b/addons/mrp_operations/i18n/hi.po
@@ -247,7 +247,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/hr.po b/addons/mrp_operations/i18n/hr.po
index 0546e0d4ce5..ab7c0e86910 100644
--- a/addons/mrp_operations/i18n/hr.po
+++ b/addons/mrp_operations/i18n/hr.po
@@ -246,7 +246,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/hu.po b/addons/mrp_operations/i18n/hu.po
index 0546e0d4ce5..ab7c0e86910 100644
--- a/addons/mrp_operations/i18n/hu.po
+++ b/addons/mrp_operations/i18n/hu.po
@@ -246,7 +246,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/id.po b/addons/mrp_operations/i18n/id.po
index 064aeb7c14b..871abf389d6 100644
--- a/addons/mrp_operations/i18n/id.po
+++ b/addons/mrp_operations/i18n/id.po
@@ -246,7 +246,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/it.po b/addons/mrp_operations/i18n/it.po
index 379639b9d39..9c93f457091 100644
--- a/addons/mrp_operations/i18n/it.po
+++ b/addons/mrp_operations/i18n/it.po
@@ -249,7 +249,7 @@ msgid "mrp_operations.operation"
msgstr "mrp_operations.operation"
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/ko.po b/addons/mrp_operations/i18n/ko.po
index c4c54b0857b..33a70f940fa 100644
--- a/addons/mrp_operations/i18n/ko.po
+++ b/addons/mrp_operations/i18n/ko.po
@@ -247,7 +247,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/lt.po b/addons/mrp_operations/i18n/lt.po
index 0546e0d4ce5..ab7c0e86910 100644
--- a/addons/mrp_operations/i18n/lt.po
+++ b/addons/mrp_operations/i18n/lt.po
@@ -246,7 +246,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/mrp_operations.pot b/addons/mrp_operations/i18n/mrp_operations.pot
index a1f61b1965d..90df737dde5 100644
--- a/addons/mrp_operations/i18n/mrp_operations.pot
+++ b/addons/mrp_operations/i18n/mrp_operations.pot
@@ -242,7 +242,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/nl.po b/addons/mrp_operations/i18n/nl.po
index 1a7674b11cd..7905b9cc363 100644
--- a/addons/mrp_operations/i18n/nl.po
+++ b/addons/mrp_operations/i18n/nl.po
@@ -247,7 +247,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/nl_BE.po b/addons/mrp_operations/i18n/nl_BE.po
index 6d8bb017f25..173b7601ae9 100644
--- a/addons/mrp_operations/i18n/nl_BE.po
+++ b/addons/mrp_operations/i18n/nl_BE.po
@@ -247,7 +247,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/pl.po b/addons/mrp_operations/i18n/pl.po
index 48b6475b9fd..dd4ff7ee02c 100644
--- a/addons/mrp_operations/i18n/pl.po
+++ b/addons/mrp_operations/i18n/pl.po
@@ -248,7 +248,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/pt.po b/addons/mrp_operations/i18n/pt.po
index 96427a43ff0..d874808086b 100644
--- a/addons/mrp_operations/i18n/pt.po
+++ b/addons/mrp_operations/i18n/pt.po
@@ -247,7 +247,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/pt_BR.po b/addons/mrp_operations/i18n/pt_BR.po
index 731aded6cda..981c5624c8b 100644
--- a/addons/mrp_operations/i18n/pt_BR.po
+++ b/addons/mrp_operations/i18n/pt_BR.po
@@ -248,7 +248,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/ro.po b/addons/mrp_operations/i18n/ro.po
index 54db3294f60..2658a2ce74e 100644
--- a/addons/mrp_operations/i18n/ro.po
+++ b/addons/mrp_operations/i18n/ro.po
@@ -250,7 +250,7 @@ msgid "mrp_operations.operation"
msgstr "mrp_operations.operation"
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/ru.po b/addons/mrp_operations/i18n/ru.po
index 333caa9e4f3..69c0d6fb0a5 100644
--- a/addons/mrp_operations/i18n/ru.po
+++ b/addons/mrp_operations/i18n/ru.po
@@ -248,7 +248,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/sl.po b/addons/mrp_operations/i18n/sl.po
index 81ab1c3b66e..0d012e0211e 100644
--- a/addons/mrp_operations/i18n/sl.po
+++ b/addons/mrp_operations/i18n/sl.po
@@ -247,7 +247,7 @@ msgid "mrp_operations.operation"
msgstr "mrp_operations.operation"
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/sq.po b/addons/mrp_operations/i18n/sq.po
index 27c43ff72cf..d61f3069824 100644
--- a/addons/mrp_operations/i18n/sq.po
+++ b/addons/mrp_operations/i18n/sq.po
@@ -247,7 +247,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/sv.po b/addons/mrp_operations/i18n/sv.po
index 945c20d62cb..52e7c2b59e5 100644
--- a/addons/mrp_operations/i18n/sv.po
+++ b/addons/mrp_operations/i18n/sv.po
@@ -247,7 +247,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/tlh.po b/addons/mrp_operations/i18n/tlh.po
index 5d7551ac4b7..5af1d671159 100644
--- a/addons/mrp_operations/i18n/tlh.po
+++ b/addons/mrp_operations/i18n/tlh.po
@@ -246,7 +246,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/tr.po b/addons/mrp_operations/i18n/tr.po
index bbcb1006500..3643a54ae6a 100644
--- a/addons/mrp_operations/i18n/tr.po
+++ b/addons/mrp_operations/i18n/tr.po
@@ -246,7 +246,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/uk.po b/addons/mrp_operations/i18n/uk.po
index 4f55f459921..fadaf9ba531 100644
--- a/addons/mrp_operations/i18n/uk.po
+++ b/addons/mrp_operations/i18n/uk.po
@@ -247,7 +247,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/vi.po b/addons/mrp_operations/i18n/vi.po
index 38bbfea8310..9fcae413139 100644
--- a/addons/mrp_operations/i18n/vi.po
+++ b/addons/mrp_operations/i18n/vi.po
@@ -247,7 +247,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/zh_CN.po b/addons/mrp_operations/i18n/zh_CN.po
index 8ff3bb9f5b2..d7b5635fcc0 100644
--- a/addons/mrp_operations/i18n/zh_CN.po
+++ b/addons/mrp_operations/i18n/zh_CN.po
@@ -246,7 +246,7 @@ msgid "mrp_operations.operation"
msgstr "运作"
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/i18n/zh_TW.po b/addons/mrp_operations/i18n/zh_TW.po
index b49e5f9d85b..a8c0f97102f 100644
--- a/addons/mrp_operations/i18n/zh_TW.po
+++ b/addons/mrp_operations/i18n/zh_TW.po
@@ -246,7 +246,7 @@ msgid "mrp_operations.operation"
msgstr ""
#. module: mrp_operations
-#: field:mrp.production.workcenter.line,date_finnished:0
+#: field:mrp.production.workcenter.line,date_finished:0
#: field:mrp.production.workcenter.line,date_planned_end:0
#: field:mrp_operations.operation,date_finished:0
msgid "End Date"
diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py
index 3328f24a59f..9585a34df36 100644
--- a/addons/mrp_operations/mrp_operations.py
+++ b/addons/mrp_operations/mrp_operations.py
@@ -67,7 +67,7 @@ class mrp_production_workcenter_line(osv.osv):
@return: Dictionary of values.
"""
ops = self.browse(cr, uid, ids, context=context)
- date_and_hours_by_cal = [(op.date_planned, op.hour, op.workcenter_id.calendar_id.id) for op in ops]
+ date_and_hours_by_cal = [(op.production_id.date_planned, op.hour, op.workcenter_id.calendar_id.id) for op in ops]
intervals = self.pool.get('resource.calendar').interval_get_multi(cr, uid, date_and_hours_by_cal)
res = {}
@@ -95,7 +95,7 @@ class mrp_production_workcenter_line(osv.osv):
'date_planned': fields.datetime('Scheduled Date'),
'date_planned_end': fields.function(_get_date_end, method=True, string='End Date', type='datetime'),
'date_start': fields.datetime('Start Date'),
- 'date_finnished': fields.datetime('End Date'),
+ 'date_finished': fields.datetime('End Date'),
'delay': fields.float('Working Hours',help="This is lead time between operation start and stop in this workcenter",readonly=True),
'production_state':fields.related('production_id','state',
type='selection',
@@ -179,7 +179,7 @@ class mrp_production_workcenter_line(osv.osv):
delay += (date_finished-date_start).days * 24
delay += (date_finished-date_start).seconds / float(60*60)
- self.write(cr, uid, ids, {'state':'done', 'date_finnished': date_now,'delay':delay})
+ self.write(cr, uid, ids, {'state':'done', 'date_finished': date_now,'delay':delay})
self.modify_production_order_state(cr,uid,ids,'done')
return True
@@ -288,7 +288,7 @@ class mrp_production(osv.osv):
dt_end = datetime.strptime(wc.date_planned_end, '%Y-%m-%d %H:%M:%S')
old = wc.sequence or 0
super(mrp_production, self).write(cr, uid, [po.id], {
- 'date_finnished': dt_end
+ 'date_finished': dt_end
})
return dt_end
@@ -306,7 +306,7 @@ class mrp_production(osv.osv):
if l.state in ('done','cancel','draft'):
continue
todo += l.move_dest_id_lines
- if l.production_id and (l.production_id.date_finnished > dt):
+ if l.production_id and (l.production_id.date_finished > dt):
if l.production_id.state not in ('done','cancel'):
for wc in l.production_id.workcenter_lines:
i = self.pool.get('resource.calendar').interval_min_get(
@@ -335,8 +335,8 @@ class mrp_production(osv.osv):
break
if l.production_id.state in ('done','cancel'):
break
- if l.production_id and (l.production_id.date_start < po.date_finnished):
- self.write(cr, uid, [l.production_id.id], {'date_start': po.date_finnished})
+ if l.production_id and (l.production_id.date_start < po.date_finished):
+ self.write(cr, uid, [l.production_id.id], {'date_start': po.date_finished})
break
@@ -511,7 +511,7 @@ class mrp_operations_operation(osv.osv):
if code.start_stop=='done':
self.pool.get('mrp.production.workcenter.line').action_done(cr,uid,wc_op_id)
wf_service.trg_validate(uid, 'mrp.production.workcenter.line', wc_op_id[0], 'button_done', cr)
- self.pool.get('mrp.production').write(cr,uid,vals['production_id'],{'date_finnished':datetime.now().strftime('%Y-%m-%d %H:%M:%S')})
+ self.pool.get('mrp.production').write(cr,uid,vals['production_id'],{'date_finished':datetime.now().strftime('%Y-%m-%d %H:%M:%S')})
if code.start_stop=='pause':
self.pool.get('mrp.production.workcenter.line').action_pause(cr,uid,wc_op_id)
@@ -532,7 +532,7 @@ class mrp_operations_operation(osv.osv):
line_vals['delay'] = delay
if vals.get('date_start',False):
if code.start_stop == 'done':
- line_vals['date_finnished'] = vals['date_start']
+ line_vals['date_finished'] = vals['date_start']
elif code.start_stop == 'start':
line_vals['date_start'] = vals['date_start']
diff --git a/addons/mrp_operations/mrp_operations_view.xml b/addons/mrp_operations/mrp_operations_view.xml
index 7a5a5af3dc9..9a93b67a36f 100644
--- a/addons/mrp_operations/mrp_operations_view.xml
+++ b/addons/mrp_operations/mrp_operations_view.xml
@@ -101,7 +101,7 @@
-
+
@@ -170,7 +170,7 @@
mrp.production.workcenter.line
calendar
-
+
diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py
index f7a6837aace..5848fa7057c 100644
--- a/addons/mrp_repair/mrp_repair.py
+++ b/addons/mrp_repair/mrp_repair.py
@@ -21,7 +21,7 @@
from osv import fields,osv
import netsvc
-from datetime import datetime, date
+from datetime import datetime
from dateutil.relativedelta import relativedelta
from tools.translate import _
import decimal_precision as dp
diff --git a/addons/mrp_repair/test/test_mrp_repair.yml b/addons/mrp_repair/test/test_mrp_repair.yml
index 7d38ab8a94d..1cf82635825 100644
--- a/addons/mrp_repair/test/test_mrp_repair.yml
+++ b/addons/mrp_repair/test/test_mrp_repair.yml
@@ -8,7 +8,6 @@
company_id: base.main_company
date: '2010-06-24 20:10:28'
date_expected: '2010-06-24 20:10:55'
- date_planned: '2010-06-24 20:10:28'
location_dest_id: stock.stock_location_stock
location_id: stock.stock_location_stock
name: '[PC1] Basic PC'
diff --git a/addons/mrp_subproduct/mrp_subproduct.py b/addons/mrp_subproduct/mrp_subproduct.py
index 0478b0d1779..5519bba3a5c 100644
--- a/addons/mrp_subproduct/mrp_subproduct.py
+++ b/addons/mrp_subproduct/mrp_subproduct.py
@@ -83,7 +83,7 @@ class mrp_production(osv.osv):
qty2 *= production.product_uos_qty / (production.bom_id.product_uos_qty or 1.0)
data = {
'name': 'PROD:'+production.name,
- 'date_planned': production.date_planned,
+ 'date': production.date_planned,
'product_id': sub_product.product_id.id,
'product_qty': qty1,
'product_uom': sub_product.product_uom.id,
diff --git a/addons/point_of_sale/i18n/sr.po b/addons/point_of_sale/i18n/sr.po
index 420adea0d1a..98c46039a41 100644
--- a/addons/point_of_sale/i18n/sr.po
+++ b/addons/point_of_sale/i18n/sr.po
@@ -8,226 +8,226 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2009-08-28 16:01+0000\n"
-"PO-Revision-Date: 2009-12-28 10:48+0000\n"
-"Last-Translator: FULL NAME \n"
+"PO-Revision-Date: 2010-10-11 21:13+0000\n"
+"Last-Translator: zmmaj \n"
"Language-Team: Serbian \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-09-29 04:56+0000\n"
+"X-Launchpad-Export-Date: 2010-10-12 04:51+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: point_of_sale
#: rml:pos.details:0
#: rml:pos.details_summary:0
msgid "Total paid"
-msgstr ""
+msgstr "Ukupno placanje"
#. module: point_of_sale
#: rml:pos.details:0
#: rml:pos.details_summary:0
msgid "Qty of product"
-msgstr ""
+msgstr "Kol.proizvoda"
#. module: point_of_sale
#: view:pos.order:0
msgid "Set to draft"
-msgstr ""
+msgstr "Postavi za obradu"
#. module: point_of_sale
#: model:ir.model,name:point_of_sale.model_report_transaction_pos
msgid "transaction for the pos"
-msgstr ""
+msgstr "Transakcija POS-a"
#. module: point_of_sale
#: wizard_view:pos.discount,init:0
#: rml:pos.receipt:0
msgid "Discount :"
-msgstr ""
+msgstr "Popust :"
#. module: point_of_sale
#: wizard_field:pos.payment,ask_pay,payment_nb:0
msgid "Piece number"
-msgstr ""
+msgstr "Br.Komada"
#. module: point_of_sale
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
-msgstr ""
+msgstr "Pogrešno ime modela u definiciji akcije."
#. module: point_of_sale
#: field:pos.order,name:0
msgid "Order Description"
-msgstr ""
+msgstr "Opis Narudzbe"
#. module: point_of_sale
#: model:ir.actions.wizard,name:point_of_sale.pos_scan_product
msgid "Scan Product"
-msgstr ""
+msgstr "Skeniraj Proizvod"
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Document"
-msgstr ""
+msgstr "Dokument"
#. module: point_of_sale
#: wizard_view:pos.add_product,init:0
msgid "Add product :"
-msgstr ""
+msgstr "Dodaj proizvod :"
#. module: point_of_sale
#: rml:pos.lines:0
msgid "Net Total"
-msgstr ""
+msgstr "Neto Ukupno"
#. module: point_of_sale
#: model:ir.ui.menu,name:point_of_sale.menu_action_pos_order_tree2
msgid "Orders of the day"
-msgstr ""
+msgstr "Dnevne narudzbe"
#. module: point_of_sale
#: model:ir.actions.report.xml,name:point_of_sale.pos_details_summary
msgid "Sales (summary)"
-msgstr ""
+msgstr "Prodaja(sumarno)"
#. module: point_of_sale
#: help:pos.order,user_id:0
msgid "This is the logged in user (not necessarily the salesman)."
-msgstr ""
+msgstr "Ovo je prijavljeni korisnik( ne nuzno prodavac)"
#. module: point_of_sale
#: wizard_view:pos.sale.get,init:0
msgid "Select an Open Sale Order"
-msgstr ""
+msgstr "Novi Nalog Prodaje"
#. module: point_of_sale
#: rml:pos.lines:0
msgid "Company"
-msgstr ""
+msgstr "Preduzeće"
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Invoice Date"
-msgstr ""
+msgstr "Datum Fakture"
#. module: point_of_sale
#: rml:pos.receipt:0
msgid ","
-msgstr ""
+msgstr ","
#. module: point_of_sale
#: model:ir.actions.report.xml,name:point_of_sale.pos_lines_detail
msgid "Details of Sales"
-msgstr ""
+msgstr "Detalji Prodaje"
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Base"
-msgstr ""
+msgstr "Osnova"
#. module: point_of_sale
#: wizard_view:pos.scan_product,init:0
msgid "Scan product"
-msgstr ""
+msgstr "Skeniraj proizvod"
#. module: point_of_sale
#: field:pos.order.line,price_subtotal:0
msgid "Subtotal"
-msgstr ""
+msgstr "Међурезултат"
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Partner Ref."
-msgstr ""
+msgstr "Vezani partner"
#. module: point_of_sale
#: rml:pos.receipt:0
msgid "Tel : + 32 (0) 2 231 04 35"
-msgstr ""
+msgstr "Tel : + 32 (0) 2 231 04 35"
#. module: point_of_sale
#: field:pos.order.line,name:0
msgid "Line Description"
-msgstr ""
+msgstr "Opis linije"
#. module: point_of_sale
#: field:pos.order,shop_id:0
msgid "Shop"
-msgstr ""
+msgstr "Prodavnica"
#. module: point_of_sale
#: wizard_button:pos.refund_order,init,refund_n_quit:0
msgid "Ok"
-msgstr ""
+msgstr "U redu"
#. module: point_of_sale
#: view:pos.order:0
#: field:pos.order,note:0
msgid "Notes"
-msgstr ""
+msgstr "Napomene"
#. module: point_of_sale
#: field:stock.picking,pos_order:0
msgid "Pos order"
-msgstr ""
+msgstr "Pos narudzba"
#. module: point_of_sale
#: rml:pos.details:0
#: rml:pos.details_summary:0
msgid "Detail of Sales"
-msgstr ""
+msgstr "Detalji Prodaje"
#. module: point_of_sale
#: rml:pos.invoice:0
#: rml:pos.lines:0
#: field:pos.order,amount_tax:0
msgid "Taxes"
-msgstr ""
+msgstr "Porezi"
#. module: point_of_sale
#: model:ir.actions.act_window,name:point_of_sale.action_pos_order_line
#: model:ir.actions.act_window,name:point_of_sale.action_pos_order_line_day
msgid "Sale line"
-msgstr ""
+msgstr "Linija prodaje"
#. module: point_of_sale
#: rml:pos.lines:0
msgid "No. Of Articles"
-msgstr ""
+msgstr "Br.Artikala"
#. module: point_of_sale
#: field:pos.config.journal,code:0
#: rml:pos.details:0
msgid "Code"
-msgstr ""
+msgstr "Kod"
#. module: point_of_sale
#: field:pos.order,date_validity:0
#: wizard_field:pos.refund_order,init,date_validity:0
msgid "Validity Date"
-msgstr ""
+msgstr "Rok Vazenja"
#. module: point_of_sale
#: view:pos.order:0
#: field:pos.order,pickings:0
msgid "Picking"
-msgstr ""
+msgstr "Biranje"
#. module: point_of_sale
#: rml:pos.details:0
#: rml:pos.lines:0
msgid "VAT"
-msgstr ""
+msgstr "PDV"
#. module: point_of_sale
#: model:ir.actions.wizard,name:point_of_sale.pos_refund
msgid "Refund Orders"
-msgstr ""
+msgstr "Refundiraj narudzbe"
#. module: point_of_sale
#: field:pos.order,last_out_picking:0
msgid "Last Output Picking"
-msgstr ""
+msgstr "Izlaz zadnjeg biranja"
#. module: point_of_sale
#: wizard_view:pos.config.journal,init:0
@@ -238,48 +238,48 @@ msgstr ""
#: rml:pos.details:0
#: rml:pos.receipt:0
msgid "Qty"
-msgstr ""
+msgstr "Kol."
#. module: point_of_sale
#: field:pos.order,user_id:0
msgid "Logged in User"
-msgstr ""
+msgstr "Logovani korisnik"
#. module: point_of_sale
#: rml:pos.details:0
msgid "VAT(%)"
-msgstr ""
+msgstr "PDV(%)"
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Tax"
-msgstr ""
+msgstr "Porez"
#. module: point_of_sale
#: view:report.transaction.pos:0
msgid "Total Transaction"
-msgstr ""
+msgstr "Ukupna Transakcija"
#. module: point_of_sale
#: rml:pos.details:0
msgid "Disc"
-msgstr ""
+msgstr "Disk"
#. module: point_of_sale
#: rml:pos.invoice:0
#: rml:pos.receipt:0
msgid "Fax :"
-msgstr ""
+msgstr "Faks:"
#. module: point_of_sale
#: wizard_view:pos.scan_product,init:0
msgid "Scan Barcode"
-msgstr ""
+msgstr "Skeniraj Bar-Kod"
#. module: point_of_sale
#: field:pos.order,partner_id:0
msgid "Partner"
-msgstr ""
+msgstr "Partner"
#. module: point_of_sale
#: field:pos.order,payments:0
@@ -289,94 +289,94 @@ msgstr ""
#. module: point_of_sale
#: rml:pos.receipt:0
msgid "Date :"
-msgstr ""
+msgstr "Datum :"
#. module: point_of_sale
#: view:pos.order:0
msgid "Ma_ke Payment"
-msgstr ""
+msgstr "Izvrsi Uplatu"
#. module: point_of_sale
#: model:ir.actions.wizard,name:point_of_sale.pos_confirm
#: wizard_button:pos.sale.get,init,set:0
msgid "Confirm"
-msgstr ""
+msgstr "Potvrdi"
#. module: point_of_sale
#: view:pos.order:0
msgid "POS Orders"
-msgstr ""
+msgstr "POS Narudzbe"
#. module: point_of_sale
#: rml:pos.lines:0
msgid "Disc. (%)"
-msgstr ""
+msgstr "Popust (%)"
#. module: point_of_sale
#: rml:pos.details:0
#: rml:pos.details_summary:0
msgid "Sales total"
-msgstr ""
+msgstr "Prodaja Ukupno"
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Supplier Invoice"
-msgstr ""
+msgstr "Račun dobavljača"
#. module: point_of_sale
#: field:pos.order,state:0
msgid "State"
-msgstr ""
+msgstr "Stanje"
#. module: point_of_sale
#: view:pos.order.line:0
msgid "Sum of subtotals"
-msgstr ""
+msgstr "Suma Medjuzbirova"
#. module: point_of_sale
#: wizard_field:pos.payment,ask_pay,payment_date:0
msgid "Payment date"
-msgstr ""
+msgstr "Datum Isplate"
#. module: point_of_sale
#: wizard_field:pos.payment,ask_pay,payment_name:0
msgid "Payment name"
-msgstr ""
+msgstr "Naziv Isplate"
#. module: point_of_sale
#: field:pos.order,lines:0
msgid "Order Lines"
-msgstr ""
+msgstr "Stavke naloga"
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Disc.(%)"
-msgstr ""
+msgstr "Popust(%)"
#. module: point_of_sale
#: model:ir.module.module,shortdesc:point_of_sale.module_meta_information
msgid "Point Of Sale"
-msgstr ""
+msgstr "Mesto Prodaje"
#. module: point_of_sale
#: field:pos.order.line,create_date:0
msgid "Creation Date"
-msgstr ""
+msgstr "Datum kreiranja"
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "PRO-FORMA"
-msgstr ""
+msgstr "PRO-FORMA"
#. module: point_of_sale
#: model:ir.ui.menu,name:point_of_sale.menu_point_rep
msgid "Reporting"
-msgstr ""
+msgstr "Izveštavanje"
#. module: point_of_sale
#: view:report.transaction.pos:0
msgid "POS "
-msgstr ""
+msgstr "POS "
#. module: point_of_sale
#: model:ir.model,name:point_of_sale.model_pos_config_journal
@@ -386,7 +386,7 @@ msgstr ""
#. module: point_of_sale
#: rml:pos.receipt:0
msgid "Total :"
-msgstr ""
+msgstr "Ukupno:"
#. module: point_of_sale
#: wizard_field:pos.config.journal,init,default_journal:0
@@ -406,19 +406,19 @@ msgstr ""
#. module: point_of_sale
#: model:ir.ui.menu,name:point_of_sale.menu_point_config
msgid "Configuration"
-msgstr ""
+msgstr "Podešavanje"
#. module: point_of_sale
#: rml:pos.invoice:0
#: rml:pos.lines:0
#: field:pos.order.line,price_unit:0
msgid "Unit Price"
-msgstr ""
+msgstr "Cena komada"
#. module: point_of_sale
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
-msgstr ""
+msgstr "Nevažeći XML za pregled arhitekture"
#. module: point_of_sale
#: model:ir.ui.menu,name:point_of_sale.menu_action_pos_order_line_day
@@ -428,7 +428,7 @@ msgstr ""
#. module: point_of_sale
#: field:pos.order,nb_print:0
msgid "Number of Print"
-msgstr ""
+msgstr "Br. za Stampu"
#. module: point_of_sale
#: model:ir.ui.menu,name:point_of_sale.menu_wizard_default_journal
@@ -438,12 +438,12 @@ msgstr ""
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Draft Invoice"
-msgstr ""
+msgstr "Nacrti računa"
#. module: point_of_sale
#: field:pos.order.line,discount:0
msgid "Discount (%)"
-msgstr ""
+msgstr "Popust (%)"
#. module: point_of_sale
#: rml:pos.invoice:0
@@ -453,12 +453,12 @@ msgstr ""
#. module: point_of_sale
#: model:ir.actions.wizard,name:point_of_sale.pos_add_product
msgid "Add products"
-msgstr ""
+msgstr "Dodaj proizvod"
#. module: point_of_sale
#: view:pos.order.line:0
msgid "Total qty"
-msgstr ""
+msgstr "Ukupna kol."
#. module: point_of_sale
#: model:ir.ui.menu,name:point_of_sale.menu_action_pos_order_line
@@ -483,18 +483,18 @@ msgstr ""
#: model:ir.ui.menu,name:point_of_sale.menu_point_ofsale
#: model:ir.ui.menu,name:point_of_sale.menu_point_root
msgid "Point of Sale"
-msgstr ""
+msgstr "Mesto Prodaje"
#. module: point_of_sale
#: field:pos.order,salesman_id:0
msgid "Salesman"
-msgstr ""
+msgstr "Prodavac"
#. module: point_of_sale
#: rml:pos.details:0
#: selection:pos.order,state:0
msgid "Invoiced"
-msgstr ""
+msgstr "Fakturisani"
#. module: point_of_sale
#: wizard_field:pos.config.journal,init,default_journal_rebate:0
@@ -510,27 +510,27 @@ msgstr ""
#: rml:pos.details:0
#: rml:pos.details_summary:0
msgid "Total of the day"
-msgstr ""
+msgstr "Dnevni pazar"
#. module: point_of_sale
#: wizard_button:pos.scan_product,init,add:0
msgid "Add"
-msgstr ""
+msgstr "Dodaj"
#. module: point_of_sale
#: selection:pos.order,state:0
msgid "Draft"
-msgstr ""
+msgstr "Priprema"
#. module: point_of_sale
#: selection:pos.order,state:0
msgid "Paid"
-msgstr ""
+msgstr "Plaćeni"
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "VAT :"
-msgstr ""
+msgstr "PDV :"
#. module: point_of_sale
#: view:pos.order.line:0
@@ -540,24 +540,24 @@ msgstr ""
#. module: point_of_sale
#: rml:pos.receipt:0
msgid "E-mail :"
-msgstr ""
+msgstr "E-mail :"
#. module: point_of_sale
#: rml:pos.details:0
#: rml:pos.details_summary:0
msgid "Total invoiced"
-msgstr ""
+msgstr "Ukupno fakturisano"
#. module: point_of_sale
#: model:ir.ui.menu,name:point_of_sale.menu_trans_pos_tree_today
msgid "Sales of the day"
-msgstr ""
+msgstr "Dnevni promet"
#. module: point_of_sale
#: field:pos.order,amount_paid:0
#: field:pos.order,amount_return:0
msgid "unknown"
-msgstr ""
+msgstr "nepoznato"
#. module: point_of_sale
#: view:pos.order.line:0
@@ -567,28 +567,28 @@ msgstr ""
#. module: point_of_sale
#: model:ir.actions.wizard,name:point_of_sale.pos_discount
msgid "Discount"
-msgstr ""
+msgstr "Popust"
#. module: point_of_sale
#: field:report.transaction.pos,user_id:0
msgid "User"
-msgstr ""
+msgstr "Корисник"
#. module: point_of_sale
#: field:pos.payment,payment_date:0
msgid "Payment Date"
-msgstr ""
+msgstr "Datum Isplate"
#. module: point_of_sale
#: field:pos.payment,payment_name:0
msgid "Payment Name"
-msgstr ""
+msgstr "Naziv Isplate"
#. module: point_of_sale
#: rml:pos.details:0
#: field:report.transaction.pos,date_create:0
msgid "Date"
-msgstr ""
+msgstr "Datum"
#. module: point_of_sale
#: model:ir.actions.act_window,name:point_of_sale.action_trans_pos_tree
@@ -601,44 +601,44 @@ msgstr ""
#: wizard_button:pos.add_product,init,add:0
#: view:pos.order:0
msgid "_Add product"
-msgstr ""
+msgstr "_Dodaj proizvod"
#. module: point_of_sale
#: rml:pos.receipt:0
msgid ":"
-msgstr ""
+msgstr ":"
#. module: point_of_sale
#: rml:pos.details:0
#: rml:pos.details_summary:0
msgid "Period:"
-msgstr ""
+msgstr "Period:"
#. module: point_of_sale
#: model:ir.ui.menu,name:point_of_sale.menu_trans_pos_tree
msgid "All the sales"
-msgstr ""
+msgstr "Sve Prodaje"
#. module: point_of_sale
#: view:pos.order:0
msgid "Compute"
-msgstr ""
+msgstr "Izracunaj"
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Total:"
-msgstr ""
+msgstr "Ukupno:"
#. module: point_of_sale
#: rml:pos.details:0
#: rml:pos.details_summary:0
msgid "Summary"
-msgstr ""
+msgstr "Sumarno"
#. module: point_of_sale
#: view:pos.order:0
msgid "Create _Invoice"
-msgstr ""
+msgstr "Kreiraj_Fakturu"
#. module: point_of_sale
#: wizard_field:pos.add_product,init,quantity:0
@@ -646,68 +646,68 @@ msgstr ""
#: rml:pos.lines:0
#: field:pos.order.line,qty:0
msgid "Quantity"
-msgstr ""
+msgstr "Količina"
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Refund"
-msgstr ""
+msgstr "Refundiraj"
#. module: point_of_sale
#: rml:pos.details:0
#: rml:pos.details_summary:0
msgid "Mode of payment"
-msgstr ""
+msgstr "Nacin placanja"
#. module: point_of_sale
#: wizard_button:pos.payment,ask_pay,add_pay:0
msgid "Ma_ke payment"
-msgstr ""
+msgstr "Izvrsi Isplatu"
#. module: point_of_sale
#: wizard_button:pos.discount,init,apply_discount:0
msgid "Apply Discount"
-msgstr ""
+msgstr "Prihvati Popust"
#. module: point_of_sale
#: field:pos.order,pricelist_id:0
msgid "Pricelist"
-msgstr ""
+msgstr "Cenovnik"
#. module: point_of_sale
#: wizard_field:pos.discount,init,discount:0
msgid "Discount percentage"
-msgstr ""
+msgstr "Procenat popusta"
#. module: point_of_sale
#: model:ir.actions.report.xml,name:point_of_sale.pos_receipt
msgid "Receipt"
-msgstr ""
+msgstr "Racun"
#. module: point_of_sale
#: wizard_view:pos.refund_order,init:0
msgid "Refund order :"
-msgstr ""
+msgstr "Redosled refundiranja:"
#. module: point_of_sale
#: field:report.transaction.pos,no_trans:0
msgid "Number of Transaction"
-msgstr ""
+msgstr "Broj Transakcija"
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Net Total:"
-msgstr ""
+msgstr "Neto Ukupno"
#. module: point_of_sale
#: view:pos.order:0
msgid "Other"
-msgstr ""
+msgstr "Drugo"
#. module: point_of_sale
#: selection:pos.order,state:0
msgid "Done"
-msgstr ""
+msgstr "Gotovo"
#. module: point_of_sale
#: model:ir.actions.report.xml,name:point_of_sale.pos_invoice_report
@@ -716,7 +716,7 @@ msgstr ""
#: wizard_field:pos.payment,ask_pay,invoice_wanted:0
#: field:report.transaction.pos,invoice_id:0
msgid "Invoice"
-msgstr ""
+msgstr "Račun"
#. module: point_of_sale
#: wizard_button:pos.add_product,init,end:0
@@ -729,12 +729,12 @@ msgstr ""
#: wizard_button:pos.sale.get,init,end:0
#: wizard_button:pos.scan_product,init,end:0
msgid "Cancel"
-msgstr ""
+msgstr "Otkaži"
#. module: point_of_sale
#: view:pos.order:0
msgid "Close"
-msgstr ""
+msgstr "Zatvori"
#. module: point_of_sale
#: view:pos.order:0
@@ -750,34 +750,35 @@ msgstr ""
#. module: point_of_sale
#: wizard_view:pos.payment,ask_pay:0
msgid "Add payment :"
-msgstr ""
+msgstr "Dodaj Placanje :"
#. module: point_of_sale
#: constraint:ir.model:0
msgid ""
"The Object name must start with x_ and not contain any special character !"
msgstr ""
+"Ime objekta mora da počne sa x_ i ne sme da sadrži specijalne karaktere !"
#. module: point_of_sale
#: model:ir.model,name:point_of_sale.model_pos_payment
msgid "Pos Payment"
-msgstr ""
+msgstr "POS Isplate"
#. module: point_of_sale
#: rml:pos.details:0
#: rml:pos.details_summary:0
msgid "Total discount"
-msgstr ""
+msgstr "Popust Ukupno"
#. module: point_of_sale
#: field:pos.order,invoice_wanted:0
msgid "Create Invoice"
-msgstr ""
+msgstr "Kreiranje računa"
#. module: point_of_sale
#: wizard_view:pos.refund_order,init:0
msgid "Refund "
-msgstr ""
+msgstr "Refunidraj "
#. module: point_of_sale
#: model:ir.model,name:point_of_sale.model_pos_order_line
@@ -787,25 +788,25 @@ msgstr ""
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Taxes:"
-msgstr ""
+msgstr "Porezi:"
#. module: point_of_sale
#: view:pos.order:0
#: view:report.transaction.pos:0
msgid "Amount total"
-msgstr ""
+msgstr "Ukupan Iznos"
#. module: point_of_sale
#: wizard_field:pos.add_product,init,product:0
#: rml:pos.details:0
#: field:pos.order.line,product_id:0
msgid "Product"
-msgstr ""
+msgstr "Proizvod"
#. module: point_of_sale
#: view:pos.order:0
msgid "Invoicing"
-msgstr ""
+msgstr "Fakturisanje"
#. module: point_of_sale
#: field:pos.config.journal,journal_id:0
@@ -814,22 +815,22 @@ msgstr ""
#: field:pos.payment,journal_id:0
#: field:report.transaction.pos,journal_id:0
msgid "Journal"
-msgstr ""
+msgstr "Dnevnik"
#. module: point_of_sale
#: wizard_field:pos.scan_product,init,gencod:0
msgid "Barcode"
-msgstr ""
+msgstr "Bar-Kod"
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Canceled Invoice"
-msgstr ""
+msgstr "Otkazani Racuni"
#. module: point_of_sale
#: view:report.transaction.pos:0
msgid "POS"
-msgstr ""
+msgstr "POS"
#. module: point_of_sale
#: model:ir.actions.report.xml,name:point_of_sale.pos_lines_report
@@ -839,12 +840,12 @@ msgstr ""
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Tel. :"
-msgstr ""
+msgstr "Tel.:"
#. module: point_of_sale
#: field:pos.payment,payment_nb:0
msgid "Piece Number"
-msgstr ""
+msgstr "Br. Komada"
#. module: point_of_sale
#: wizard_field:pos.config.journal,init,default_journal_gift:0
@@ -855,42 +856,42 @@ msgstr ""
#: model:ir.actions.wizard,name:point_of_sale.pos_payment
#: view:pos.order:0
msgid "Payment"
-msgstr ""
+msgstr "Isplata"
#. module: point_of_sale
#: model:ir.ui.menu,name:point_of_sale.menu_action_pos_order_tree3
msgid "All orders"
-msgstr ""
+msgstr "Sve porudzbine"
#. module: point_of_sale
#: wizard_field:pos.sale.get,init,picking_id:0
msgid "Sale Order"
-msgstr ""
+msgstr "Narudžbenica"
#. module: point_of_sale
#: model:ir.ui.menu,name:point_of_sale.menu_trans_pos_tree_month
msgid "Sales of the month"
-msgstr ""
+msgstr "Mesecna prodaja"
#. module: point_of_sale
#: view:pos.order:0
msgid "D_iscount"
-msgstr ""
+msgstr "P_opust"
#. module: point_of_sale
#: field:pos.order,date_order:0
msgid "Date Ordered"
-msgstr ""
+msgstr "Datum naručivanja"
#. module: point_of_sale
#: view:pos.order:0
msgid "Payments"
-msgstr ""
+msgstr "Isplate"
#. module: point_of_sale
#: rml:pos.invoice:0
msgid "Supplier Refund"
-msgstr ""
+msgstr "Povraćaj dobavljača"
#. module: point_of_sale
#: field:pos.config.journal,name:0
@@ -899,18 +900,18 @@ msgstr ""
#: field:pos.payment,name:0
#: rml:pos.receipt:0
msgid "Description"
-msgstr ""
+msgstr "Opis"
#. module: point_of_sale
#: field:pos.order,account_move:0
msgid "Account Entry"
-msgstr ""
+msgstr "Sadrzaj Naloga"
#. module: point_of_sale
#: wizard_field:pos.payment,ask_pay,payment_id:0
#: field:pos.payment,payment_id:0
msgid "Payment Term"
-msgstr ""
+msgstr "Uslovi plaćanja"
#. module: point_of_sale
#: rml:pos.invoice:0
@@ -918,12 +919,12 @@ msgstr ""
#: wizard_field:pos.payment,ask_pay,amount:0
#: field:report.transaction.pos,amount:0
msgid "Amount"
-msgstr ""
+msgstr "Iznos"
#. module: point_of_sale
#: view:pos.order:0
msgid "Actions"
-msgstr ""
+msgstr "Radnje"
#. module: point_of_sale
#: help:pos.order,salesman_id:0
@@ -934,35 +935,35 @@ msgstr ""
#: rml:pos.details:0
#: rml:pos.details_summary:0
msgid "Mode of Taxes"
-msgstr ""
+msgstr "Vrste Poreza"
#. module: point_of_sale
#: rml:pos.details:0
#: rml:pos.details_summary:0
msgid "Print Date:"
-msgstr ""
+msgstr "Datum Stampe"
#. module: point_of_sale
#: rml:pos.details:0
#: rml:pos.details_summary:0
msgid "Company:"
-msgstr ""
+msgstr "Firma:"
#. module: point_of_sale
#: rml:pos.lines:0
msgid "Print Date"
-msgstr ""
+msgstr "Datum Stampe"
#. module: point_of_sale
#: rml:pos.receipt:0
msgid "OPERATION N° :"
-msgstr ""
+msgstr "Br.OPERACIJE :"
#. module: point_of_sale
#: rml:pos.lines:0
#: field:pos.order,amount_total:0
msgid "Total"
-msgstr ""
+msgstr "Ukupno"
#. module: point_of_sale
#: rml:pos.details:0
@@ -970,4 +971,4 @@ msgstr ""
#: rml:pos.lines:0
#: rml:pos.receipt:0
msgid "Price"
-msgstr ""
+msgstr "Cena"
diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py
index 3b5f235251f..a5bdf5ec0f8 100644
--- a/addons/point_of_sale/pos.py
+++ b/addons/point_of_sale/pos.py
@@ -175,9 +175,8 @@ class pos_order(osv.osv):
cur_obj = self.pool.get('res.currency')
cur = order.pricelist_id.currency_id
for payment in order.statement_ids:
- res[order.id]['amount_paid'] += payment.amount
- for payment in order.payments:
- res[order.id]['amount_return'] += (payment.amount < 0 and payment.amount or 0)
+ res[order.id]['amount_paid'] += payment.amount
+ res[order.id]['amount_return'] += (payment.amount < 0 and payment.amount or 0)
for line in order.lines:
if order.price_type!='tax_excluded':
res[order.id]['amount_tax'] = reduce(lambda x, y: x+round(y['amount'], 2),
@@ -221,7 +220,6 @@ class pos_order(osv.osv):
default = {}
default.update({
'state': 'draft',
- 'payments': [],
'partner_id': False,
'invoice_id': False,
'account_move': False,
@@ -285,7 +283,6 @@ class pos_order(osv.osv):
('tax_excluded','Tax excluded')
], 'Price method', required=True),
'statement_ids': fields.one2many('account.bank.statement.line','pos_statement_id','Payments',states={'draft': [('readonly', False)]},readonly=True),
- 'payments': fields.one2many('pos.payment', 'order_id', 'Order Payments', states={'draft': [('readonly', False)]}, readonly=True),
'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True, states={'draft': [('readonly', False)]}, readonly=True),
'partner_id': fields.many2one( 'res.partner', 'Customer', change_default=True, select=1, states={'draft': [('readonly', False)], 'paid': [('readonly', False)]}),
'state': fields.selection([('draft', 'Quotation'), ('payment', 'Payment'),
@@ -1046,6 +1043,7 @@ class pos_order_line(osv.osv):
tax_amount = 0.0
taxes = [t for t in line.product_id.taxes_id]
if line.qty == 0.0:
+ res[line.id][f] = 0.0
continue
computed_taxes = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit, line.qty)['taxes']
for tax in computed_taxes:
@@ -1265,55 +1263,6 @@ class pos_order_line(osv.osv):
pos_order_line()
-
-class pos_payment(osv.osv):
- _name = 'pos.payment'
- _description = 'Pos Payment'
-
- def _journal_get(self, cr, uid, context=None):
- obj = self.pool.get('account.journal')
- ids = obj.search(cr, uid, [('type', '=', 'cash')])
- res = obj.read(cr, uid, ids, ['id', 'name'], context)
- res = [(r['id'], r['name']) for r in res]
- return res
-
- def _journal_default(self, cr, uid, context=None):
- journal_list = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash')])
- if journal_list:
- return journal_list[0]
- else:
- return False
-
- _columns = {
- 'name': fields.char('Description', size=64),
- 'order_id': fields.many2one('pos.order', 'Order Ref', required=True, ondelete='cascade'),
- 'journal_id': fields.many2one('account.journal', "Journal", required=True),
- 'payment_id': fields.many2one('account.payment.term','Payment Term', select=True),
- 'payment_nb': fields.char('Piece Number', size=32),
- 'payment_name': fields.char('Payment Name', size=32),
- 'payment_date': fields.date('Payment Date', required=True),
- 'amount': fields.float('Amount', required=True),
- }
- _defaults = {
- 'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'pos.payment'),
- 'journal_id': _journal_default,
- 'payment_date': lambda *a: time.strftime('%Y-%m-%d'),
- }
-
- def create(self, cr, user, vals, context=None):
- if vals.get('journal_id') and vals.get('amount'):
- return super(pos_payment, self).create(cr, user, vals, context)
- return False
-
- def write(self, cr, user, ids, values, context=None):
- if 'amount' in values and not values['amount']:
- return False
- if 'journal_id' in values and not values['journal_id']:
- return False
- return super(pos_payment, self).write(cr, user, ids, values, context)
-
-pos_payment()
-
class product_product(osv.osv):
_inherit = 'product.product'
_columns = {
diff --git a/addons/point_of_sale/pos_demo.xml b/addons/point_of_sale/pos_demo.xml
index 80ba3d24397..913a2907e03 100644
--- a/addons/point_of_sale/pos_demo.xml
+++ b/addons/point_of_sale/pos_demo.xml
@@ -1,7 +1,140 @@
-
+
+ POS/019
+ POS/019
+ SAJ/2010/010
+
+
+
+
+
+ none
+
+ open
+ out_invoice
+ SAJ/2010/010
+
+
+
+ /
+ 2010-10-07
+
+
+
+
+
+ Invoice from POS: POS/019
+
+
+
+
+ [PC1] Basic PC
+
+
+
+
+
+
+
+
+
+
+
+
+ 2011-04-07
+
+
+ 2010-10-07 16:53:11
+
+
+
+
+
+ paid
+
+
+ 2010-10-07
+ POS/019
+ tax_excluded
+
+
+
+
+
+
+ 10
+ open
+
+
+
+ 2010-10-07
+
+
+
+
+ general
+
+
+
+ Cash Journal - (test)
+
+ 2010-10-07
+
+
+
+ Payment POS/019
+
+
+
+
+ POS/019
+
+ 2010-10-07 16:53:46
+
+ direct
+
+ POS notes
+ done
+ out
+ 2010-10-07 16:53:46
+ 2010-10-07 16:33:30
+ OUT/00019
+ none
+ 2010-10-07 16:53:46
+
+
+ POS/019
+
+
+
+
+
+ 1
+
+
+ done
+
+ 2010-10-07 16:33:30
+ 2010-10-07 16:33:30
+ Stock move (POS 12)
+
+
+ 2010-10-07 16:53:46
+
+
+
+
+ No Discount
+
+
+
+
+
+ Order Line/07
+
+
diff --git a/addons/point_of_sale/pos_report.xml b/addons/point_of_sale/pos_report.xml
index b079f6b9177..3e6a265b34e 100644
--- a/addons/point_of_sale/pos_report.xml
+++ b/addons/point_of_sale/pos_report.xml
@@ -9,7 +9,7 @@
name="pos.invoice"
auto="False"
multi="True"
- rml="account/report/invoice.rml"
+ rml="account/report/account_print_invoice.rml"
/>
3
-
- POS Payment
- pos.payment
-
-
- POS Payment
- pos.payment
- Payment/
- 2
-
-
POS order line
pos.order.line
diff --git a/addons/point_of_sale/pos_view.xml b/addons/point_of_sale/pos_view.xml
index 17420b1ffe9..7453682f566 100644
--- a/addons/point_of_sale/pos_view.xml
+++ b/addons/point_of_sale/pos_view.xml
@@ -706,7 +706,7 @@
+ id="menu_point_config_product" sequence="25" groups="base.group_system,group_pos_manager"/>
Products
@@ -732,7 +732,7 @@
parent="menu_point_config_product"
action="action_product_input"
id="products_for_input_operations"
- groups="base.group_system"/>
+ groups="base.group_system,group_pos_manager"/>
Products
@@ -758,7 +758,7 @@
parent="menu_point_config_product"
action="action_product_output"
id="products_for_output_operations"
- groups="base.group_system"/>
+ groups="base.group_system,group_pos_manager"/>
-
+
@@ -78,16 +78,19 @@
-
+
-
+
+
+
+
@@ -98,9 +101,6 @@
-
-
-
@@ -137,23 +137,8 @@
[[ repeatIn(objects,'statement') ]]
-
-
-
-
-
-
-
-
-
- Statement
-
-
-
-
-
-
-
+ Statement
+
Statement Name
@@ -169,7 +154,7 @@
-
+
[[ statement.name ]]
@@ -188,10 +173,7 @@
-
-
-
-
+
Opening Date
@@ -207,29 +189,26 @@
-
+
[[ formatLang(statement.date,date=True) ]]
- [[ formatLang(statement.closing_date,date=True) ]]
+ [[ formatLang(statement.closing_date,date_time=True)]]
- [[ formatLang(statement.balance_start, digits=get_digits(dp='Account')) ]][[ company.currency_id.symbol ]]
+ [[ formatLang(statement.balance_start)]] [[ company.currency_id.symbol ]]
- [[ formatLang(statement.balance_end_real, digits=get_digits(dp='Account')) ]][[ company.currency_id.symbol ]]
+ [[ formatLang(statement.balance_end_real)]] [[ company.currency_id.symbol ]]
-
-
-
-
+
Name
@@ -238,38 +217,41 @@
Partner
- Amount ([[ company.currency_id.code ]])
+ Amount
-
+
+ [[ repeatIn(statement.line_ids,'line_ids') and ' ' or removeParentNode('blockTable') ]]
+
+ [[ repeatIn(get_data(statement), 'line_ids')]]
+
+
+
+ [[ line_ids.name ]]
+
+
+ [[ line_ids.partner_id.name ]]
+
+
+ [[ formatLang(line_ids.amount) ]] [[ company.currency_id.symbol ]]
+
+
+
+
+
+
- [[ repeatIn(statement.line_ids,'line_ids') and ' ' or removeParentNode('blockTable') ]]
- [[ repeatIn(get_data(statement), 'line_ids')]]
-
- [[ line_ids['name'] ]]
-
-
- [[ line_ids.partner_id.name ]]
-
-
- [[ formatLang(line_ids.amount, digits=get_digits(dp='Account')) ]][[ company.currency_id.symbol ]]
-
-
-
-
-
-
-
+
- Total :
+ Total :
- [[ formatLang(get_total(statement.line_ids), digits=get_digits(dp='Account')) ]][[ company.currency_id.symbol ]]
+ [[ formatLang(get_total(statement.line_ids)) ]] [[ company.currency_id.symbol ]]
@@ -283,4 +265,4 @@
-
+
\ No newline at end of file
diff --git a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py
index 28b96f7aebe..337a121bd41 100644
--- a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py
+++ b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py
@@ -26,7 +26,7 @@ from report import report_sxw
class all_closed_cashbox_of_the_day(report_sxw.rml_parse):
#TOFIX: sql injection problem: SQL Request must be pass from sql injection...
def __init__(self, cr, uid, name, context):
- super(all_closed_cashbox_of_the_day, self).__init__(cr, uid, name, context)
+ super(all_closed_cashbox_of_the_day, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'get_data':self._get_data,
diff --git a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml
index f75c08dbadb..7013ddcfb6f 100644
--- a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml
+++ b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.rml
@@ -2,7 +2,7 @@
-
+
@@ -10,134 +10,86 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
+
+
@@ -151,34 +103,21 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+ [[ repeatIn(objects,'statement') ]]
-
+
+
+
+ Today's Closed Cashbox
+
+
+
+
Company
@@ -186,11 +125,9 @@
User
-
+
-
-
-
+
[[ company.name ]]
@@ -200,10 +137,10 @@
-
+
-
+
St.Name
@@ -224,76 +161,89 @@
Ending Balance
+
+
- Total :
+ Total:
-
+
+
+
-
+
+
+
-
+
+
+
- [[ formatLang(get_net_total_starting(user)[1]) ]]
+ [[ formatLang(get_net_total_starting(user)[1]) ]] [[company.currency_id.symbol]]
- [[ formatLang(get_net_total(user)) ]]
+ [[ formatLang(get_net_total(user)) ]] [[company.currency_id.symbol]]
-
-
-[[ repeatIn(get_data(user),'statement') ]]
-
-
-
- [[ statement['statement'] ]]
-
-
- [[ statement['journal'] ]]
-
-
- [[ statement['date'] ]]
-
-
- [[ statement['closing_date'] ]]
-
-
- [[ (get_bal(statement)) or '0.00' ]]
-
-
- [[ formatLang(get_sub_total(user,statement['journal_id'],statement['date'])) ]]
-
-
-
-
-
- [[ repeatIn(get_lines(statement),'line_ids') ]]
-
-
-
- [[ line_ids['name'] ]]
-
-
- [[ get_partner(line_ids) or removeParentNode('font') ]]
-
-
- [[ get_user(line_ids) or removeParentNode('font') ]]
-
-
-
- [[ formatLang(line_ids['amount']) ]]
-
-
-
-
+
+ [[ repeatIn(get_data(user),'statement') ]]
+
+
+
+ [[ statement['statement'] ]]
+
+
+ [[ statement['journal'] ]]
+
+
+ [[ statement['date'] ]]
+
+
+ [[ statement['closing_date'] ]]
+
+
+ [[ (get_bal(statement)) or '0.00' ]] [[company.currency_id.symbol]]
+
+
+ [[ formatLang(get_sub_total(user,statement['journal_id'],statement['date'])) ]] [[company.currency_id.symbol]]
+
+
+
+
+ [[ repeatIn(get_lines(statement),'line_ids') ]]
+
+
+
+ [[ line_ids['name'] ]]
+
+
+
+
+
+ [[ get_partner(line_ids) or removeParentNode('font') ]]
+
+
+ [[ get_user(line_ids) or removeParentNode('font') ]]
+
+
+
+
+
+
+
+ [[ formatLang(line_ids['amount']) ]] [[company.currency_id.symbol]]
+
+
+
+
+
+
+
-
-
-
diff --git a/addons/point_of_sale/report/pos_details.py b/addons/point_of_sale/report/pos_details.py
index d1e881befac..26d427a3036 100644
--- a/addons/point_of_sale/report/pos_details.py
+++ b/addons/point_of_sale/report/pos_details.py
@@ -177,7 +177,7 @@ class pos_details(report_sxw.rml_parse):
return form['date_end']
def __init__(self, cr, uid, name, context):
- super(pos_details, self).__init__(cr, uid, name, context)
+ super(pos_details, self).__init__(cr, uid, name, context=context)
self.total = 0.0
self.qty = 0.0
self.invoice_id = ''
diff --git a/addons/point_of_sale/report/pos_details.rml b/addons/point_of_sale/report/pos_details.rml
index f3bebade402..c10b8049356 100644
--- a/addons/point_of_sale/report/pos_details.rml
+++ b/addons/point_of_sale/report/pos_details.rml
@@ -2,7 +2,7 @@
-
+
@@ -20,9 +20,12 @@
-
+
+
+
+
@@ -34,9 +37,12 @@
-
+
+
+
+
@@ -63,63 +69,59 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
-
-
+
-
@@ -155,14 +157,14 @@
-
+
Details of Sales
-
+
-
+
Company
@@ -171,11 +173,14 @@
Print Date
- Period
+ Start Period
+
+
+ End Period
-
+
[[ company.name ]]
@@ -184,14 +189,17 @@
[[ formatLang(time.strftime('%Y-%m-%d'),date=True) ]]
- [[ formatLang(getperiod(data['form']),date = True) ]] - [[ formatLang(getperiod2(data['form']),date = True) ]]
+ [[ formatLang(getperiod(data['form']),date = True) ]]
+
+
+ [[ formatLang(getperiod2(data['form']),date = True) ]]
-
+
-
+
Date
@@ -203,101 +211,116 @@
Product
- Price ([[ company.currency_id.code ]])
+ Price
Qty
- Disc ([[ company.currency_id.code ]])
+ Disc(%)
- Invoiced ([[ company.currency_id.code ]])
+ Invoiced
-
-
-
- [[ pos_sales_details(data['form'],user) and '' or removeParentNode('blockTable') ]]
- [[ repeatIn(pos_sales_details(data['form'],user), 'line_ids') ]] [[ formatLang(line_ids['date_order'],date = True) ]]
-
-
- [[ line_ids['pos_name'] ]]
-
-
- [[ line_ids['name'] ]]
-
-
- [[ formatLang(line_ids['price_unit']) ]][[ company.currency_id.symbol ]]
-
-
- [[ formatLang(line_ids['qty']) ]]
-
-
- [[ formatLang(line_ids['discount']) ]][[ company.currency_id.symbol ]]
-
-
- [[ getinvoice(line_ids['invoice_id'],user) or removeParentNode('font') ]]
-
-
-
-
+
+ [[ repeatIn(pos_sales_details(data['form'],user), 'line_ids') ]]
+
+
+
+ [[ formatLang(line_ids['date_order'],date_time = True) ]]
+
+
+ [[ line_ids['pos_name'] ]]
+
+
+ [[ line_ids['name'] ]]
+
+
+ [[ formatLang(line_ids['price_unit']) ]] [[ company.currency_id.symbol ]]
+
+
+ [[ formatLang(line_ids['qty']) ]]
+
+
+ [[ formatLang(line_ids['discount']) ]]
+
+
+ [[ getinvoice(line_ids['invoice_id'],user) or removeParentNode('font') ]]
+
+
+
+
+
-
+
Mode of Taxes
-
+
-
-
- [[ repeatIn(gettaxamount(data['form'],user), 'p') ]] [[ p['name'] or removeParentNode('tr') ]]
-
-
- [[ formatLang(p['amount']) or removeParentNode('font') ]][[ company.currency_id.symbol ]]
-
-
-
+
+ [[ repeatIn(gettaxamount(data['form'],user), 'p')]]
+
+
+
+ [[ p['name'] or removeParentNode('para') ]]
+
+
+ [[ formatLang(p['amount']) or removeParentNode('font') ]] [[ company.currency_id.symbol ]]
+
+
+
+
+
+
+
+
+
+
+
Mode of Payment
-
+
-
-
- [[ repeatIn(getpayments(data['form'],user), 'p') ]] [[ p['name'] or removeParentNode('tr') ]]
-
-
- [[ formatLang(p['sum']) or removeParentNode('tr') ]] [[ company.currency_id.symbol ]]
-
-
-
+
+ [[ repeatIn(getpayments(data['form'],user), 'p') ]]
+
+
+
+ [[ p['name'] or removeParentNode('para') ]]
+
+
+ [[ formatLang(p['sum']) or removeParentNode('tr') ]] [[ company.currency_id.symbol ]]
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
- Summary
+ Summary
@@ -306,13 +329,13 @@
-
+
Sales total
- [[ formatLang(getsalestotal2(data['form'],user)) ]][[ company.currency_id.symbol ]]
+ [[ formatLang(getsalestotal2(data['form'],user)) ]] [[ company.currency_id.symbol ]]
@@ -320,7 +343,7 @@
Qty of product
- [[ formatLang(getqtytotal2(data['form'],user)) ]]
+ [[ formatLang(getqtytotal2(data['form'],user)) ]]
@@ -328,7 +351,7 @@
Total invoiced
- [[ formatLang(getsuminvoice2(data['form'],user)) ]][[ company.currency_id.symbol ]]
+ [[ formatLang(getsuminvoice2(data['form'],user)) ]] [[ company.currency_id.symbol ]]
@@ -336,7 +359,7 @@
Total discount
- [[ formatLang(getsumdisc(objects)) ]][[ company.currency_id.symbol ]]
+ [[ formatLang(getsumdisc(objects)) ]] [[ company.currency_id.symbol ]]
@@ -344,7 +367,7 @@
Total paid
- [[ formatLang(getpaidtotal2(data['form'],user)) ]][[ company.currency_id.symbol ]]
+ [[ formatLang(getpaidtotal2(data['form'],user)) ]] [[ company.currency_id.symbol ]]
@@ -352,11 +375,11 @@
Total of the day
- [[ formatLang(gettotalofthaday(data['form'])) ]][[ company.currency_id.symbol ]]
+ [[ formatLang(gettotalofthaday(data['form'])) ]] [[ company.currency_id.symbol ]]
-
+
diff --git a/addons/point_of_sale/report/pos_details_summary.py b/addons/point_of_sale/report/pos_details_summary.py
index 7a57e17bf87..d17eb2f33dc 100644
--- a/addons/point_of_sale/report/pos_details_summary.py
+++ b/addons/point_of_sale/report/pos_details_summary.py
@@ -24,6 +24,23 @@ from report import report_sxw
class pos_details_summary(report_sxw.rml_parse):
+ def __init__(self, cr, uid, name, context):
+ super(pos_details_summary, self).__init__(cr, uid, name, context=context)
+ self.total = 0.0
+ self.localcontext.update({
+ 'time': time,
+ 'strip_name': self._strip_name,
+ 'getpayments': self._get_payments,
+ 'getqtytotal': self._get_qty_total,
+ 'getsumdisc': self._get_sum_discount,
+ 'getpaidtotal': self._paid_total,
+ 'gettotalofthaday': self._total_of_the_day,
+ 'getsuminvoice': self._sum_invoice,
+ 'gettaxamount': self._get_tax_amount,
+ 'getsalestotal': self._get_sales_total,
+ 'getperiod': self._get_period,
+ 'getcompany':self.get_company
+ })
def get_company(self,objects):
comp=[obj.company_id.name for obj in objects]
@@ -61,10 +78,10 @@ class pos_details_summary(report_sxw.rml_parse):
result = {}
for obj in objects:
- for payment in obj.payments:
- if gift_journal_id and gift_journal_id == payment.journal_id.id:
+ for payment in obj.statement_ids:
+ if gift_journal_id and gift_journal_id == payment.statement_id.journal_id.id:
continue
- result[payment.journal_id.name] = result.get(payment.journal_id.name, 0.0) + payment.amount
+ result[payment.statement_id.journal_id.name] = result.get(payment.statement_id.journal_id.name, 0.0) + payment.amount
return result
def _paid_total(self, objects):
@@ -111,23 +128,7 @@ class pos_details_summary(report_sxw.rml_parse):
else:
return '%s - %s' % (min_date, max_date)
- def __init__(self, cr, uid, name, context):
- super(pos_details_summary, self).__init__(cr, uid, name, context)
- self.total = 0.0
- self.localcontext.update({
- 'time': time,
- 'strip_name': self._strip_name,
- 'getpayments': self._get_payments,
- 'getqtytotal': self._get_qty_total,
- 'getsumdisc': self._get_sum_discount,
- 'getpaidtotal': self._paid_total,
- 'gettotalofthaday': self._total_of_the_day,
- 'getsuminvoice': self._sum_invoice,
- 'gettaxamount': self._get_tax_amount,
- 'getsalestotal': self._get_sales_total,
- 'getperiod': self._get_period,
- 'getcompany':self.get_company
- })
+
report_sxw.report_sxw('report.pos.details_summary',
'pos.order',
diff --git a/addons/point_of_sale/report/pos_details_summary.rml b/addons/point_of_sale/report/pos_details_summary.rml
index aa559eb9961..4c538f3b15e 100644
--- a/addons/point_of_sale/report/pos_details_summary.rml
+++ b/addons/point_of_sale/report/pos_details_summary.rml
@@ -1,8 +1,8 @@
-
+
-
+
@@ -38,23 +38,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
@@ -64,11 +71,6 @@
-
-
-
-
-
@@ -80,26 +82,36 @@
-
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
+
+
+
+
+
+
@@ -138,11 +150,14 @@
- Details of Sales
-
+
-
+ Details of Sales
+
+
+
+
Company
@@ -155,7 +170,7 @@
-
+
[[ '%s' % getcompany(objects)]]
@@ -168,86 +183,90 @@
-
+
-
+
Mode of Taxes
+
+
+
+
+
+
+
+
+ [[ repeatIn(gettaxamount(objects).items(),'p') ]]
+
+
+
+ [[ p[0] ]]
+
+
+ [[ p[1] ]]
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Mode of Payment
+
+
+
+
+
+
+
+
+
+ [[ repeatIn(getpayments(objects).items(),'t') ]]
+
+
+
+ [[ t[0] ]]
+
+
+ [[ '%.2f' % (t[1],) ]]
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Summary
+
-
-
-
- [[ repeatIn(gettaxamount(objects).items(),'p') ]]
- [[ p[0] ]]
-
-
-
- [[ p[1] ]]
-
-
-
-
-
- Mode of Payment
-
-
-
-
-
-
-
-
-
-
- [[ repeatIn(getpayments(objects).items(),'t') ]]
- [[ t[0] ]]
-
-
-
- [[ '%.2f' % (t[1],) ]]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Summary
-
-
-
-
-
-
-
-
-
+
Sales total
- [[ '%d' % getsalestotal(objects) ]]
+ [[ '%d' % getsalestotal(objects) ]] [[company.currency_id.symbol ]]
@@ -255,7 +274,7 @@
Qty of product
- [[ '%d' % getqtytotal(objects) ]]
+ [[ '%d' % getqtytotal(objects) ]]
@@ -263,7 +282,7 @@
Total invoiced
- [[ '%.2f' % getsuminvoice(objects) ]][[ company.currency_id.symbol ]]
+ [[ '%.2f' % getsuminvoice(objects) ]] [[ company.currency_id.symbol ]]
@@ -271,7 +290,7 @@
Total discount
- [[ '%.2f' % getsumdisc(objects) ]][[ company.currency_id.symbol ]]
+ [[ '%.2f' % getsumdisc(objects) ]] [[ company.currency_id.symbol ]]
@@ -279,7 +298,7 @@
Total paid
- [[ '%.2f' % getpaidtotal(objects) ]][[ company.currency_id.symbol ]]
+ [[ '%.2f' % getpaidtotal(objects) ]] [[ company.currency_id.symbol ]]
@@ -287,7 +306,7 @@
Total of the day
- [[ '%.2f' % gettotalofthaday(objects) ]][[ company.currency_id.symbol ]]
+ [[ '%.2f' % gettotalofthaday(objects) ]] [[ company.currency_id.symbol ]]
@@ -295,4 +314,4 @@
-
\ No newline at end of file
+
diff --git a/addons/point_of_sale/report/pos_invoice.py b/addons/point_of_sale/report/pos_invoice.py
index 376f0965633..62054570dfe 100644
--- a/addons/point_of_sale/report/pos_invoice.py
+++ b/addons/point_of_sale/report/pos_invoice.py
@@ -28,7 +28,7 @@ from tools.translate import _
class pos_invoice(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(pos_invoice, self).__init__(cr, uid, name, context)
+ super(pos_invoice, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
})
diff --git a/addons/point_of_sale/report/pos_lines.py b/addons/point_of_sale/report/pos_lines.py
index ad855087cad..cb45b107931 100644
--- a/addons/point_of_sale/report/pos_lines.py
+++ b/addons/point_of_sale/report/pos_lines.py
@@ -26,7 +26,7 @@ from report import report_sxw
class pos_lines(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(pos_lines, self).__init__(cr, uid, name, context)
+ super(pos_lines, self).__init__(cr, uid, name, context=context)
self.total = 0.0
self.localcontext.update({
'time': time,
diff --git a/addons/point_of_sale/report/pos_lines.rml b/addons/point_of_sale/report/pos_lines.rml
index fd3bbf9c43c..95f02bb5c1c 100644
--- a/addons/point_of_sale/report/pos_lines.rml
+++ b/addons/point_of_sale/report/pos_lines.rml
@@ -1,8 +1,8 @@
-
+
-
+
@@ -73,7 +73,6 @@
-
@@ -112,14 +111,11 @@
[[repeatIn(objects,'o')]]
[[ setLang(o.partner_id.lang) ]]
-
-
-
Sales lines
-
+
Company
@@ -132,7 +128,7 @@
-
+
[[ company.name ]]
@@ -141,7 +137,7 @@
[[ formatLang(time.strftime('%Y-%m-%d'),date = True) ]]
- [[formatLang(total_quantity(o))]]
+ [[ formatLang(total_quantity(o)) ]]
@@ -151,13 +147,13 @@
-
+
Description
- VAT
+ VAT
Quantity
@@ -166,7 +162,7 @@
Unit Price
- Disc. (%)
+ Disc. (%)
Price
@@ -174,31 +170,31 @@
- [[repeatIn(o.lines,'l')]]
-
+ [[repeatIn(o.lines,'l')]]
+
- [[l.product_id.code]] [[l.product_id.name]]
+ [ [[l.product_id.code]] ] [[l.product_id.name]]
- [[taxes(l)]]
+ [[taxes(l)]]
[[ formatLang(l.qty) ]] [[l.product_id.uom_id.name]]
- [[ formatLang(l.price_unit) ]]
+ [[ formatLang(l.price_unit) ]]
- [[ formatLang(l.discount) ]]
+ [[ formatLang(l.discount) ]]
- [[ formatLang(l.price_subtotal) ]][[o.pricelist_id.currency_id. symbol ]]
+ [[ formatLang(l.price_subtotal) ]] [[o.pricelist_id.currency_id. symbol ]]
-
+
@@ -221,7 +217,7 @@
- Net Total :
+ Net Total
[[ formatLang(o.amount_total) ]] [[o.pricelist_id.currency_id.symbol ]]
@@ -249,7 +245,7 @@
- Taxes :
+ Taxes
[[ formatLang(o.amount_tax) ]] [[o.pricelist_id.currency_id. symbol ]]
@@ -277,10 +273,10 @@
- Total :
+ Total:
- [[ formatLang(o.amount_total + o.amount_tax) ]] [[o.pricelist_id.currency_id. symbol ]]
+ [[ formatLang(o.amount_total + o.amount_tax) ]] [[o.pricelist_id.currency_id. symbol ]]
diff --git a/addons/point_of_sale/report/pos_payment_report.py b/addons/point_of_sale/report/pos_payment_report.py
index 3d82025da89..f679e230107 100644
--- a/addons/point_of_sale/report/pos_payment_report.py
+++ b/addons/point_of_sale/report/pos_payment_report.py
@@ -25,7 +25,7 @@ from report import report_sxw
class pos_payment_report(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(pos_payment_report, self).__init__(cr, uid, name, context)
+ super(pos_payment_report, self).__init__(cr, uid, name, context=context)
self.total = 0.0
self.localcontext.update({
'time': time,
@@ -38,17 +38,17 @@ class pos_payment_report(report_sxw.rml_parse):
sql = """ select id from pos_order where id = %d"""%(obj.id)
self.cr.execute(sql)
if self.cr.fetchone():
- self.cr.execute ("select pt.name,pol.qty,pol.discount,pol.price_unit, " \
+ self.cr.execute ("select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \
"(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \
- "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
- "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
+ "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt, product_uom as pu " \
+ "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and pu.id=pt.uom_id " \
"and po.state IN ('paid','invoiced') and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date = current_date and po.id=%d"%(obj.id))
data=self.cr.dictfetchall()
else :
- self.cr.execute ("select pt.name,pol.qty,pol.discount,pol.price_unit, " \
+ self.cr.execute ("select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \
"(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \
- "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
- "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
+ "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt, product_uom as pu " \
+ "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and pu.id=pt.uom_id " \
"and po.state IN ('paid','invoiced') and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date = current_date")
data=self.cr.dictfetchall()
diff --git a/addons/point_of_sale/report/pos_payment_report.rml b/addons/point_of_sale/report/pos_payment_report.rml
index e62b4bd1290..2d25c740d77 100644
--- a/addons/point_of_sale/report/pos_payment_report.rml
+++ b/addons/point_of_sale/report/pos_payment_report.rml
@@ -161,10 +161,10 @@
Disc. (%)
- Unit Price ([[ company.currency_id.code ]])
+ Unit Price
- Total ([[ company.currency_id.code ]])
+ Total
@@ -175,10 +175,10 @@
- [[ line_ids['name'] ]]
+ [ [[ line_ids['code'] ]] ] [[ line_ids['name'] ]]
- [[ formatLang(line_ids['qty']) ]]
+ [[ formatLang(line_ids['qty']) ]] [[line_ids['uom'] ]]
[[ formatLang(line_ids['discount']) ]]
@@ -212,7 +212,7 @@
- Net Total
+ Net Total:
[[ formatLang(pos_payment_total(o)) or removeParentNode('blockTable')]] [[ company.currency_id.symbol ]]
diff --git a/addons/point_of_sale/report/pos_payment_report_date.py b/addons/point_of_sale/report/pos_payment_report_date.py
index e492e929b7c..823fb3ce95e 100644
--- a/addons/point_of_sale/report/pos_payment_report_date.py
+++ b/addons/point_of_sale/report/pos_payment_report_date.py
@@ -25,7 +25,7 @@ from report import report_sxw
class pos_payment_report_date(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(pos_payment_report_date, self).__init__(cr, uid, name, context)
+ super(pos_payment_report_date, self).__init__(cr, uid, name, context=context)
self.total = 0.0
self.localcontext.update({
'time': time,
@@ -38,17 +38,17 @@ class pos_payment_report_date(report_sxw.rml_parse):
dt2 = form['date_end'] + ' 23:59:59'
data={}
if form['user_id']:
- self.cr.execute ("select pt.name,pol.qty,pol.discount,pol.price_unit, " \
+ self.cr.execute ("select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \
"(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \
- "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
- "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
+ "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt,product_uom as pu " \
+ "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and pu.id=pt.uom_id " \
"and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s and po.user_id IN %s " \
,(dt1,dt2,tuple(form['user_id'])))
else:
- self.cr.execute ("select pt.name,pol.qty,pol.discount,pol.price_unit, " \
+ self.cr.execute ("select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \
"(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \
- "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
- "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
+ "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt,product_uom as pu " \
+ "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and pu.id=pt.uom_id " \
"and po.state IN ('paid','invoiced') and po.date_order >= %s and po.date_order <= %s" \
,(dt1,dt2))
data=self.cr.dictfetchall()
diff --git a/addons/point_of_sale/report/pos_payment_report_date.rml b/addons/point_of_sale/report/pos_payment_report_date.rml
index 846eaf1f861..23c3f950d81 100644
--- a/addons/point_of_sale/report/pos_payment_report_date.rml
+++ b/addons/point_of_sale/report/pos_payment_report_date.rml
@@ -2,7 +2,7 @@
-
+
@@ -98,11 +98,11 @@
- Payment
+ Sales Lines
-
+
Company
@@ -112,7 +112,7 @@
-
+
[[ company.name ]]
@@ -128,7 +128,7 @@
-
+
Product
@@ -140,22 +140,22 @@
Disc(%)
- Unit Price ([[ company.currency_id.code ]])
+ Unit Price
- Total ([[ company.currency_id.code ]])
+ Total
[[ repeatIn(pos_payment_date(data['form']), 'line_ids') ]]
-
+
- [[ line_ids['name'] ]]
+ [ [[ line_ids['code'] ]] ] [[ line_ids['name'] ]]
- [[ formatLang(line_ids['qty']) ]]
+ [[ formatLang(line_ids['qty']) ]] [[line_ids['uom'] ]]
[[ formatLang(line_ids['discount']) ]]
@@ -169,7 +169,7 @@
-
+
@@ -187,7 +187,7 @@
- Total
+ Total:
[[ formatLang(pos_payment_date_total(data['form'])) or removeParentNode('blockTable')]] [[ company.currency_id.symbol ]]
@@ -198,4 +198,4 @@
-
\ No newline at end of file
+
diff --git a/addons/point_of_sale/report/pos_payment_report_user.py b/addons/point_of_sale/report/pos_payment_report_user.py
index c7f31ffcd6f..37b129f68f2 100644
--- a/addons/point_of_sale/report/pos_payment_report_user.py
+++ b/addons/point_of_sale/report/pos_payment_report_user.py
@@ -24,7 +24,7 @@ from report import report_sxw
class pos_payment_report_user(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(pos_payment_report_user, self).__init__(cr, uid, name, context)
+ super(pos_payment_report_user, self).__init__(cr, uid, name, context=context)
self.total = 0.0
self.localcontext.update({
'time': time,
@@ -35,10 +35,10 @@ class pos_payment_report_user(report_sxw.rml_parse):
def __pos_payment_user__(self,form):
data={}
ids = form['user_id']
- sql = "select pt.name,pol.qty,pol.discount,pol.price_unit, " \
+ sql = "select pt.name,pp.default_code as code,pol.qty,pu.name as uom,pol.discount,pol.price_unit, " \
"(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) as total " \
- "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
- "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
+ "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt,product_uom as pu " \
+ "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id and pu.id=pt.uom_id " \
"and po.state in ('paid','invoiced') and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date = current_date " \
"and po.user_id IN %s"
self.cr.execute (sql, (tuple(ids), ))
diff --git a/addons/point_of_sale/report/pos_payment_report_user.rml b/addons/point_of_sale/report/pos_payment_report_user.rml
index fc874e52dac..18ed5b73d84 100644
--- a/addons/point_of_sale/report/pos_payment_report_user.rml
+++ b/addons/point_of_sale/report/pos_payment_report_user.rml
@@ -1,8 +1,8 @@
-
+
-
+
@@ -10,35 +10,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -46,9 +40,8 @@
-
-
+
@@ -56,31 +49,25 @@
-
-
+
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
+
+
+
+
+
+
@@ -90,8 +77,8 @@
-
-
+
+
@@ -105,17 +92,21 @@
-
+
-
-
+ [[ repeatIn(objects,'order') ]]
+
-
+
-
+ Payment By User
+
+
+
+
Company
@@ -125,7 +116,7 @@
-
+
[[ company.name ]]
@@ -138,38 +129,37 @@
-
+
-
+
Product
- Qty
+ Qty
- Disc. (%)
+ Disc(%)
- Unit Price
+ Unit Price
- Total
+ Total
-
+
-
- [[ repeatIn(pos_payment_user(data['form']), 'line_ids') ]]
-
+ [[ repeatIn(pos_payment_user(data['form']), 'line_ids') ]]
+
- [[ line_ids['name'] ]]
+ [ [[ line_ids['code'] ]] ] [[ line_ids['name'] ]]
- [[ formatLang(line_ids['qty']) ]]
+ [[ formatLang(line_ids['qty']) ]] [[line_ids['uom'] ]]
[[ formatLang(line_ids['discount']) ]]
@@ -178,38 +168,38 @@
[[ formatLang(line_ids['price_unit']) ]]
- [[ formatLang(line_ids['total']) ]]
+ [[ formatLang(line_ids['total']) ]] [[company.currency_id.symbol]]
-
-
-
+
+
-
+
-
+
-
+
- Total :
+ Total:
- [[ formatLang(pos_payment_user_total(data['form'])) or removeParentNode('blockTable')]]
+ [[ formatLang(pos_payment_user_total(data['form'])) or removeParentNode('blockTable')]] [[company.currency_id.symbol]]
-
-
-
+
+
+
+
diff --git a/addons/point_of_sale/report/pos_receipt.py b/addons/point_of_sale/report/pos_receipt.py
index 51e8e4d0f1b..9be543fb89b 100644
--- a/addons/point_of_sale/report/pos_receipt.py
+++ b/addons/point_of_sale/report/pos_receipt.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -33,7 +33,7 @@ def titlize(journal_name):
class order(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(order, self).__init__(cr, uid, name, context)
+ super(order, self).__init__(cr, uid, name, context=context)
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid)
partner = user.company_id.partner_id
diff --git a/addons/point_of_sale/report/pos_receipt_bis.rml b/addons/point_of_sale/report/pos_receipt_bis.rml
deleted file mode 100644
index ab8af5ca999..00000000000
--- a/addons/point_of_sale/report/pos_receipt_bis.rml
+++ /dev/null
@@ -1,186 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [[ repeatIn(objects,'o') ]]
- [[ setLang(o.user_id.context_lang) ]]
- [[o.user_id.company_id.name]]
- [[ address and address.street ]], [[ address and address.zip ]] [[ address and address.city ]]
- Tel : [[ address and address.phone ]]
- Fax : [[ address and address.fax ]]
- E-mail : [[ address and address.email ]]
-
-
-
-
-
-
- Operation N° : [[ o.name ]]
- Date : [[ o.date_order ]]
-
-
-
-
-
-
- Description
-
-
- Qty
-
-
- Price
-
-
-
-
- [[ repeatIn(o.lines,'line') ]]
-
-
-
- [[ len(line.product_id.name) > 39 and line.product_id.name[:39] + '...' or line.product_id.name ]]
-
-
- [[ '%.f' % line.qty ]]
-
-
- [[ '%.2f' % net(line.id) ]]
-
-
-
-
-
-
-
-
-
-
- Discount :
-
-
- [[ not(disc(o.id)) and removeParentNode('blockTable') or disc(o.id) ]] [[ o.pricelist_id.currency_id.name ]]
-
-
-
-
-
-
- Total :
-
-
- [[ '%.2f' % o.amount_total ]] [[ o.pricelist_id.currency_id.name ]]
-
-
-
-
-
-
- [[ repeatIn(o.payments,'d') ]]
- [[ d.name ]]:
-
-
- [[ d.amount ]]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/point_of_sale/report/pos_receipt_with_remboursment.py b/addons/point_of_sale/report/pos_receipt_with_remboursment.py
index d96cad52097..3286f40c5b7 100644
--- a/addons/point_of_sale/report/pos_receipt_with_remboursment.py
+++ b/addons/point_of_sale/report/pos_receipt_with_remboursment.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -27,7 +27,7 @@ import pooler
class order(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(order, self).__init__(cr, uid, name, context)
+ super(order, self).__init__(cr, uid, name, context=context)
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid)
partner = user.company_id.partner_id
diff --git a/addons/point_of_sale/report/pos_receipt_with_remboursment.rml b/addons/point_of_sale/report/pos_receipt_with_remboursment.rml
index 32dea8dcd48..9c25d5f4a89 100644
--- a/addons/point_of_sale/report/pos_receipt_with_remboursment.rml
+++ b/addons/point_of_sale/report/pos_receipt_with_remboursment.rml
@@ -125,7 +125,7 @@
- [[ get_journal_amt(o)[0] ]] : [[ get_journal_amt(o)[1] ]]
+ [[ get_journal_amt(o)[1] ]]
diff --git a/addons/point_of_sale/report/pos_receipt_without_remboursment.py b/addons/point_of_sale/report/pos_receipt_without_remboursment.py
index a84b0588dae..58d7052b287 100644
--- a/addons/point_of_sale/report/pos_receipt_without_remboursment.py
+++ b/addons/point_of_sale/report/pos_receipt_without_remboursment.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
-#
+#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL ().
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -27,7 +27,7 @@ import pooler
class order(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(order, self).__init__(cr, uid, name, context)
+ super(order, self).__init__(cr, uid, name, context=context)
user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid)
partner = user.company_id.partner_id
diff --git a/addons/point_of_sale/report/pos_receipt_without_remboursment.rml b/addons/point_of_sale/report/pos_receipt_without_remboursment.rml
index 4e3b8ec64e1..ff6ebc3132c 100644
--- a/addons/point_of_sale/report/pos_receipt_without_remboursment.rml
+++ b/addons/point_of_sale/report/pos_receipt_without_remboursment.rml
@@ -127,12 +127,12 @@
[[ get_journal_amt(o)[0] ]] : [[ get_journal_amt(o)[1] ]]
-
- [[ repeatIn((o.state=='cancel' and o.statement_ids) and [1] or [], 'p') ]]
-
- Ce bon est valide jusqu'au [[ time.strftime('%d/%m/%Y', time.strptime(o.date_validity,'%Y-%m-%d')) ]].
-
-
+
+
+
+
+
+
diff --git a/addons/point_of_sale/report/pos_sales_user.py b/addons/point_of_sale/report/pos_sales_user.py
index 4032f035bdf..a764fa112b9 100644
--- a/addons/point_of_sale/report/pos_sales_user.py
+++ b/addons/point_of_sale/report/pos_sales_user.py
@@ -25,7 +25,7 @@ from report import report_sxw
class pos_sales_user(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(pos_sales_user, self).__init__(cr, uid, name, context)
+ super(pos_sales_user, self).__init__(cr, uid, name, context=context)
self.total = 0.0
self.localcontext.update({
'time': time,
diff --git a/addons/point_of_sale/report/pos_sales_user.rml b/addons/point_of_sale/report/pos_sales_user.rml
index cb817035a46..d2fefc379fd 100644
--- a/addons/point_of_sale/report/pos_sales_user.rml
+++ b/addons/point_of_sale/report/pos_sales_user.rml
@@ -1,8 +1,8 @@
-
+
-
+
@@ -10,35 +10,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -46,9 +40,8 @@
-
-
+
@@ -56,32 +49,20 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
+
@@ -91,8 +72,8 @@
-
-
+
+
@@ -106,17 +87,21 @@
-
+
-
-
+ [[ repeatIn(objects,'order') ]]
+
-
+
-
+ Sales Report
+
+
+
+
Company
@@ -126,7 +111,7 @@
-
+
[[ company.name ]]
@@ -139,10 +124,10 @@
-
+
-
+
Name
@@ -151,23 +136,22 @@
Date Order
- User
+ User
- State
+ State
Company
-
+
-
-
- [[ repeatIn(get_data(data['form']), 'line_ids')]]
-
+
+ [[ repeatIn(get_data(data['form']), 'line_ids')]]
+
- [[ line_ids['pos'] ]]
+ [[ line_ids['pos'] ]]
[[ formatLang(line_ids['date_order'],date_time = True) ]]
@@ -176,13 +160,16 @@
[[ line_ids['user'] ]]
- [[ line_ids['state'] ]]
+ [[ line_ids['state'] ]]
[[ line_ids['name'] ]]
-
+
+
+
+
diff --git a/addons/point_of_sale/report/pos_sales_user_today.py b/addons/point_of_sale/report/pos_sales_user_today.py
index 7c9b9b5a563..3a8b8bb1bba 100644
--- a/addons/point_of_sale/report/pos_sales_user_today.py
+++ b/addons/point_of_sale/report/pos_sales_user_today.py
@@ -25,7 +25,7 @@ from report import report_sxw
class pos_sales_user_today(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(pos_sales_user_today, self).__init__(cr, uid, name, context)
+ super(pos_sales_user_today, self).__init__(cr, uid, name, context=context)
self.total = 0.0
self.localcontext.update({
'time': time,
diff --git a/addons/point_of_sale/report/pos_sales_user_today.rml b/addons/point_of_sale/report/pos_sales_user_today.rml
index 39f6ddacb4c..6e633d375d8 100644
--- a/addons/point_of_sale/report/pos_sales_user_today.rml
+++ b/addons/point_of_sale/report/pos_sales_user_today.rml
@@ -1,8 +1,8 @@
-
+
-
+
@@ -10,35 +10,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -46,9 +40,8 @@
-
-
+
@@ -56,31 +49,20 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
+
@@ -90,8 +72,8 @@
-
-
+
+
@@ -105,17 +87,21 @@
-
+
-
-
+ [[ repeatIn(objects,'order') ]]
+
-
+
-
+ Today's Sales By User
+
+
+
+
Company
@@ -125,7 +111,7 @@
-
+
[[ company.name ]]
@@ -138,10 +124,10 @@
-
+
-
+
Name
@@ -150,23 +136,22 @@
Date Order
- User
+ User
- State
+ State
Company
-
+
-
-
- [[ repeatIn(get_data(data['form']), 'line_ids')]]
-
+
+ [[ repeatIn(get_data(data['form']), 'line_ids')]]
+
- [[ line_ids['pos'] ]]
+ [[ line_ids['pos'] ]]
[[ formatLang(line_ids['date_order'],date_time = True) ]]
@@ -175,13 +160,16 @@
[[ line_ids['user'] ]]
- [[ line_ids['state'] ]]
+ [[ line_ids['state'] ]]
[[ line_ids['name'] ]]
-
+
+
+
+
diff --git a/addons/point_of_sale/report/pos_sales_user_today_current_user.py b/addons/point_of_sale/report/pos_sales_user_today_current_user.py
index 7f4a8f827f5..ed793b4277e 100644
--- a/addons/point_of_sale/report/pos_sales_user_today_current_user.py
+++ b/addons/point_of_sale/report/pos_sales_user_today_current_user.py
@@ -25,7 +25,7 @@ from report import report_sxw
class pos_sales_user_today_current_user(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(pos_sales_user_today_current_user, self).__init__(cr, uid, name, context)
+ super(pos_sales_user_today_current_user, self).__init__(cr, uid, name, context=context)
self.total = 0.0
self.qty = 0.0
self.localcontext.update({
diff --git a/addons/point_of_sale/report/pos_sales_user_today_current_user.rml b/addons/point_of_sale/report/pos_sales_user_today_current_user.rml
index 475d045252b..7a94f5d6632 100644
--- a/addons/point_of_sale/report/pos_sales_user_today_current_user.rml
+++ b/addons/point_of_sale/report/pos_sales_user_today_current_user.rml
@@ -1,8 +1,8 @@
-
+
-
+
@@ -10,76 +10,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
+
-
-
-
+
+
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
+
@@ -89,8 +83,8 @@
-
-
+
+
@@ -104,17 +98,21 @@
-
+
-
-
+ [[ repeatIn(objects,'order') ]]
+
-
+
-
+ Today's Sales By Current User
+
+
+
+
Company
@@ -127,7 +125,7 @@
-
+
[[ company.name ]]
@@ -136,17 +134,17 @@
[[ formatLang(time.strftime('%Y-%m-%d'),date = True) ]]
- [[ (get_user(user)) ]]
+ [[ (get_user(user)) ]]
-
+
-
+
-
+
Name
@@ -160,12 +158,11 @@
Total
-
+
-
-
- [[ repeatIn(get_data_current_user(user), 'line_ids')]]
-
+
+ [[ repeatIn(get_data_current_user(user), 'line_ids')]]
+
[[ line_ids['name'] ]]
@@ -177,26 +174,31 @@
[[ formatLang(line_ids['qty']) ]]
- [[ formatLang(line_ids['total']) ]]
-
-
-
-
-
-
-
-
-
-
- Total :
-
-
- [[ formatLang((get_data_current_user_qty(user))) ]]
-
-
- [[ formatLang((get_data_current_user_tot(user))) ]]
+ [[ formatLang(line_ids['total']) ]] [[company.currency_id.symbol]]
+
+
+
+
+
+
+
+
+
+ Total :
+
+
+ [[ formatLang((get_data_current_user_qty(user))) ]]
+
+
+ [[ formatLang((get_data_current_user_tot(user))) or removeParentNode('blockTable')]] [[company.currency_id.symbol]]
+
+
+
+
+
+
diff --git a/addons/point_of_sale/report/pos_users_product.py b/addons/point_of_sale/report/pos_users_product.py
index 141445bcafe..83a02d49832 100644
--- a/addons/point_of_sale/report/pos_users_product.py
+++ b/addons/point_of_sale/report/pos_users_product.py
@@ -25,7 +25,7 @@ from report import report_sxw
class pos_user_product(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
- super(pos_user_product, self).__init__(cr, uid, name, context)
+ super(pos_user_product, self).__init__(cr, uid, name, context=context)
self.total = 0.0
self.localcontext.update({
'time': time,
diff --git a/addons/point_of_sale/report/pos_users_product.rml b/addons/point_of_sale/report/pos_users_product.rml
index 24059dcbb0b..ae15e6478e7 100644
--- a/addons/point_of_sale/report/pos_users_product.rml
+++ b/addons/point_of_sale/report/pos_users_product.rml
@@ -1,6 +1,6 @@
-
+
@@ -57,9 +57,19 @@
-
+
+
+
+
+
+
+
+
+
+
+
@@ -71,8 +81,8 @@
-
-
+
+
@@ -118,7 +128,7 @@
- User's Product
+ User's Product
@@ -169,13 +179,7 @@
-
-
-
-
-
-
-
+
Product
@@ -184,26 +188,30 @@
Qty
- Amount ([[ company.currency_id.code ]])
+ Amount
-
-
-
- [[ repeatIn(get_data(statement), 'line_ids') and ' ' or removeParentNode('blockTable') ]]
- [[ repeatIn(get_data(statement), 'line_ids')]]
- [[ line_ids['name'] ]]
-
-
- [[ formatLang(line_ids['qty']) ]]
-
-
- [[ formatLang(line_ids['amt']) ]][[ company.currency_id.symbol ]]
-
-
-
-
+
+ [[ repeatIn(get_data(statement), 'line_ids') and ' ' or removeParentNode('blockTable') ]]
+
+ [[ repeatIn(get_data(statement), 'line_ids')]]
+
+
+
+ [[ line_ids['name'] ]]
+
+
+ [[ formatLang(line_ids['qty']) ]]
+
+
+ [[ formatLang(line_ids['amt']) ]] [[ company.currency_id.symbol ]]
+
+
+
+
+
+
@@ -214,7 +222,7 @@
Total :
- [[ formatLang(get_total()) ]][[ company.currency_id.symbol ]]
+ [[ formatLang(get_total()) ]] [[ company.currency_id.symbol ]]
@@ -222,4 +230,4 @@
-
\ No newline at end of file
+
diff --git a/addons/point_of_sale/report/report_cash_register_view.xml b/addons/point_of_sale/report/report_cash_register_view.xml
index fb498336fb5..df0dfc877de 100644
--- a/addons/point_of_sale/report/report_cash_register_view.xml
+++ b/addons/point_of_sale/report/report_cash_register_view.xml
@@ -36,7 +36,7 @@
Point of Sale / User
+
+
+ Registers
+
+
+ [('user_id','!=',['base.user_root'])]
+
diff --git a/addons/point_of_sale/statement_report.xml b/addons/point_of_sale/statement_report.xml
index fb1be16419e..a81d51a2679 100644
--- a/addons/point_of_sale/statement_report.xml
+++ b/addons/point_of_sale/statement_report.xml
@@ -25,7 +25,7 @@
-
+
diff --git a/addons/point_of_sale/test/pos_report.yml b/addons/point_of_sale/test/pos_report.yml
index 08052356104..7eeea10bd1a 100644
--- a/addons/point_of_sale/test/pos_report.yml
+++ b/addons/point_of_sale/test/pos_report.yml
@@ -12,7 +12,7 @@
-
!python {model: pos.order}: |
import netsvc, tools, os
- (data, format) = netsvc.LocalService('report.pos.invoice').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
+ (data, format) = netsvc.LocalService('report.pos.invoice').create(cr, uid, [ref('point_of_sale.pos_order_pos11')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-invoice report'+format), 'wb+').write(data)
@@ -52,7 +52,7 @@
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-receipt without reimbursement report'+format), 'wb+').write(data)
-
- In order to test the PDF reports defined on a Point Of Sale, we will print a POS Payment Report Report
+ In order to test the PDF reports defined on a Point Of Sale, we will print a POS Payment Report
-
!python {model: ir.ui.menu}: |
import netsvc, tools, os, time
@@ -84,6 +84,13 @@
balance_end_real: 0.0
date: '2010-05-19'
journal_id: account_journal_cash0
+ line_ids:
+ - name: statement
+ date: "2010-10-13"
+ type: customer
+ account_id: account_account_sales0
+ amount: 100
+ partner_id: base.res_partner_agrolait
period_id: account.period_5
state: 'draft'
-
@@ -133,7 +140,7 @@
-
!python {model: pos.order}: |
import netsvc, tools, os, time
- (data, format) = netsvc.LocalService('report.pos.payment.report').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
+ (data, format) = netsvc.LocalService('report.pos.payment.report').create(cr, uid, [ref('point_of_sale.pos_order_pos0')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-payment_report'+format), 'wb+').write(data)
-
@@ -152,4 +159,4 @@
import netsvc, tools, os, time
(data, format) = netsvc.LocalService('report.pos.sales.user.today.current.user').create(cr, uid, [ref('point_of_sale.order_pos1'), ref('point_of_sale.order_pos2')], {}, {})
if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_today_current_user_report'+format), 'wb+').write(data)
\ No newline at end of file
+ file(os.path.join(tools.config['test_report_directory'], 'point_of_sale-sales_today_current_user_report'+format), 'wb+').write(data)
diff --git a/addons/point_of_sale/wizard/pos_return.py b/addons/point_of_sale/wizard/pos_return.py
index 4b975b820cb..99e697ea826 100644
--- a/addons/point_of_sale/wizard/pos_return.py
+++ b/addons/point_of_sale/wizard/pos_return.py
@@ -123,7 +123,7 @@ class pos_return(osv.osv_memory):
+ string="Return with Exchange" type="object"/>
"""
@@ -206,10 +206,10 @@ class pos_return(osv.osv_memory):
'product_id': line.product_id.id,
'location_dest_id': stock_dest_id,
'name': '%s (return)' %order_id.name,
- 'date': date_cur,
- 'date_planned': date_cur
+ 'date': date_cur
})
- line_obj.copy(cr, uid, line.id, {'qty': -qty, 'order_id': new_order})
+ if qty != 0.0:
+ line_obj.copy(cr, uid, line.id, {'qty': -qty, 'order_id': new_order})
statementl_obj.create(cr, uid, {
'name': 'Refund %s'%order_id.name,
'statement_id': order_id.statement_ids[0].statement_id.id,
@@ -293,8 +293,7 @@ class add_product(osv.osv_memory):
'product_id':prod_id.id,
'location_dest_id':stock_dest_id,
'name':'%s (return)' %order_id.name,
- 'date':date_cur,
- 'date_planned':date_cur
+ 'date':date_cur
})
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
@@ -370,7 +369,6 @@ class add_product(osv.osv_memory):
'location_dest_id':stock_dest_id,
'name':'%s (return)' % order_id.name,
'date':date_cur,
- 'date_planned':date_cur
})
wf_service.trg_validate(uid, 'stock.picking',new_picking,'button_confirm', cr)
picking_obj.force_assign(cr, uid, [new_picking], context)
diff --git a/addons/procurement/board_mrp_procurement_view.xml b/addons/procurement/board_mrp_procurement_view.xml
index d5f71f6d4bc..3b18a876f4f 100644
--- a/addons/procurement/board_mrp_procurement_view.xml
+++ b/addons/procurement/board_mrp_procurement_view.xml
@@ -1,6 +1,15 @@
+
+ Procurement Exceptions
+ ir.actions.act_window
+ procurement.order
+ form
+ tree,form
+ [('state','=','exception')]
+
+
board.mrp.procurement.form
board.board
@@ -8,7 +17,7 @@
form
-
+
diff --git a/addons/procurement/process/procurement_process.xml b/addons/procurement/process/procurement_process.xml
index 42ee50782a1..955d9cf6416 100644
--- a/addons/procurement/process/procurement_process.xml
+++ b/addons/procurement/process/procurement_process.xml
@@ -12,7 +12,7 @@
-
+
@@ -28,7 +28,7 @@
-
+
diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py
index e1b9b5af40b..4f0d3530a80 100644
--- a/addons/procurement/procurement.py
+++ b/addons/procurement/procurement.py
@@ -157,34 +157,19 @@ class procurement_order(osv.osv):
""" Checks product type.
@return: True or False
"""
- for procurement in self.browse(cr, uid, ids):
- if procurement.product_id.type in ('product', 'consu'):
- return True
- return False
+ return all(procurement.product_id.type in ('product', 'consu') for procurement in self.browse(cr, uid, ids))
def check_move_cancel(self, cr, uid, ids, context={}):
""" Checks if move is cancelled or not.
@return: True or False.
"""
- res = True
- ok = False
- for procurement in self.browse(cr, uid, ids, context):
- if procurement.move_id:
- ok = True
- if not procurement.move_id.state == 'cancel':
- res = False
- return res and ok
+ return all(procurement.move_id.state == 'cancel' for procurement in self.browse(cr, uid, ids))
def check_move_done(self, cr, uid, ids, context={}):
""" Checks if move is done or not.
@return: True or False.
"""
- res = True
- for proc in self.browse(cr, uid, ids, context):
- if proc.move_id:
- if not proc.move_id.state == 'done':
- res = False
- return res
+ return all(procurement.move_id.state == 'done' for procurement in self.browse(cr, uid, ids))
#
# This method may be overrided by objects that override procurement.order
@@ -337,15 +322,16 @@ class procurement_order(osv.osv):
if procurement.procure_method == 'make_to_order':
source = procurement.product_id.product_tmpl_id.property_stock_procurement.id
id = move_obj.create(cr, uid, {
- 'name': 'PROC:' + procurement.name,
+ 'name': procurement.name,
'location_id': source,
'location_dest_id': procurement.location_id.id,
'product_id': procurement.product_id.id,
'product_qty': procurement.product_qty,
'product_uom': procurement.product_uom.id,
- 'date_planned': procurement.date_planned,
+ 'date_expected': procurement.date_planned,
'state': 'draft',
'company_id': procurement.company_id.id,
+ 'auto_validate': True,
})
move_obj.action_confirm(cr, uid, [id], context=context)
self.write(cr, uid, [procurement.id], {'move_id': id, 'close_move': 1})
@@ -388,10 +374,6 @@ class procurement_order(osv.osv):
"Not enough stock and no minimum orderpoint rule defined.") % \
procurement.name
self.log(cr, uid, procurement.id, message)
- if procurement.state=='exception' and procurement.message=='':
- cr.execute('update procurement_order set message=%s where id=%s',
- (_('Not enough stock '), procurement.id) )
-
return ok
def action_produce_assign_service(self, cr, uid, ids, context={}):
@@ -439,7 +421,7 @@ class procurement_order(osv.osv):
wf_service.trg_trigger(uid, 'procurement.order', id, cr)
return True
- def action_check_finnished(self, cr, uid, ids):
+ def action_check_finished(self, cr, uid, ids):
return self.check_move_done(cr, uid, ids)
def action_check(self, cr, uid, ids):
@@ -492,9 +474,9 @@ procurement_order()
class StockPicking(osv.osv):
_inherit = 'stock.picking'
- def test_finnished(self, cursor, user, ids):
+ def test_finished(self, cursor, user, ids):
wf_service = netsvc.LocalService("workflow")
- res = super(StockPicking, self).test_finnished(cursor, user, ids)
+ res = super(StockPicking, self).test_finished(cursor, user, ids)
for picking in self.browse(cursor, user, ids):
for move in picking.move_lines:
if move.state == 'done' and move.procurements:
diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml
index 1e6395c660e..03a4c5aad82 100644
--- a/addons/procurement/procurement_view.xml
+++ b/addons/procurement/procurement_view.xml
@@ -23,6 +23,21 @@
+
+
+ procurement.order.tree.board
+ procurement.order
+ tree
+
+
+
+
+
+
+
+
+
+
procurement.order.form
@@ -85,11 +100,13 @@
-
-
+
+
+
+
@@ -106,29 +123,29 @@
+
Procurement Orders
ir.actions.act_window
procurement.order
form
- {'search_default_current':1}
- {'search_default_Current':1}
- The procurement order will schedule a proposal for automatic procurement for the product concerned. This procurement will start a task, a purchase order form for the supplier or a production depending on the product configuration.
+ {'search_default_current':1}
+ Procurement Orders represent the need for a certain quantity of products, at a given time, in a given location. Sale Orders are one typical source of Procurement Orders (but these are distinct documents). Depending on the procurement parameters and the products configuration, the procurement engine will attempt to satisfy the need by reserving products from stock, or ordering products from a supplier, or passing a manufacturing order, etc.
-
- Procurements
+
+ Procurement Exceptions
ir.actions.act_window
procurement.order
form
tree,form
+ {'search_default_perm_exceptions':1}
- []
- {}
+ Procurement Orders represent the need for a certain quantity of products, at a given time, in a given location. Sale Orders are one typical source of Procurement Orders (but these are distinct documents). Depending on the procurement parameters and the products configuration, the procurement engine will attempt to satisfy the need by reserving products from stock, or ordering products from a supplier, or passing a manufacturing order, etc. A Procurement Exception occurs when the system cannot find a way to fulfill a procurement. Some exceptions will resolve themselves automatically, but others require manual intervention (those are identified by a specific error message)
-
+
Procurement Exceptions
ir.actions.act_window
@@ -136,26 +153,6 @@
form
tree,form
[('state','=','exception')]
- For each customer order line or raw materials in a manufacturing order, there is a procurement form . In normal system use, procurement orders are automatically generated by OpenERP. But if there are configuration problems, the system can remain blocked by a procurement without generating a corresponding document. It is a procurement exception. Some problems are link to timing and will be correct automatically by the system. If there is no procurement rule, the exception must be corrected manually.
-
-
-
- Procurement Exceptions to Fix
- ir.actions.act_window
- procurement.order
- form
- tree,form
- [('state','=','exception'), ('message', '<>', '')]
-
-
-
-
- Temporary Procurement Exceptions
- ir.actions.act_window
- procurement.order
- form
- tree,form
- [('state','=','exception'), ('message', '=', '')]
@@ -263,8 +260,12 @@
res_model="stock.warehouse.orderpoint"
src_model="procurement.order"/>
-
-
-
+
+
+
+
+
+
+
diff --git a/addons/procurement/procurement_workflow.xml b/addons/procurement/procurement_workflow.xml
index ff4325e248f..b4bcd1e1f04 100644
--- a/addons/procurement/procurement_workflow.xml
+++ b/addons/procurement/procurement_workflow.xml
@@ -187,7 +187,7 @@
- action_check_finnished()
+ action_check_finished()
stock.move
[move_id.id]
diff --git a/addons/procurement/schedulers.py b/addons/procurement/schedulers.py
index 777a8de45cc..9abdf3d1ff5 100644
--- a/addons/procurement/schedulers.py
+++ b/addons/procurement/schedulers.py
@@ -23,8 +23,10 @@ import time
from mx import DateTime
from osv import osv
+from tools.translate import _
import netsvc
import pooler
+from tools.translate import _
class procurement_order(osv.osv):
_inherit = 'procurement.order'
@@ -170,8 +172,8 @@ class procurement_order(osv.osv):
else:
continue
proc_id = proc_obj.create(cr, uid, {
- 'name': 'Automatic OP: %s' % product.name,
- 'origin': 'SCHEDULER',
+ 'name': _('Automatic OP: %s') % (product.name,),
+ 'origin': _('SCHEDULER'),
'date_planned': newdate.strftime('%Y-%m-%d %H:%M:%S'),
'product_id': product.id,
'product_qty': -product.virtual_available,
@@ -236,12 +238,12 @@ class procurement_order(osv.osv):
continue
if op.product_id.type not in ('consu'):
proc_id = procurement_obj.create(cr, uid, {
- 'name': 'OP:' + str(op.id),
+ 'name': op.name,
'date_planned': newdate.strftime('%Y-%m-%d'),
'product_id': op.product_id.id,
'product_qty': qty,
'product_uom': op.product_uom.id,
- 'location_id': op.warehouse_id.lot_input_id.id,
+ 'location_id': op.location_id.id,
'procure_method': 'make_to_order',
'origin': op.name
})
diff --git a/addons/product/__init__.py b/addons/product/__init__.py
index 3052a02d212..4247b49d41b 100644
--- a/addons/product/__init__.py
+++ b/addons/product/__init__.py
@@ -23,6 +23,5 @@ import pricelist
import report
import partner
import wizard
-import company
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/product/__openerp__.py b/addons/product/__openerp__.py
index 5d099489859..851031e0424 100644
--- a/addons/product/__openerp__.py
+++ b/addons/product/__openerp__.py
@@ -55,7 +55,6 @@
'product_view.xml',
'pricelist_view.xml',
'partner_view.xml',
- 'company_view.xml',
'process/product_process.xml'
],
'test':['test/product_report.yml'],
diff --git a/addons/product/company.py b/addons/product/company.py
deleted file mode 100644
index 0f248dba309..00000000000
--- a/addons/product/company.py
+++ /dev/null
@@ -1,43 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import fields, osv
-
-
-class res_company(osv.osv):
- _inherit = 'res.company'
- _columns = {
- 'property_valuation_price_type': fields.property(
- 'product.price.type',
- type='many2one',
- relation='product.price.type',
- domain=[],
- string="Valuation Price Type",
- method=True,
- view_load=True,
- help="The price type field in the selected price type will be used, instead of the default one, \
- for valuation of product in the current company"),
- }
-
-res_company()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/product/company_view.xml b/addons/product/company_view.xml
deleted file mode 100644
index eb0294e2daa..00000000000
--- a/addons/product/company_view.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
- res.company.product.property.form.inherit
- res.company
- form
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/product/product.py b/addons/product/product.py
index 09732a9bff3..05ec8459bcd 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -69,15 +69,15 @@ 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', digits=(12, 6), required=True,
+ 'factor': fields.float('Ratio', required=True,digits=(12, 6),
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=(12, 6),
+ 'factor_inv': fields.function(_factor_inv, digits_compute=dp.get_precision('Product UoM'),
fnct_inv=_factor_inv_write,
method=True, string='Ratio',
help='How many times this UoM is bigger than the reference UoM in this category:\n'\
'1 * (this unit) = ratio * (reference unit)', required=True),
- 'rounding': fields.float('Rounding Precision', digits=(16, 3), required=True,
+ 'rounding': fields.float('Rounding Precision', digits_compute=dp.get_precision('Product UoM'), required=True,
help="The computed quantity will be a multiple of this value. "\
"Use 1.0 for a UoM that cannot be further split, such as a piece."),
'active': fields.boolean('Active', help="By unchecking the active field you can disable a unit of measure without deleting it."),
@@ -386,7 +386,7 @@ class product_product(osv.osv):
def _get_partner_code_name(self, cr, uid, ids, product, partner_id, context={}):
for supinfo in product.seller_ids:
if supinfo.name.id == partner_id:
- return {'code': supinfo.product_code, 'name': supinfo.product_name, 'variants': ''}
+ return {'code': supinfo.product_code or product.default_code, 'name': supinfo.product_name or product.name, 'variants': ''}
res = {'code': product.default_code, 'name': product.name, 'variants': product.variants}
return res
diff --git a/addons/product/product_data.xml b/addons/product/product_data.xml
index 2052221cf78..31e93f46d5f 100644
--- a/addons/product/product_data.xml
+++ b/addons/product/product_data.xml
@@ -144,12 +144,6 @@ parameter) will see those record just disappear.
-
- property_valuation_price_type
-
-
-
-
Sale Price
2
@@ -166,6 +160,9 @@ parameter) will see those record just disappear.
Stock Weight
2
-
+
+ Product UoM
+
+
diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml
index 5872e325715..a9409e62aa8 100644
--- a/addons/product/product_view.xml
+++ b/addons/product/product_view.xml
@@ -197,7 +197,6 @@
In OpenERP, a product is something you can buy and sell. It can be a raw material, a stockable product, a consumable or a service. The product form contains a detailed information on the products like procurement logistic, sales price, product category, suppliers, etc.
-
diff --git a/addons/project/board_project_view.xml b/addons/project/board_project_view.xml
index c3b4b0c8000..275a969cbe9 100644
--- a/addons/project/board_project_view.xml
+++ b/addons/project/board_project_view.xml
@@ -86,16 +86,16 @@
- Value([[ company.currency_id.name ]])
+ Value
diff --git a/addons/stock/report/lot_overview_all.py b/addons/stock/report/lot_overview_all.py
index c523b9775d1..0b4edcaecf4 100644
--- a/addons/stock/report/lot_overview_all.py
+++ b/addons/stock/report/lot_overview_all.py
@@ -37,7 +37,7 @@ class lot_overview_all(report_sxw.rml_parse):
def process(self,location_id):
location_obj = pooler.get_pool(self.cr.dbname).get('stock.location')
data = location_obj._product_get_all_report(self.cr,self.uid, [location_id])
- data['location_name'] = location_obj.read(self.cr, self.uid, [location_id],['name'])[0]['name']
+ data['location_name'] = location_obj.read(self.cr, self.uid, [location_id],['complete_name'])[0]['complete_name']
self.price_total = 0.0
self.price_total += data['total_price']
self.grand_total += data['total_price']
diff --git a/addons/stock/report/lot_overview_all.rml b/addons/stock/report/lot_overview_all.rml
index 4c4c71561a2..7d2360068a8 100644
--- a/addons/stock/report/lot_overview_all.rml
+++ b/addons/stock/report/lot_overview_all.rml
@@ -108,7 +108,7 @@
Unit Price
- Value([[ company.currency_id.name ]])
+ Value
diff --git a/addons/stock/report/product_stock.py b/addons/stock/report/product_stock.py
index e55405381b4..b7dd254234c 100644
--- a/addons/stock/report/product_stock.py
+++ b/addons/stock/report/product_stock.py
@@ -69,12 +69,12 @@ class report_stock(report_int):
if not loc_ids or not product_ids:
return (False, 'pdf')
- cr.execute("select sum(r.product_qty * u.factor), r.date_planned, r.product_id "
+ cr.execute("select sum(r.product_qty * u.factor), r.date, r.product_id "
"from stock_move r left join product_uom u on (r.product_uom=u.id) "
"where state IN %s"
"and location_id IN %s"
"and product_id IN %s"
- "group by date_planned,product_id",(('confirmed','assigned','waiting'),tuple(loc_ids) ,tuple(product_ids),))
+ "group by date,product_id",(('confirmed','assigned','waiting'),tuple(loc_ids) ,tuple(product_ids),))
for (qty, dt, prod_id) in cr.fetchall():
if dt<=dt_from:
dt= (datetime.now() + relativedelta(days=1)).strftime('%Y-%m-%d')
@@ -83,12 +83,12 @@ class report_stock(report_int):
products.setdefault(prod_id, [])
products[prod_id].append((dt,-qty))
- cr.execute("select sum(r.product_qty * u.factor), r.date_planned, r.product_id "
+ cr.execute("select sum(r.product_qty * u.factor), r.date, r.product_id "
"from stock_move r left join product_uom u on (r.product_uom=u.id) "
"where state IN %s"
"and location_dest_id IN %s"
"and product_id IN %s"
- "group by date_planned,product_id",(('confirmed','assigned','waiting'),tuple(loc_ids) ,tuple(product_ids),))
+ "group by date,product_id",(('confirmed','assigned','waiting'),tuple(loc_ids) ,tuple(product_ids),))
for (qty, dt, prod_id) in cr.fetchall():
if dt<=dt_from:
diff --git a/addons/stock/report/report_stock_move.py b/addons/stock/report/report_stock_move.py
index 92fb4559345..49c3f8fb327 100644
--- a/addons/stock/report/report_stock_move.py
+++ b/addons/stock/report/report_stock_move.py
@@ -29,7 +29,7 @@ class report_stock_move(osv.osv):
_description = "Moves Statistics"
_auto = False
_columns = {
- 'date_planned': fields.date('Date Planned', readonly=True ),
+ 'date': fields.date('Date', readonly=True),
'year': fields.char('Year', size=4, readonly=True),
'day': fields.char('Day', size=128, readonly=True),
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
@@ -39,26 +39,30 @@ class report_stock_move(osv.osv):
'product_id':fields.many2one('product.product', 'Product', readonly=True),
'company_id':fields.many2one('res.company', 'Company', readonly=True),
'picking_id':fields.many2one('stock.picking', 'Packing', readonly=True),
- 'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal'), ('delivery', 'Delivery')], 'Shipping Type', required=True, select=True, help="Shipping type specify, goods coming in or going out."),
+ 'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal'), ('other', 'Others')], 'Shipping Type', required=True, select=True, help="Shipping type specify, goods coming in or going out."),
'location_id': fields.many2one('stock.location', 'Source Location', readonly=True, select=True, help="Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."),
'location_dest_id': fields.many2one('stock.location', 'Dest. Location', readonly=True, select=True, help="Location where the system will stock the finished products."),
'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True),
- 'product_qty_in':fields.float('In Qty',readonly=True),
- 'product_qty_out':fields.float('Out Qty',readonly=True),
- 'value' : fields.float('Total Value', required=True, digits_compute=dp.get_precision('Sale Price')),
- 'day_diff2':fields.float('Delay (Days)',readonly=True, digits=(16,2), group_operator="avg"),
- 'day_diff1':fields.float('Planned (Days)',readonly=True, digits=(16,2), group_operator="avg"),
- 'day_diff':fields.float('Real (Days)',readonly=True, digits=(16,2), group_operator="avg"),
+ 'product_qty':fields.integer('Quantity',readonly=True),
+ 'categ_id': fields.many2one('product.category', 'Product Category', ),
+ 'product_qty_in':fields.integer('In Qty',readonly=True),
+ 'product_qty_out':fields.integer('Out Qty',readonly=True),
+ 'value' : fields.float('Total Value', required=True),
+ 'day_diff2':fields.float('Lag (Days)',readonly=True, digits_compute=dp.get_precision('Shipping Delay'), group_operator="avg"),
+ 'day_diff1':fields.float('Planned Lead Time (Days)',readonly=True, digits_compute=dp.get_precision('Shipping Delay'), group_operator="avg"),
+ 'day_diff':fields.float('Execution Lead Time (Days)',readonly=True, digits_compute=dp.get_precision('Shipping Delay'), group_operator="avg"),
+ 'stock_journal': fields.many2one('stock.journal','Stock Journal', select=True),
+
+
}
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_stock_move')
cr.execute("""
- create or replace view report_stock_move as (
- select
+ CREATE OR REPLACE view report_stock_move AS (
+ SELECT
min(sm_id) as id,
- sum(value) as value,
- al.dp as date_planned,
+ al.dp as date,
al.curr_year as year,
al.curr_month as month,
al.curr_day as day,
@@ -69,56 +73,74 @@ class report_stock_move(osv.osv):
al.picking_id as picking_id,
al.company_id as company_id,
al.location_dest_id as location_dest_id,
+ al.product_qty,
al.out_qty as product_qty_out,
al.in_qty as product_qty_in,
al.address_id as partner_id,
al.product_id as product_id,
al.state as state ,
al.product_uom as product_uom,
- al.type as type
+ al.categ_id as categ_id,
+ coalesce(al.type, 'other') as type,
+ al.stock_journal as stock_journal,
+ sum(al.in_value - al.out_value) as value
FROM (SELECT
-
- CASE WHEN sp.type in ('out','delivery') THEN
- sum(sm.product_qty) END AS out_qty,
+ CASE WHEN sp.type in ('out') THEN
+ sum(sm.product_qty * pu.factor)
+ ELSE 0.0
+ END AS out_qty,
CASE WHEN sp.type in ('in') THEN
- sum(sm.product_qty) END AS in_qty,
+ sum(sm.product_qty * pu.factor)
+ ELSE 0.0
+ END AS in_qty,
+ CASE WHEN sp.type in ('out') THEN
+ sum(sm.product_qty * pu.factor) * pt.standard_price
+ ELSE 0.0
+ END AS out_value,
+ CASE WHEN sp.type in ('in') THEN
+ sum(sm.product_qty * pu.factor) * pt.standard_price
+ ELSE 0.0
+ END AS in_value,
min(sm.id) as sm_id,
- sm.date_planned as dp,
- to_char(date_trunc('day',sm.date_planned), 'YYYY') as curr_year,
- to_char(date_trunc('day',sm.date_planned), 'MM') as curr_month,
- to_char(date_trunc('day',sm.date_planned), 'YYYY-MM-DD') as curr_day,
- avg(date(sm.date_planned)-date(sm.create_date)) as curr_day_diff,
+ sm.date as dp,
+ to_char(date_trunc('day',sm.date), 'YYYY') as curr_year,
+ to_char(date_trunc('day',sm.date), 'MM') as curr_month,
+ to_char(date_trunc('day',sm.date), 'YYYY-MM-DD') as curr_day,
+ avg(date(sm.date)-date(sm.create_date)) as curr_day_diff,
avg(date(sm.date_expected)-date(sm.create_date)) as curr_day_diff1,
- avg(date(sm.date_planned)-date(sm.date_expected)) as curr_day_diff2,
+ avg(date(sm.date)-date(sm.date_expected)) as curr_day_diff2,
sm.location_id as location_id,
sm.location_dest_id as location_dest_id,
- pt.standard_price * sum(sm.product_qty) as value,
+ sum(sm.product_qty) as product_qty,
+ pt.categ_id as categ_id ,
sm.address_id as address_id,
sm.product_id as product_id,
sm.picking_id as picking_id,
sm.company_id as company_id,
sm.state as state,
sm.product_uom as product_uom,
- sp.type as type
- from
+ sp.type as type,
+ sp.stock_journal_id AS stock_journal
+ FROM
stock_move sm
- left join stock_picking sp on (sm.picking_id=sp.id)
- left join product_product pp on (sm.product_id=pp.id)
- left join product_template pt on (pp.product_tmpl_id=pt.id)
- left join stock_location sl on (sm.location_id = sl.id)
+ LEFT JOIN stock_picking sp ON (sm.picking_id=sp.id)
+ LEFT JOIN product_product pp ON (sm.product_id=pp.id)
+ LEFT JOIN product_uom pu ON (sm.product_uom=pu.id)
+ LEFT JOIN product_template pt ON (pp.product_tmpl_id=pt.id)
+ LEFT JOIN stock_location sl ON (sm.location_id = sl.id)
- group by
- sm.id,sp.type, sm.date_planned,sm.address_id,
+ GROUP BY
+ sm.id,sp.type, sm.date,sm.address_id,
sm.product_id,sm.state,sm.product_uom,sm.date_expected,
- sm.product_id,pt.standard_price, sm.picking_id,
- sm.company_id,sm.product_qty, sm.location_id,sm.location_dest_id)
- as al
+ sm.product_id,pt.standard_price, sm.picking_id, sm.product_qty,
+ sm.company_id,sm.product_qty, sm.location_id,sm.location_dest_id,pu.factor,pt.categ_id, sp.stock_journal_id)
+ AS al
- group by
+ GROUP BY
al.out_qty,al.in_qty,al.curr_year,al.curr_month,
al.curr_day,al.curr_day_diff,al.curr_day_diff1,al.curr_day_diff2,al.dp,al.location_id,al.location_dest_id,
al.address_id,al.product_id,al.state,al.product_uom,
- al.picking_id,al.company_id,al.type
+ al.picking_id,al.company_id,al.type,al.product_qty, al.categ_id, al.stock_journal
)
""")
@@ -130,14 +152,15 @@ class report_stock_inventory(osv.osv):
_description = "Stock Statistics"
_auto = False
_columns = {
- 'date_planned': fields.datetime('Date', readonly=True),
+ 'date': fields.datetime('Date', readonly=True),
'partner_id':fields.many2one('res.partner.address', 'Partner', readonly=True),
'product_id':fields.many2one('product.product', 'Product', readonly=True),
+ 'product_categ_id':fields.many2one('product.category', 'Product Category', readonly=True),
'location_id': fields.many2one('stock.location', 'Location', readonly=True),
'prodlot_id': fields.many2one('stock.production.lot', 'Lot', readonly=True),
'company_id': fields.many2one('res.company', 'Company', readonly=True),
- 'product_qty':fields.float('Qty', digits=(16,2), readonly=True),
- 'value' : fields.float('Total Value', digits=(16,2), required=True, digits_compute=dp.get_precision('Sale Price')),
+ 'product_qty':fields.float('Quantity', digits_compute=dp.get_precision('Product UoM'), readonly=True),
+ 'value' : fields.float('Total Value', digits_compute=dp.get_precision('Account'), required=True),
'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 \'Avaiable\'.\n When the picking it done the state is \'Done\'.\
\nThe state is \'Waiting\' if the move is waiting for another one.'),
@@ -146,44 +169,44 @@ class report_stock_inventory(osv.osv):
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_stock_inventory')
cr.execute("""
-create or replace view report_stock_inventory as (
- (select
- min(m.id) as id, m.date_planned as date_planned,
+CREATE OR REPLACE view report_stock_inventory AS (
+ (SELECT
+ min(m.id) as id, m.date as date,
m.address_id as partner_id, m.location_id as location_id,
- m.product_id as product_id, l.usage as location_type,
+ m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,
m.company_id,
m.state as state, m.prodlot_id as prodlot_id,
- sum(-m.product_qty*u.factor)::decimal(16,2) as product_qty,
- sum(-pt.standard_price * m.product_qty * u.factor)::decimal(16,2) as value
- from
+ coalesce(sum(-m.product_qty * u.factor)::decimal, 0.0) as product_qty,
+ coalesce(sum(-pt.standard_price * m.product_qty * u.factor)::decimal, 0.0) as value
+ FROM
stock_move m
- left join stock_picking p on (m.picking_id=p.id)
- left join product_product pp on (m.product_id=pp.id)
- left join product_template pt on (pp.product_tmpl_id=pt.id)
- left join product_uom u on (m.product_uom=u.id)
- left join stock_location l on (m.location_id=l.id)
- group by
- m.id, m.product_id, m.address_id, m.location_id, m.prodlot_id,
- m.date_planned, m.state, l.usage, m.company_id
-) union all (
- select
- -m.id as id, m.date_planned as date_planned,
+ LEFT JOIN stock_picking p ON (m.picking_id=p.id)
+ LEFT JOIN product_product pp ON (m.product_id=pp.id)
+ LEFT JOIN product_template pt ON (pp.product_tmpl_id=pt.id)
+ LEFT JOIN product_uom u ON (m.product_uom=u.id)
+ LEFT JOIN stock_location l ON (m.location_id=l.id)
+ GROUP BY
+ m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id,
+ m.prodlot_id, m.date, m.state, l.usage, m.company_id
+) UNION ALL (
+ SELECT
+ -m.id as id, m.date as date,
m.address_id as partner_id, m.location_dest_id as location_id,
- m.product_id as product_id, l.usage as location_type,
+ m.product_id as product_id, pt.categ_id as product_categ_id, l.usage as location_type,
m.company_id,
m.state as state, m.prodlot_id as prodlot_id,
- sum(m.product_qty*u.factor)::decimal(16,2) as product_qty,
- sum(pt.standard_price * m.product_qty * u.factor)::decimal(16,2) as value
- from
+ coalesce(sum(m.product_qty*u.factor)::decimal, 0.0) as product_qty,
+ coalesce(sum(pt.standard_price * m.product_qty * u.factor)::decimal, 0.0) as value
+ FROM
stock_move m
- left join stock_picking p on (m.picking_id=p.id)
- left join product_product pp on (m.product_id=pp.id)
- left join product_template pt on (pp.product_tmpl_id=pt.id)
- left join product_uom u on (m.product_uom=u.id)
- left join stock_location l on (m.location_dest_id=l.id)
- group by
- m.id, m.product_id, m.address_id, m.location_id, m.location_dest_id,
- m.prodlot_id, m.date_planned, m.state, l.usage, m.company_id
+ LEFT JOIN stock_picking p ON (m.picking_id=p.id)
+ LEFT JOIN product_product pp ON (m.product_id=pp.id)
+ LEFT JOIN product_template pt ON (pp.product_tmpl_id=pt.id)
+ LEFT JOIN product_uom u ON (m.product_uom=u.id)
+ LEFT JOIN stock_location l ON (m.location_dest_id=l.id)
+ GROUP BY
+ m.id, m.product_id, m.product_uom, pt.categ_id, m.address_id, m.location_id, m.location_dest_id,
+ m.prodlot_id, m.date, m.state, l.usage, m.company_id
)
);
""")
diff --git a/addons/stock/report/report_stock_move_view.xml b/addons/stock/report/report_stock_move_view.xml
index 6377bd38e9a..e1db3ebfa49 100644
--- a/addons/stock/report/report_stock_move_view.xml
+++ b/addons/stock/report/report_stock_move_view.xml
@@ -13,7 +13,7 @@
tree
-
+
@@ -24,12 +24,15 @@
+
+
-
-
-
-
+
+
+
+
+
@@ -42,7 +45,18 @@
-
+
+
+
+
+
+ report.stock.move.graph
+ report.stock.move
+ graph
+
+
+
+
@@ -54,52 +68,43 @@
-
-
+ domain="[('date','<=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date','>',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]"
+ help="Last month"/>
+
-
-
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
-
-
+
@@ -109,13 +114,25 @@
+
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -126,28 +143,28 @@
form
tree,graph
- {'contact_display': 'partner', 'search_default_month':1, 'search_default_group_product':1,'search_default_done':1,'group_by':[], 'group_by_no_leaf':1}
+ {'full':'1','contact_display': 'partner','search_default_done':1, 'search_default_month':1, 'search_default_group_type':1, 'group_by': [], 'group_by_no_leaf':1,}
-
report.stock.inventory.tree
report.stock.inventory
tree
-
+
+
-
-
+
+
@@ -173,43 +190,46 @@
+ help="Analysis of current inventory (only moves that have already been processed)"/>
+ help = "Analysis including future moves (similar to virtual stock)"/>
-
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -220,7 +240,7 @@
form
tree,graph
- {'contact_display': 'partner', 'search_default_real':1, 'search_default_location_type_internal':1,'search_default_group_product':1,'search_default_group_location':1,'group_by':[], 'group_by_no_leaf':1}
+ {'contact_display': 'partner', 'search_default_real':1, 'search_default_location_type_internal':1,'search_default_group_product':1,'group_by':[], 'group_by_no_leaf':1}
diff --git a/addons/stock/report/report_stock_picking.py b/addons/stock/report/report_stock_picking.py
deleted file mode 100644
index 81f20ed8906..00000000000
--- a/addons/stock/report/report_stock_picking.py
+++ /dev/null
@@ -1,113 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-from osv import fields,osv
-import tools
-
-class report_stock_picking(osv.osv):
- _name = "report.stock.picking"
- _description = "Stock Picking Report"
- _auto = False
- _columns = {
- 'year': fields.char('Year',size=64,required=False, readonly=True),
- 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), ('05','May'), ('06','June'),
- ('07','July'), ('08','August'), ('09','September'), ('10','October'), ('11','November'), ('12','December')],'Month',readonly=True),
- 'day': fields.char('Day', size=128, readonly=True),
- 'nbr': fields.integer('# of Lines', readonly=True),
- 'nbp': fields.integer('# of Picking', readonly=True),
- 'partner_id':fields.many2one('res.partner', 'Partner', readonly=True),
- 'product_qty': fields.float('# of Products', readonly=True),
- 'product_uos_qty': fields.float('# of Products', readonly=True),
- 'product_id': fields.many2one('product.product', 'Product', readonly=True),
- 'date': fields.date('Date', readonly=True),
- 'avg_days_late': fields.float('Avg Due Days', digits=(16,2), readonly=True, group_operator="avg"),
- 'avg_days_to_deliver': fields.float('Avg Days to Deliver', digits=(16,2), readonly=True, group_operator="avg",
- help="Number of Avg Days to deliver"),
- 'state': fields.selection([('draft', 'Draft'),('auto', 'Waiting'),('confirmed', 'Confirmed'),('assigned', 'Available'),('done', 'Done'),('cancel', 'Cancelled')], 'State'),
- 'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal'), ('delivery', 'Delivery')], 'Shipping Type', required=True),
- 'company_id': fields.many2one('res.company', 'Company', readonly=True),
- 'invoice_state': fields.selection([
- ("invoiced", "Invoiced"),
- ("2binvoiced", "To Be Invoiced"),
- ("none", "Not from Picking")], "Invoice Status",readonly=True),
- 'min_date': fields.date('Expected Date',help="Expected date for Picking. Default it takes current date"),
- 'order_date': fields.date('Order Date', help="Date of Order"),
- 'date_done': fields.date('Date Done', help="Date of completion"),
- 'location_id': fields.many2one('stock.location', 'Source Location', help="Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."),
- 'location_dest_id': fields.many2one('stock.location', 'Dest. Location', help="Location where the system will stock the finished products."),
- 'max_date': fields.date('Max.Expected Date'),
- 'product_uos': fields.many2one('product.uom', 'Product UOS'),
- 'product_uom': fields.many2one('product.uom', 'Product UOM'),
- }
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'report_stock_picking')
- cr.execute("""
- create or replace view report_stock_picking as (
- select
- min(sm.id) as id,
- date_trunc('day',sp.min_date) as min_date,
- date_trunc('day',sp.date) as order_date,
- date_trunc('day',sp.date_done) as date_done,
- date_trunc('day',sp.max_date) as max_date,
- to_char(sp.create_date, 'YYYY') as year,
- to_char(sp.create_date, 'MM') as month,
- to_char(sp.create_date, 'YYYY-MM-DD') as day,
- sp.address_id as partner_id,
- to_date(to_char(sp.create_date, 'MM-dd-YYYY'),'MM-dd-YYYY') as date,
- count(sm.id) as nbr,
- count(sp.id) as nbp,
- sum(sm.product_qty*u.factor) as product_qty,
- sum(sm.product_uos_qty) as product_uos_qty,
- sm.product_id as product_id,
- sm.location_dest_id as location_dest_id,
- sm.location_id as location_id,
- sp.type,
- sm.product_uos,
- sm.product_uom,
- sp.invoice_state,
- sp.company_id as company_id,
- avg(extract('epoch' from (sp.date_done-sp.create_date)))/(3600*24) as avg_days_to_deliver,
- avg(extract('epoch' from (sp.date_done-sp.min_date)))/(3600*24) as avg_days_late,
- sp.state
- from stock_picking as sp
- Inner join stock_move as sm ON (sm.picking_id=sp.id)
- Inner join product_uom u on (u.id=sm.product_uom)
- group by sp.type,
- sp.create_date,
- sp.address_id,
- sm.product_id,
- to_char(sp.create_date, 'YYYY'),
- sm.location_dest_id,
- sm.location_id,
- to_char(sp.create_date, 'MM'),
- to_char(sp.create_date, 'YYYY-MM-DD'),
- sm.product_uos,
- sm.product_uom,
- date_trunc('day',sp.min_date),
- date_trunc('day',sp.date),
- date_trunc('day',sp.date_done),
- date_trunc('day',sp.max_date),
- sp.invoice_state,
- sp.company_id,
- sp.state
-
- )""")
-report_stock_picking()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/report/report_stock_picking_view.xml b/addons/stock/report/report_stock_picking_view.xml
deleted file mode 100644
index edbd9e66b7d..00000000000
--- a/addons/stock/report/report_stock_picking_view.xml
+++ /dev/null
@@ -1,138 +0,0 @@
-
-
-
-
-
-
- report.stock.picking.tree
- report.stock.picking
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- report.stock.picking.graph
- report.stock.picking
- graph
-
-
-
-
-
-
-
-
-
-
-
- report.stock.picking.select
- report.stock.picking
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Picking
- report.stock.picking
- form
- tree,graph
-
-
- {'search_default_Partner':1,'search_default_month':1,'group_by_no_leaf':1,'group_by':[]}
-
-
-
-
- tree
-
-
-
-
-
-
- graph
-
-
-
-
-
-
-
-
-
diff --git a/addons/stock/report/stock_inventory_move.rml b/addons/stock/report/stock_inventory_move.rml
index 7cb18a4e161..9531c534dec 100755
--- a/addons/stock/report/stock_inventory_move.rml
+++ b/addons/stock/report/stock_inventory_move.rml
@@ -151,7 +151,7 @@
-
+
Location
@@ -172,7 +172,7 @@
[[ repeatIn(o.inventory_line_id, 'p') ]]
-
+
[[ p.location_id.name ]]
@@ -181,7 +181,7 @@
[[ p.prod_lot_id and p.prod_lot_id.name or '' ]]
- [[ p.product_id.name ]]
+ [ [[ p.product_id.code ]] ] [[ p.product_id.name ]]
[[ formatLang(p.product_qty) ]] [[ p.product_uom.name ]]
@@ -189,7 +189,7 @@
-
+
Total:
@@ -203,4 +203,4 @@
-
\ No newline at end of file
+
diff --git a/addons/stock/security/ir.model.access.csv b/addons/stock/security/ir.model.access.csv
index a120ce0c571..e879a03e9e1 100644
--- a/addons/stock/security/ir.model.access.csv
+++ b/addons/stock/security/ir.model.access.csv
@@ -32,17 +32,12 @@
"access_stock_lines_date_manager","report.stock.lines.date manager","model_report_stock_lines_date","stock.group_stock_manager",1,1,1,1
"access_stock_lines_date_system","report.stock.lines.date system","model_report_stock_lines_date","base.group_system",1,0,0,0
"access_stock_report_tracklots","stock.report.tracklots","model_stock_report_tracklots","stock.group_stock_user",1,1,1,1
-"access_report_products_to_received_planned","report.products.to.received.planned","model_report_products_to_received_planned","stock.group_stock_user",1,1,1,1
-"access_report_delivery_products_planned","report.delivery.products.planned","model_report_delivery_products_planned","stock.group_stock_user",1,1,1,1
"access_report_stock_move_user","report.stock.move user","model_report_stock_move","stock.group_stock_user",1,0,0,0
"access_report_stock_move_system","report.stock.move system","model_report_stock_move","base.group_system",1,0,0,0
"access_report_stock_move_manager","report.stock.move manager","model_report_stock_move","stock.group_stock_manager",1,1,1,1
"access_report_stock_inventory_user","report.stock.inventory user","model_report_stock_inventory","stock.group_stock_user",1,1,1,1
"access_report_stock_inventory_manager","report.stock.inventory manager","model_report_stock_inventory","stock.group_stock_manager",1,1,1,1
"access_report_stock_inventory_system","report.stock.inventory system","model_report_stock_inventory","base.group_system",1,0,0,0
-"access_report_stock_picking_user","report.stock.picking user","model_report_stock_picking","stock.group_stock_user",1,1,1,1
-"access_report_stock_picking_manager","report.stock.picking manager","model_report_stock_picking","stock.group_stock_manager",1,1,1,1
-"access_report_stock_picking_system","report.stock.picking system","model_report_stock_picking","base.group_system",1,0,0,0
"access_stock_warehouse_system","stock.warehouse.system","model_stock_warehouse","base.group_system",1,1,1,1
"access_stock_location_system","stock.location.system","model_stock_location","base.group_system",1,1,1,1
"access_stock_journal_system","stock.journal.system","model_stock_journal","base.group_system",1,1,1,1
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index ae0f712f6b5..0b1bbe3695f 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -25,6 +25,7 @@ from operator import itemgetter
from itertools import groupby
from osv import fields, osv
+from tools import config
from tools.translate import _
import netsvc
import tools
@@ -61,7 +62,6 @@ class stock_journal(osv.osv):
}
stock_journal()
-
#----------------------------------------------------------
# Stock Location
#----------------------------------------------------------
@@ -105,6 +105,7 @@ class stock_location(osv.osv):
res[m.id] = _get_one_full_name(m)
return res
+
def _product_value(self, cr, uid, ids, field_names, arg, context=None):
"""Computes stock value (real and virtual) for a product, as well as stock qty (real and virtual).
@param field_names: Name of field
@@ -124,7 +125,6 @@ class stock_location(osv.osv):
currency_obj = self.pool.get('res.currency')
currency = self.pool.get('res.currency').browse(cr, uid, currency_id)
currency_obj.round(cr, uid, currency, 300)
-
for loc_id, product_ids in products_by_location.items():
c = (context or {}).copy()
c['location'] = loc_id
@@ -144,7 +144,6 @@ class stock_location(osv.osv):
amount = prod.virtual_available * prod.standard_price
amount = currency_obj.round(cr, uid, currency, amount)
result[loc_id][f] += amount
-
return result
_columns = {
@@ -187,7 +186,7 @@ class stock_location(osv.osv):
"validated automatically. With 'Manual Operation', the stock move has to be validated "\
"by a worker. With 'Automatic No Step Added', the location is replaced in the original move."
),
- 'chained_picking_type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal'), ('delivery', 'Delivery')], 'Shipping Type', help="Shipping Type of the Picking List that will contain the chained move (leave empty to automatically detect the type based on the source and destination locations)."),
+ 'chained_picking_type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal')], 'Shipping Type', help="Shipping Type of the Picking List that will contain the chained move (leave empty to automatically detect the type based on the source and destination locations)."),
'chained_company_id': fields.many2one('res.company', 'Chained Company', help='The company the Picking List containing the chained move will belong to (leave empty to use the default company determination rules'),
'chained_delay': fields.integer('Chaining Lead Time',help="Delay between original move and chained move in days"),
'address_id': fields.many2one('res.partner.address', 'Location Address',help="Address of customer or supplier."),
@@ -200,8 +199,8 @@ class stock_location(osv.osv):
'parent_left': fields.integer('Left Parent', select=1),
'parent_right': fields.integer('Right Parent', select=1),
- 'stock_real_value': fields.function(_product_value, method=True, type='float', string='Real Stock Value', multi="stock"),
- 'stock_virtual_value': fields.function(_product_value, method=True, type='float', string='Virtual Stock Value', multi="stock"),
+ 'stock_real_value': fields.function(_product_value, method=True, type='float', string='Real Stock Value', multi="stock", digits_compute=dp.get_precision('Account')),
+ 'stock_virtual_value': fields.function(_product_value, method=True, type='float', string='Virtual Stock Value', multi="stock", digits_compute=dp.get_precision('Account')),
'company_id': fields.many2one('res.company', 'Company', select=1, help='Let this field empty if this location is shared between all companies'),
'scrap_location': fields.boolean('Scrap Location', help='Check this box to allow using this location to put scrapped/damaged goods.'),
}
@@ -243,7 +242,7 @@ class stock_location(osv.osv):
"""
result = 'internal'
if (from_location.usage=='internal') and (to_location and to_location.usage in ('customer', 'supplier')):
- result = 'delivery'
+ result = 'out'
elif (from_location.usage in ('supplier', 'customer')) and (to_location.usage == 'internal'):
result = 'in'
return result
@@ -262,8 +261,6 @@ class stock_location(osv.osv):
context = {}
product_obj = self.pool.get('product.product')
# Take the user company and pricetype
- price_type_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.property_valuation_price_type.id
- pricetype = self.pool.get('product.price.type').browse(cr, uid, price_type_id)
context['currency_id'] = self.pool.get('res.users').browse(cr, uid, uid).company_id.currency_id.id
# To be able to offer recursive or non-recursive reports we need to prevent recursive quantities by default
@@ -302,7 +299,7 @@ class stock_location(osv.osv):
# Compute based on pricetype
# Choose the right filed standard_price to read
- amount_unit = product.price_get(pricetype.field, context)[product.id]
+ amount_unit = product.price_get('standard_price', context)[product.id]
price = qty[product_id] * amount_unit
total_price += price
@@ -540,12 +537,12 @@ class stock_picking(osv.osv):
ids = [ids]
for pick in self.browse(cr, uid, ids, context):
sql_str = """update stock_move set
- date_planned='%s'
+ date='%s'
where
picking_id=%d """ % (value, pick.id)
if pick.max_date:
- sql_str += " and (date_planned='" + pick.max_date + "' or date_planned>'" + value + "')"
+ sql_str += " and (date='" + pick.max_date + "' or date>'" + value + "')"
cr.execute(sql_str)
return True
@@ -562,11 +559,11 @@ class stock_picking(osv.osv):
ids = [ids]
for pick in self.browse(cr, uid, ids, context=context):
sql_str = """update stock_move set
- date_planned='%s'
+ date='%s'
where
picking_id=%s """ % (value, pick.id)
if pick.min_date:
- sql_str += " and (date_planned='" + pick.min_date + "' or date_planned<'" + value + "')"
+ sql_str += " and (date='" + pick.min_date + "' or date<'" + value + "')"
cr.execute(sql_str)
return True
@@ -581,8 +578,8 @@ class stock_picking(osv.osv):
return res
cr.execute("""select
picking_id,
- min(date_planned),
- max(date_planned)
+ min(date),
+ max(date)
from
stock_move
where
@@ -605,7 +602,7 @@ class stock_picking(osv.osv):
'name': fields.char('Reference', size=64, select=True),
'origin': fields.char('Origin', size=64, help="Reference of the document that produced this picking.", select=True),
'backorder_id': fields.many2one('stock.picking', 'Back Order of', help="If this picking was split this field links to the picking that contains the other part that has been processed already.", select=True),
- 'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal'), ('delivery', 'Delivery')], 'Shipping Type', required=True, select=True, help="Shipping type specify, goods coming in or going out."),
+ 'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal')], 'Shipping Type', required=True, select=True, help="Shipping type specify, goods coming in or going out."),
'note': fields.text('Notes'),
'stock_journal_id': fields.many2one('stock.journal','Stock Journal', select=True),
'location_id': fields.many2one('stock.location', 'Location', help="Keep empty if you produce at the location where the finished products are needed." \
@@ -628,14 +625,15 @@ class stock_picking(osv.osv):
"* Done: has been processed, can't be modified or cancelled anymore\n"\
"* Cancelled: has been cancelled, can't be confirmed anymore"),
'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date",
- method=True, store=True, type='datetime', string='Expected Date', select=1, help="Expected date for the picking to be processed. Will be set to date of actual processing if not specified."),
+ method=True, store=True, type='datetime', string='Expected Date', select=1, help="Expected date for the picking to be processed"),
'date': fields.datetime('Order Date', help="Date of Order", select=True),
'date_done': fields.datetime('Date Done', help="Date of Completion"),
'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date",
method=True, store=True, type='datetime', string='Max. Expected Date', select=2),
'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', 'Partner', help="Address of partner"),
+ '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',store=True),
'invoice_state': fields.selection([
("invoiced", "Invoiced"),
("2binvoiced", "To Be Invoiced"),
@@ -767,7 +765,7 @@ class stock_picking(osv.osv):
self.log_picking(cr, uid, ids, context=context)
return True
- def test_finnished(self, cr, uid, ids):
+ def test_finished(self, cr, uid, ids):
""" Tests whether the move is in done or cancel state or not.
@return: True or False
"""
@@ -837,6 +835,7 @@ class stock_picking(osv.osv):
""" Gets payment term from partner.
@return: Payment term
"""
+ partner_obj = self.pool.get('res.partner')
partner = picking.address_id.partner_id
return partner.property_payment_term and partner.property_payment_term.id or False
@@ -867,11 +866,8 @@ class stock_picking(osv.osv):
if type in ('in_invoice', 'in_refund'):
# Take the user company and pricetype
- price_type_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.property_valuation_price_type.id
- pricetype = self.pool.get('product.price.type').browse(cr, uid, price_type_id)
context['currency_id'] = move_line.company_id.currency_id.id
-
- amount_unit = move_line.product_id.price_get(pricetype.field, context)[move_line.product_id.id]
+ amount_unit = move_line.product_id.price_get('standard_price', context)[move_line.product_id.id]
return amount_unit
else:
return move_line.product_id.list_price
@@ -1017,12 +1013,6 @@ class stock_picking(osv.osv):
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)
- notes = False
- if ('sale_line_id' in move_line._columns.keys()) and move_line.sale_line_id:
- notes = move_line.sale_line_id.notes
- elif ('purchase_line_id' in move_line._columns.keys()) and move_line.purchase_line_id:
- notes = move_line.purchase_line_id.notes
-
invoice_line_id = invoice_line_obj.create(cr, uid, {
'name': name,
'origin': origin,
@@ -1035,7 +1025,6 @@ class stock_picking(osv.osv):
'quantity': move_line.product_uos_qty or move_line.product_qty,
'invoice_line_tax_id': [(6, 0, tax_ids)],
'account_analytic_id': account_analytic_id,
- 'note': notes,
}, context=context)
self._invoice_line_hook(cr, uid, move_line, invoice_line_id)
@@ -1074,7 +1063,15 @@ 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 !'))
+ return True
def unlink(self, cr, uid, ids, context=None):
move_obj = self.pool.get('stock.move')
if context is None:
@@ -1094,6 +1091,7 @@ class stock_picking(osv.osv):
return super(stock_picking, self).unlink(cr, uid, ids, context=context)
+ # FIXME: needs refactoring, this code is partially duplicated in stock_move.do_partial()!
def do_partial(self, cr, uid, ids, partial_datas, context=None):
""" Makes partial picking and moves done.
@param partial_datas : Dictionary containing details of partial picking
@@ -1101,19 +1099,29 @@ class stock_picking(osv.osv):
delivery moves with product_id, product_qty, uom
@return: Dictionary of values
"""
+ import pdb
+ #pdb.set_trace()
+ if context is None:
+ context = {}
+ else:
+ context = dict(context)
res = {}
move_obj = self.pool.get('stock.move')
product_obj = self.pool.get('product.product')
currency_obj = self.pool.get('res.currency')
- users_obj = self.pool.get('res.users')
uom_obj = self.pool.get('product.uom')
price_type_obj = self.pool.get('product.price.type')
sequence_obj = self.pool.get('ir.sequence')
wf_service = netsvc.LocalService("workflow")
+ partner_id = partial_datas.get('partner_id', False)
+ address_id = partial_datas.get('address_id', False)
+ delivery_date = partial_datas.get('delivery_date', False)
for pick in self.browse(cr, uid, ids, context=context):
new_picking = None
+ new_moves = []
complete, too_many, too_few = [], [], []
move_product_qty = {}
+ prodlot_ids = {}
for move in pick.move_lines:
if move.state in ('done', 'cancel'):
continue
@@ -1124,6 +1132,8 @@ class stock_picking(osv.osv):
product_uom = partial_data.get('product_uom',False)
product_price = partial_data.get('product_price',0.0)
product_currency = partial_data.get('product_currency',False)
+ prodlot_id = partial_data.get('prodlot_id')
+ prodlot_ids[move.id] = prodlot_id
if move.product_qty == product_qty:
complete.append(move)
elif move.product_qty > product_qty:
@@ -1134,35 +1144,36 @@ class stock_picking(osv.osv):
# Average price computation
if (pick.type == 'in') and (move.product_id.cost_method == 'average'):
product = product_obj.browse(cr, uid, move.product_id.id)
- user = users_obj.browse(cr, uid, uid)
- context['currency_id'] = move.company_id.currency_id.id
+ move_currency_id = move.company_id.currency_id.id
+ context['currency_id'] = move_currency_id
qty = uom_obj._compute_qty(cr, uid, product_uom, product_qty, product.uom_id.id)
- pricetype = False
- if user.company_id.property_valuation_price_type:
- pricetype = price_type_obj.browse(cr, uid, user.company_id.property_valuation_price_type.id)
- if pricetype and qty > 0:
+ if qty > 0:
new_price = currency_obj.compute(cr, uid, product_currency,
- user.company_id.currency_id.id, product_price)
+ move_currency_id, product_price)
new_price = uom_obj._compute_price(cr, uid, product_uom, new_price,
product.uom_id.id)
if product.qty_available <= 0:
new_std_price = new_price
else:
# Get the standard price
- amount_unit = product.price_get(pricetype.field, context)[product.id]
+ amount_unit = product.price_get('standard_price', context)[product.id]
new_std_price = ((amount_unit * product.qty_available)\
+ (new_price * qty))/(product.qty_available + qty)
# Write the field according to price type field
- product_obj.write(cr, uid, [product.id],
- {pricetype.field: new_std_price})
- move_obj.write(cr, uid, [move.id], {'price_unit': new_price})
+ product_obj.write(cr, uid, [product.id], {'standard_price': new_std_price})
+
+ # 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],
+ {'price_unit': product_price,
+ 'price_currency_id': product_currency})
for move in too_few:
product_qty = move_product_qty[move.id]
- if not new_picking:
+ if not new_picking:
new_picking = self.copy(cr, uid, pick.id,
{
'name': sequence_obj.get(cr, uid, 'stock.picking.%s'%(pick.type)),
@@ -1170,48 +1181,48 @@ class stock_picking(osv.osv):
'state':'draft',
})
if product_qty != 0:
-
- move_obj.copy(cr, uid, move.id,
- {
+ defaults = {
'product_qty' : product_qty,
'product_uos_qty': product_qty, #TODO: put correct uos_qty
'picking_id' : new_picking,
'state': 'assigned',
'move_dest_id': False,
'price_unit': move.price_unit,
- })
+ }
+ prodlot_id = prodlot_ids[move.id]
+ if prodlot_id:
+ defaults.update(prodlot_id=prodlot_id)
+ new_obj = move_obj.copy(cr, uid, move.id, defaults)
move_obj.write(cr, uid, [move.id],
{
'product_qty' : move.product_qty - product_qty,
'product_uos_qty':move.product_qty - product_qty, #TODO: put correct uos_qty
-
})
if new_picking:
move_obj.write(cr, uid, [c.id for c in complete], {'picking_id': new_picking})
- for move in too_many:
- product_qty = move_product_qty[move.id]
- move_obj.write(cr, uid, [move.id],
- {
- 'product_qty' : product_qty,
- 'product_uos_qty': product_qty, #TODO: put correct uos_qty
- 'picking_id': new_picking,
- })
- else:
- for move in too_many:
- product_qty = move_product_qty[move.id]
- move_obj.write(cr, uid, [move.id],
- {
- 'product_qty': product_qty,
- 'product_uos_qty': product_qty #TODO: put correct uos_qty
- })
+ for move in complete:
+ if prodlot_ids.get(move.id):
+ move_obj.write(cr, uid, move.id, {'prodlot_id': prodlot_ids[move.id]})
+ for move in too_many:
+ product_qty = move_product_qty[move.id]
+ defaults = {
+ 'product_qty' : product_qty,
+ 'product_uos_qty': product_qty, #TODO: put correct uos_qty
+ }
+ prodlot_id = prodlot_ids.get(move.id)
+ if prodlot_ids.get(move.id):
+ defaults.update(prodlot_id=prodlot_id)
+ if new_picking:
+ defaults.update(picking_id=new_picking)
+ move_obj.write(cr, uid, [move.id], defaults)
+
# At first we confirm the new picking (if necessary)
if new_picking:
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
- # Then we finish the good picking
- if new_picking:
+ # Then we finish the good picking
self.write(cr, uid, [pick.id], {'backorder_id': new_picking})
self.action_move(cr, uid, [new_picking])
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_done', cr)
@@ -1240,7 +1251,6 @@ class stock_picking(osv.osv):
'out':'Picking List',
'in':'Reception',
'internal': 'Internal picking',
- 'delivery': 'Delivery order'
}
message = type_list.get(pick.type, _('Document')) + " '" + (pick.name or 'n/a') + "' "
if pick.min_date:
@@ -1326,7 +1336,9 @@ class stock_production_lot(osv.osv):
'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),
'date': fields.datetime('Creation Date', required=True),
- 'stock_available': fields.function(_get_stock, fnct_search=_stock_search, method=True, type="float", string="Available", select="2", help="Current quantity of products with this Production Lot Number available in company warehouses"),
+ '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'),
'company_id': fields.many2one('res.company', 'Company', select=True),
'move_ids': fields.one2many('stock.move', 'prodlot_id', 'Moves for this production lot', readonly=True),
@@ -1426,20 +1438,19 @@ class stock_move(osv.osv):
_columns = {
'name': fields.char('Name', size=64, required=True, select=True),
'priority': fields.selection([('0', 'Not urgent'), ('1', 'Urgent')], 'Priority'),
+ 'create_date': fields.datetime('Creation Date', readonly=True),
+ 'date': fields.datetime('Date', required=True, help="Move date: scheduled date until move is done, then date of actual move processing", readonly=True),
+ 'date_expected': fields.datetime('Scheduled Date', required=True, help="Scheduled date for the processing of this move"),
+ 'product_id': fields.many2one('product.product', 'Product', required=True, select=True, domain=[('type','<>','service')],states={'done': [('readonly', True)]}),
- 'date': fields.datetime('Creation Date', select=True),
- 'date_planned': fields.datetime('Date', required=True, help="Scheduled date for the movement of the products or real date if the move is done."),
- 'date_expected': fields.datetime('Date Expected', readonly=True,required=True, help="Scheduled date for the movement of the products"),
- 'product_id': fields.many2one('product.product', 'Product', required=True, select=True, domain=[('type','<>','service')]),
-
- 'product_qty': fields.float('Quantity', required=True),
- 'product_uom': fields.many2one('product.uom', 'Unit of Measure', required=True),
- 'product_uos_qty': fields.float('Quantity (UOS)'),
+ 'product_qty': fields.float('Quantity', digits_compute=dp.get_precision('Product UoM'), required=True,states={'done': [('readonly', True)]}),
+ 'product_uom': fields.many2one('product.uom', 'Unit of Measure', required=True,states={'done': [('readonly', True)]}),
+ 'product_uos_qty': fields.float('Quantity (UOS)', digits_compute=dp.get_precision('Product UoM')),
'product_uos': fields.many2one('product.uom', 'Product UOS'),
'product_packaging': fields.many2one('product.packaging', 'Packaging', help="It specifies attributes of packaging like type, quantity of packaging,etc."),
- 'location_id': fields.many2one('stock.location', 'Source Location', required=True, select=True, help="Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."),
- 'location_dest_id': fields.many2one('stock.location', 'Destination Location', required=True, select=True, help="Location where the system will stock the finished products."),
+ 'location_id': fields.many2one('stock.location', 'Source Location', required=True, select=True,states={'done': [('readonly', True)]}, help="Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."),
+ 'location_dest_id': fields.many2one('stock.location', 'Destination Location', required=True,states={'done': [('readonly', True)]}, select=True, help="Location where the system will stock the finished products."),
'address_id': fields.many2one('res.partner.address', 'Destination Address', help="Optional address where goods are to be delivered, specifically used for allotment"),
'prodlot_id': fields.many2one('stock.production.lot', 'Production Lot', help="Production lot is used to put a serial number on the production", select=True),
@@ -1450,13 +1461,13 @@ 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),
+ 'picking_id': fields.many2one('stock.picking', 'Picking List', 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\'.\
\nThe state is \'Waiting\' if the move is waiting for another one.'),
- 'price_unit': fields.float('Unit Price',
- digits_compute= dp.get_precision('Account')),
+ 'price_unit': fields.float('Unit Price', digits_compute= dp.get_precision('Account'), help="Technical field used to record the product cost set by the user during a picking confirmation (when average price costing method is used)"),
+ 'price_currency_id': fields.many2one('res.currency', 'Currency for average price', help="Technical field used to record the currency chosen by the user during a picking confirmation (when average price costing method is used)"),
'company_id': fields.many2one('res.company', 'Company', required=True, select=True),
'partner_id': fields.related('picking_id','address_id','partner_id',type='many2one', relation="res.partner", string="Partner", store=True, select=True),
'backorder_id': fields.related('picking_id','backorder_id',type='many2one', relation="stock.picking", string="Back Order", select=True),
@@ -1509,7 +1520,6 @@ class stock_move(osv.osv):
'priority': '1',
'product_qty': 1.0,
'scrapped' : False,
- 'date_planned': time.strftime('%Y-%m-%d %H:%M:%S'),
'date': time.strftime('%Y-%m-%d %H:%M:%S'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.move', context=c),
'date_expected': time.strftime('%Y-%m-%d %H:%M:%S'),
@@ -1517,9 +1527,9 @@ class stock_move(osv.osv):
def write(self, cr, uid, ids, vals, context=None):
if uid != 1:
+ frozen_fields = set(['product_qty', 'product_uom', 'product_uos_qty', 'product_uos', 'location_id', 'location_dest_id', 'product_id'])
for move in self.browse(cr, uid, ids):
if move.state == 'done':
- frozen_fields = set(['product_qty', 'product_uom', 'product_uos_qty', 'product_uos', 'location_id', 'location_dest_id', 'product_id'])
if frozen_fields.intersection(vals):
raise osv.except_osv(_('Operation forbidden'),
_('Quantities, UoMs, Products and Locations cannot be modified on stock moves that have already been processed (except by the Administrator)'))
@@ -1641,21 +1651,48 @@ class stock_move(osv.osv):
)
if dest:
if dest[1] == 'transparent':
+ newdate = (datetime.strptime(m.date, '%Y-%m-%d %H:%M:%S') + relativedelta(days=dest[2] or 0)).strftime('%Y-%m-%d')
self.write(cr, uid, [m.id], {
- 'date_planned': (datetime.strptime(m.date_planned, '%Y-%m-%d %H:%M:%S') + \
- relativedelta(days=dest[2] or 0)).strftime('%Y-%m-%d'),
+ 'date': newdate,
'location_dest_id': dest[0].id})
+ if m.picking_id and (dest[3] or dest[5]):
+ self.pool.get('stock.picking').write(cr, uid, [m.picking_id.id], {
+ 'stock_journal_id': dest[3] or m.picking_id.stock_journal_id.id,
+ 'type': dest[5] or m.picking_id.type
+ }, context=context)
+ m.location_dest_id = dest[0]
+ res2 = self._chain_compute(cr, uid, [m], context=context)
+ for pick_id in res2.keys():
+ result.setdefault(pick_id, [])
+ result[pick_id] += res2[pick_id]
else:
result.setdefault(m.picking_id, [])
result[m.picking_id].append( (m, dest) )
return result
-
+ def _create_chained_picking(self, cr, uid, pick_name,picking,ptype,move, context=None):
+ res_obj = self.pool.get('res.company')
+ picking_obj = self.pool.get('stock.picking')
+ pick_id= picking_obj.create(cr, uid, {
+ 'name': pick_name,
+ 'origin': str(picking.origin or ''),
+ 'type': ptype,
+ 'note': picking.note,
+ 'move_type': picking.move_type,
+ 'auto_picking': move[0][1][1] == 'auto',
+ 'stock_journal_id': move[0][1][3],
+ 'company_id': move[0][1][4] or res_obj._company_default_get(cr, uid, 'stock.company', context=context),
+ 'address_id': picking.address_id.id,
+ 'invoice_state': 'none',
+ 'date': picking.date,
+ })
+ return pick_id
def action_confirm(self, cr, uid, ids, context=None):
""" Confirms stock move.
@return: List of ids.
"""
moves = self.browse(cr, uid, ids)
self.write(cr, uid, ids, {'state': 'confirmed'})
+ i = 0
def create_chained_picking(self, cr, uid, moves, context=None):
new_moves = []
@@ -1667,29 +1704,10 @@ class stock_move(osv.osv):
for picking, todo in self._chain_compute(cr, uid, moves, context=context).items():
ptype = todo[0][1][5] and todo[0][1][5] or self.pool.get('stock.location').picking_type_get(cr, uid, todo[0][0].location_dest_id, todo[0][1][0])
pick_name = picking.name or ''
- if ptype == 'delivery':
- pick_name = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.delivery')
- check_picking_ids = picking_obj.search(cr, uid, [('name','=',picking.name),('origin','=',str(picking.origin or '')),('type','=',ptype),('move_type','=',picking.move_type)])
- if check_picking_ids:
- pickid = check_picking_ids[0]
+ if picking:
+ pickid = self._create_chained_picking(cr, uid, pick_name,picking,ptype,todo,context)
else:
- if picking:
- pickid = picking_obj.create(cr, uid, {
- 'name': pick_name,
- 'origin': str(picking.origin or ''),
- 'type': ptype,
- 'note': picking.note,
- 'move_type': picking.move_type,
- 'auto_picking': todo[0][1][1] == 'auto',
- 'stock_journal_id': todo[0][1][3],
- 'company_id': todo[0][1][4] or res_obj._company_default_get(cr, uid, 'stock.company', context=context),
- 'address_id': picking.address_id.id,
- 'invoice_state': 'none',
- 'date': picking.date,
- 'sale_id':' sale_id' in picking._columns.keys() and picking.sale_id.id or False
- })
- else:
- pickid = False
+ pickid = False
for move, (loc, auto, delay, journal, company_id, ptype) in todo:
new_id = move_obj.copy(cr, uid, move.id, {
'location_id': move.location_dest_id.id,
@@ -1699,7 +1717,7 @@ class stock_move(osv.osv):
'state': 'waiting',
'company_id': company_id or res_obj._company_default_get(cr, uid, 'stock.company', context=context) ,
'move_history_ids': [],
- 'date_planned': (datetime.strptime(move.date_planned, '%Y-%m-%d %H:%M:%S') + relativedelta(days=delay or 0)).strftime('%Y-%m-%d'),
+ 'date': (datetime.strptime(move.date, '%Y-%m-%d %H:%M:%S') + relativedelta(days=delay or 0)).strftime('%Y-%m-%d'),
'move_history_ids2': []}
)
move_obj.write(cr, uid, [move.id], {
@@ -1788,6 +1806,7 @@ class stock_move(osv.osv):
def setlast_tracking(self, cr, uid, ids, context=None):
tracking_obj = self.pool.get('stock.tracking')
+ tracking = context.get('tracking', False)
picking = self.browse(cr, uid, ids)[0].picking_id
if picking:
last_track = [line.tracking_id.id for line in picking.move_lines if line.tracking_id]
@@ -1831,54 +1850,121 @@ class stock_move(osv.osv):
wf_service.trg_trigger(uid, 'stock.move', id, cr)
return True
- def _get_accounting_values(self, cr, uid, move, context=None):
+ def _get_accounting_data_for_valuation(self, cr, uid, move, context=None):
+ """
+ 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.
+ """
product_obj=self.pool.get('product.product')
- product_uom_obj = self.pool.get('product.uom')
- price_type_obj = self.pool.get('product.price.type')
- accounts = product_obj.get_product_accounts(cr,uid,move.product_id.id,context)
+ accounts = product_obj.get_product_accounts(cr, uid, move.product_id.id, context)
acc_src = accounts['stock_account_input']
acc_dest = accounts['stock_account_output']
acc_variation = accounts.get('property_stock_variation', False)
journal_id = accounts['stock_journal']
- if context is None:
- context = {}
-
if not acc_src:
- raise osv.except_osv(_('Error!'), _('There is no stock input account defined ' \
- 'for this product: "%s" (id: %d)') % \
+ raise osv.except_osv(_('Error!'), _('There is no stock input account defined for this product or its category: "%s" (id: %d)') % \
(move.product_id.name, move.product_id.id,))
if not acc_dest:
- raise osv.except_osv(_('Error!'), _('There is no stock output account defined ' \
- 'for this product: "%s" (id: %d)') % \
+ raise osv.except_osv(_('Error!'), _('There is no stock output account defined for this product or its category: "%s" (id: %d)') % \
(move.product_id.name, move.product_id.id,))
if not journal_id:
- raise osv.except_osv(_('Error!'), _('There is no journal defined '\
- 'on the product category: "%s" (id: %d)') % \
+ raise osv.except_osv(_('Error!'), _('There is no journal defined on the product category: "%s" (id: %d)') % \
(move.product_id.categ_id.name, move.product_id.categ_id.id,))
if not acc_variation:
- raise osv.except_osv(_('Error!'), _('There is no variation account defined '\
- 'on the product category: "%s" (id: %d)') % \
+ raise osv.except_osv(_('Error!'), _('There is no inventory variation account defined on the product category: "%s" (id: %d)') % \
(move.product_id.categ_id.name, move.product_id.categ_id.id,))
- if acc_src != acc_dest:
- default_uom = move.product_id.uom_id.id
- q = product_uom_obj._compute_qty(cr, uid, move.product_uom.id, move.product_qty, default_uom)
- if move.product_id.cost_method == 'average' and move.price_unit:
- amount = q * move.price_unit
- # Base computation on valuation price type
- else:
- context['currency_id'] = move.company_id.currency_id.id
- pricetype = price_type_obj.browse(cr,uid,move.company_id.property_valuation_price_type.id)
- amount_unit = move.product_id.price_get(pricetype.field, context)[move.product_id.id]
- amount = amount_unit * q or 1.0
- return journal_id, acc_src, acc_dest, acc_variation, amount
+
+ return journal_id, acc_src, acc_dest, acc_variation
+
+ def _get_reference_accounting_values_for_valuation(self, cr, uid, move, context=None):
+ """
+ Return the reference amount and reference currency representing the inventory valuation for this move.
+ These reference values should possibly be converted before being posted in Journals to adapt to the primary
+ and secondary currencies of the relevant accounts.
+ """
+ product_obj=self.pool.get('product.product')
+ product_uom_obj = self.pool.get('product.uom')
+ price_type_obj = self.pool.get('product.price.type')
+
+ # by default the reference currency is that of the move's company
+ reference_currency_id = move.company_id.currency_id.id
+
+ 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,
+ # 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
+ # valuation field are expressed in the default currency of the move's company.
+ else:
+ if context is None:
+ context = {}
+ currency_ctx = dict(context, currency_id = move.company_id.currency_id.id)
+ amount_unit = move.product_id.price_get('standard_price', currency_ctx)[move.product_id.id]
+ reference_amount = amount_unit * qty or 1.0
+
+ return reference_amount, reference_currency_id
+
+
+ def _create_product_valuation_moves(self, cr, uid, move, context=None):
+ """
+ Generate the appropriate accounting moves if the product being moves is subject
+ to real_time valuation tracking, and the source or destination location is
+ a transit location or is outside of the company.
+ """
+ if move.product_id.valuation == 'real_time': # FIXME: product valuation should perhaps be a property?
+ if context is None:
+ context = {}
+ src_company_ctx = dict(context,force_company=move.location_id.company_id.id)
+ dest_company_ctx = dict(context,force_company=move.location_dest_id.company_id.id)
+ account_moves = []
+ # Outgoing moves (or cross-company output part)
+ if move.location_id.company_id \
+ and (move.location_id.usage == 'internal' and move.location_dest_id.usage != 'internal'\
+ or move.location_id.company_id != move.location_dest_id.company_id):
+ journal_id, acc_src, acc_dest, acc_variation = self._get_accounting_data_for_valuation(cr, uid, move, src_company_ctx)
+ reference_amount, reference_currency_id = self._get_reference_accounting_values_for_valuation(cr, uid, move, src_company_ctx)
+ account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_variation, acc_dest, reference_amount, reference_currency_id, context))]
+
+ # Incoming moves (or cross-company input part)
+ if move.location_dest_id.company_id \
+ and (move.location_id.usage != 'internal' and move.location_dest_id.usage == 'internal'\
+ or move.location_id.company_id != move.location_dest_id.company_id):
+ journal_id, acc_src, acc_dest, acc_variation = self._get_accounting_data_for_valuation(cr, uid, move, dest_company_ctx)
+ reference_amount, reference_currency_id = self._get_reference_accounting_values_for_valuation(cr, uid, move, src_company_ctx)
+ account_moves += [(journal_id, self._create_account_move_line(cr, uid, move, acc_src, acc_variation, reference_amount, reference_currency_id, context))]
+
+ move_obj = self.pool.get('account.move')
+ for j_id, move_lines in account_moves:
+ move_obj.create(cr, uid,
+ {'name': move.name,
+ 'journal_id': j_id,
+ 'line_id': move_lines,
+ 'ref': move.picking_id and move.picking_id.name})
+
def action_done(self, cr, uid, ids, context=None):
""" Makes the move done and if all moves are done, it will finish the picking.
@return:
"""
+ track_flag = False
+ partial_datas=''
picking_ids = []
- move_obj = self.pool.get('account.move')
+ product_uom_obj = self.pool.get('product.uom')
+ price_type_obj = self.pool.get('product.price.type')
+ product_obj = self.pool.get('product.product')
+ partial_obj=self.pool.get('stock.partial.picking')
+ partial_id=partial_obj.search(cr,uid,[])
+ if partial_id:
+ partial_datas=partial_obj.read(cr,uid,partial_id)[0]
if context is None:
context = {}
@@ -1904,44 +1990,11 @@ class stock_move(osv.osv):
if move.move_dest_id.auto_validate:
self.action_done(cr, uid, [move.move_dest_id.id], context=context)
- #
- # Accounting Entries
- #
- acc_src = None
- acc_dest = None
- if move.product_id.valuation == 'real_time':
- lines = []
- if ((move.location_id.usage == 'internal' and move.location_dest_id.usage == 'customer') or (move.location_id.usage == 'internal' and move.location_dest_id.usage == 'transit')):
- if move.location_id.company_id:
- context.update({'force_company': move.location_id.company_id.id})
- journal_id, acc_src, acc_dest, acc_variation, amount = self._get_accounting_values(cr, uid, move, context)
- lines = [(journal_id, self.create_account_move(cr, uid, move, acc_dest, acc_variation, amount, context))]
-
- elif ((move.location_id.usage == 'supplier' and move.location_dest_id.usage == 'internal') or (move.location_id.usage == 'transit' and move.location_dest_id.usage == 'internal')):
- if move.location_dest_id.company_id:
- context.update({'force_company': move.location_dest_id.company_id.id})
- journal_id, acc_src, acc_dest, acc_variation, amount = self._get_accounting_values(cr, uid, move, context)
- lines = [(journal_id, self.create_account_move(cr, uid, move, acc_variation, acc_src, amount, context))]
- elif (move.location_id.usage == 'internal' and move.location_dest_id.usage == 'internal' and move.location_id.company_id != move.location_dest_id.company_id):
- if move.location_id.company_id:
- context.update({'force_company': move.location_id.company_id.id})
- journal_id, acc_src, acc_dest, acc_variation, amount = self._get_accounting_values(cr, uid, move, context)
- line1 = [(journal_id, self.create_account_move(cr, uid, move, acc_dest, acc_variation, amount, context))]
- if move.location_dest_id.company_id:
- context.update({'force_company': move.location_dest_id.company_id.id})
- journal_id, acc_src, acc_dest, acc_variation, amount = self._get_accounting_values(cr, uid, move, context)
- line2 = [(journal_id, self.create_account_move(cr, uid, move, acc_variation, acc_src, amount, context))]
- lines = line1 + line2
- for j_id, line in lines:
- move_obj.create(cr, uid, {
- 'name': move.name,
- 'journal_id': j_id,
- 'type':'cont_voucher',
- 'line_id': line,
- 'ref': move.picking_id and move.picking_id.name,
- })
-
- self.write(cr, uid, ids, {'state': 'done', 'date_planned': time.strftime('%Y-%m-%d %H:%M:%S')})
+ self._create_product_valuation_moves(cr, uid, move, context=context)
+ prodlot_id =partial_datas and partial_datas.get('move%s_prodlot_id'%(move.id), False)
+ if prodlot_id:
+ self.write(cr, uid, [move.id], {'prodlot_id': prodlot_id})
+ self.write(cr, uid, ids, {'state': 'done', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})
wf_service = netsvc.LocalService("workflow")
for id in ids:
wf_service.trg_trigger(uid, 'stock.move', id, cr)
@@ -1954,31 +2007,55 @@ class stock_move(osv.osv):
picking_obj.log_picking(cr, uid, picking_ids, context=context)
return True
- def create_account_move(self, cr, uid, move,account_id, account_variation, amount, context=None):
- if context is None:
- context = {}
- 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) or False
- lines=[(0, 0, {
- 'name': move.name,
- 'quantity': move.product_qty,
- 'product_id': move.product_id and move.product_id.id or False,
- 'credit': amount,
- 'account_id': account_id,
- 'ref': move.picking_id and move.picking_id.name or False,
- 'date': time.strftime('%Y-%m-%d') ,
- 'partner_id': partner_id,
- }),
- (0, 0, {
- 'name': move.name,
- 'product_id': move.product_id and move.product_id.id or False,
- 'quantity': move.product_qty,
- 'debit': amount,
- 'account_id': account_variation,
- 'ref': move.picking_id and move.picking_id.name or False,
- 'date': time.strftime('%Y-%m-%d') ,
- 'partner_id': partner_id,
- })]
- return lines
+ 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
+ processing of the given stock move.
+ """
+ # 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,
+ 'product_id': move.product_id and move.product_id.id or False,
+ 'quantity': move.product_qty,
+ 'ref': move.picking_id and move.picking_id.name or False,
+ 'date': time.strftime('%Y-%m-%d'),
+ 'partner_id': partner_id,
+ 'debit': reference_amount,
+ 'account_id': dest_account_id,
+ }
+ credit_line_vals = {
+ 'name': move.name,
+ 'product_id': move.product_id and move.product_id.id or False,
+ 'quantity': move.product_qty,
+ 'ref': move.picking_id and move.picking_id.name or False,
+ 'date': time.strftime('%Y-%m-%d'),
+ 'partner_id': partner_id,
+ 'credit': reference_amount,
+ 'account_id': src_account_id,
+ }
+
+ # 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.
+ # 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')
+ src_acct, dest_acct = account_obj.browse(cr, uid, [src_account_id, dest_account_id], context=context)
+ src_main_currency_id = src_acct.company_id.currency_id.id
+ dest_main_currency_id = dest_acct.company_id.currency_id.id
+ cur_obj = self.pool.get('res.currency')
+ if reference_currency_id != src_main_currency_id:
+ # fix credit line:
+ credit_line_vals['credit'] = cur_obj.compute(cr, uid, reference_currency_id, src_main_currency_id, reference_amount, context=context)
+ if (not src_acct.currency_id) or src_acct.currency_id.id == reference_currency_id:
+ credit_line_vals.update(currency_id=reference_currency_id, amount_currency=reference_amount)
+ if reference_currency_id != dest_main_currency_id:
+ # fix debit line:
+ debit_line_vals['debit'] = cur_obj.compute(cr, uid, reference_currency_id, dest_main_currency_id, reference_amount, context=context)
+ if (not dest_acct.currency_id) or dest_acct.currency_id.id == reference_currency_id:
+ debit_line_vals.update(currency_id=reference_currency_id, amount_currency=reference_amount)
+
+ return [(0, 0, debit_line_vals), (0, 0, credit_line_vals)]
def unlink(self, cr, uid, ids, context=None):
if context is None:
@@ -2167,26 +2244,34 @@ class stock_move(osv.osv):
return res
+ # FIXME: needs refactoring, this code is partially duplicated in stock_picking.do_partial()!
def do_partial(self, cr, uid, ids, partial_datas, context=None):
""" Makes partial pickings and moves done.
@param partial_datas: Dictionary containing details of partial picking
like partner_id, address_id, delivery_date, delivery
moves with product_id, product_qty, uom
"""
+ import pdb
+ #pdb.set_trace()
res = {}
picking_obj = self.pool.get('stock.picking')
product_obj = self.pool.get('product.product')
currency_obj = self.pool.get('res.currency')
- users_obj = self.pool.get('res.users')
uom_obj = self.pool.get('product.uom')
price_type_obj = self.pool.get('product.price.type')
+ sequence_obj = self.pool.get('ir.sequence')
wf_service = netsvc.LocalService("workflow")
+ partner_id = partial_datas.get('partner_id', False)
+ address_id = partial_datas.get('address_id', False)
+ delivery_date = partial_datas.get('delivery_date', False)
+ new_moves = []
if context is None:
context = {}
complete, too_many, too_few = [], [], []
move_product_qty = {}
+ prodlot_ids = {}
for move in self.browse(cr, uid, ids, context=context):
if move.state in ('done', 'cancel'):
continue
@@ -2197,6 +2282,7 @@ class stock_move(osv.osv):
product_uom = partial_data.get('product_uom',False)
product_price = partial_data.get('product_price',0.0)
product_currency = partial_data.get('product_currency',False)
+ prodlot_ids[move.id] = partial_data.get('prodlot_id')
if move.product_qty == product_qty:
complete.append(move)
elif move.product_qty > product_qty:
@@ -2207,42 +2293,46 @@ class stock_move(osv.osv):
# Average price computation
if (move.picking_id.type == 'in') and (move.product_id.cost_method == 'average'):
product = product_obj.browse(cr, uid, move.product_id.id)
- user = users_obj.browse(cr, uid, uid)
- context['currency_id'] = move.company_id.currency_id.id
+ move_currency_id = move.company_id.currency_id.id
+ context['currency_id'] = move_currency_id
qty = uom_obj._compute_qty(cr, uid, product_uom, product_qty, product.uom_id.id)
- pricetype = False
- if user.company_id.property_valuation_price_type:
- pricetype = price_type_obj.browse(cr, uid, user.company_id.property_valuation_price_type.id)
- if pricetype and qty > 0:
+ if qty > 0:
new_price = currency_obj.compute(cr, uid, product_currency,
- user.company_id.currency_id.id, product_price)
+ move_currency_id, product_price)
new_price = uom_obj._compute_price(cr, uid, product_uom, new_price,
product.uom_id.id)
if product.qty_available <= 0:
new_std_price = new_price
else:
# Get the standard price
- amount_unit = product.price_get(pricetype.field, context)[product.id]
+ amount_unit = product.price_get('standard_price', context)[product.id]
new_std_price = ((amount_unit * product.qty_available)\
+ (new_price * qty))/(product.qty_available + qty)
- # Write the field according to price type field
- product_obj.write(cr, uid, [product.id],
- {pricetype.field: new_std_price})
- self.write(cr, uid, [move.id], {'price_unit': new_price})
+ product_obj.write(cr, uid, [product.id],{'standard_price': new_std_price})
+
+ # 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],
+ {'price_unit': product_price,
+ 'price_currency_id': product_currency,
+ })
for move in too_few:
product_qty = move_product_qty[move.id]
if product_qty != 0:
- new_move = self.copy(cr, uid, move.id,
- {
- 'product_qty' : product_qty,
- 'product_uos_qty': product_qty,
- 'picking_id' : move.picking_id.id,
- 'state': 'assigned',
- 'move_dest_id': False,
- 'price_unit': move.price_unit,
- })
+ defaults = {
+ 'product_qty' : product_qty,
+ 'product_uos_qty': product_qty,
+ 'picking_id' : move.picking_id.id,
+ 'state': 'assigned',
+ 'move_dest_id': False,
+ 'price_unit': move.price_unit,
+ }
+ prodlot_id = prodlot_ids[move.id]
+ if prodlot_id:
+ defaults.update(prodlot_id=prodlot_id)
+ new_move = self.copy(cr, uid, move.id, defaults)
complete.append(self.browse(cr, uid, new_move))
self.write(cr, uid, move.id,
{
@@ -2260,6 +2350,8 @@ class stock_move(osv.osv):
complete.append(move)
for move in complete:
+ if prodlot_ids.get(move.id):
+ self.write(cr, uid, [move.id],{'prodlot_id': prodlot_ids.get(move.id)})
self.action_done(cr, uid, [move.id], context=context)
if move.picking_id.id :
# TOCHECK : Done picking if all moves are done
@@ -2273,10 +2365,7 @@ class stock_move(osv.osv):
picking_obj.action_move(cr, uid, [move.picking_id.id])
wf_service.trg_validate(uid, 'stock.picking', move.picking_id.id, 'button_done', cr)
- done_move_ids = []
- for move in complete:
- done_move_ids.append(move.id)
- return done_move_ids
+ return [move.id for move in complete]
stock_move()
@@ -2312,13 +2401,19 @@ class stock_inventory(osv.osv):
"""
if context is None:
context = {}
+
+ # to perform the correct inventory corrections we need analyze stock location by
+ # location, never recursively, so we use a special context
+ product_context = dict(context, compute_child=False)
+
+ location_obj = self.pool.get('stock.location')
for inv in self.browse(cr, uid, ids):
move_ids = []
+ move_line = []
for line in inv.inventory_line_id:
pid = line.product_id.id
-
- amount = self.pool.get('stock.location')._product_get(cr, uid, line.location_id.id, [pid], {'uom': line.product_uom.id})[pid]
- #TOCHECK: Why put restriction like new inventory qty should greater available qty ?
+ product_context.update(uom=line.product_uom.id)
+ amount = location_obj._product_get(cr, uid, line.location_id.id, [pid], product_context)[pid]
change = line.product_qty - amount
lot_id = line.prod_lot_id.id
if change:
@@ -2329,7 +2424,7 @@ class stock_inventory(osv.osv):
'product_uom': line.product_uom.id,
'prodlot_id': lot_id,
'date': inv.date,
- 'date_planned': inv.date,
+ 'date': inv.date,
'state': 'done'
}
if change > 0:
@@ -2383,7 +2478,7 @@ class stock_inventory_line(osv.osv):
'location_id': fields.many2one('stock.location', 'Location', required=True),
'product_id': fields.many2one('product.product', 'Product', required=True, select=True),
'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
- 'product_qty': fields.float('Quantity'),
+ 'product_qty': fields.float('Quantity', digits_compute=dp.get_precision('Product UoM')),
'company_id': fields.related('inventory_id','company_id',type='many2one',relation='res.company',string='Company',store=True, select=True),
'prod_lot_id': fields.many2one('stock.production.lot', 'Production Lot', domain="[('product_id','=',product_id)]"),
'state': fields.related('inventory_id','state',type='char',string='State',readonly=True),
@@ -2463,6 +2558,7 @@ class stock_picking_move_wizard(osv.osv_memory):
def action_move(self, cr, uid, ids, context=None):
move_obj = self.pool.get('stock.move')
picking_obj = self.pool.get('stock.picking')
+ account_move_obj = self.pool.get('account.move')
for act in self.read(cr, uid, ids):
move_lines = move_obj.browse(cr, uid, act['move_ids'])
for line in move_lines:
@@ -2479,75 +2575,5 @@ class stock_picking_move_wizard(osv.osv_memory):
stock_picking_move_wizard()
-class report_products_to_received_planned(osv.osv):
- _name = "report.products.to.received.planned"
- _description = "Received Products vs Planned"
- _auto = False
- _columns = {
- 'date':fields.date('Date'),
- 'qty': fields.integer('Actual Qty'),
- 'planned_qty': fields.integer('Planned Qty'),
-
- }
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'report_products_to_received_planned')
- cr.execute("""
- create or replace view report_products_to_received_planned as (
- select stock.date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty
- from stock_picking picking
- inner join stock_move stock
- on picking.id = stock.picking_id and picking.type = 'in'
- where stock.date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
- group by stock.date
-
- union
-
- select stock.date_planned, min(stock.id) as id, 0 as actual_qty, sum(stock.product_qty) as planned_qty
- from stock_picking picking
- inner join stock_move stock
- on picking.id = stock.picking_id and picking.type = 'in'
- where stock.date_planned between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
- group by stock.date_planned
- )
- """)
-
-report_products_to_received_planned()
-
-class report_delivery_products_planned(osv.osv):
- _name = "report.delivery.products.planned"
- _description = "Delivered products vs Planned"
- _auto = False
- _columns = {
- 'date':fields.date('Date'),
- 'qty': fields.integer('Actual Qty'),
- 'planned_qty': fields.integer('Planned Qty'),
-
- }
-
- def init(self, cr):
- tools.drop_view_if_exists(cr, 'report_delivery_products_planned')
- cr.execute("""
- create or replace view report_delivery_products_planned as (
- select stock.date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty
- from stock_picking picking
- inner join stock_move stock
- on picking.id = stock.picking_id and picking.type = 'out'
- where stock.date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
- group by stock.date
-
- union
-
- select stock.date_planned, min(stock.id), 0 as actual_qty, sum(stock.product_qty) as planned_qty
- from stock_picking picking
- inner join stock_move stock
- on picking.id = stock.picking_id and picking.type = 'out'
- where stock.date_planned between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7)
- group by stock.date_planned
-
-
- )
- """)
-
-report_delivery_products_planned()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/stock_data.xml b/addons/stock/stock_data.xml
index 6933db289a0..be1881634eb 100644
--- a/addons/stock/stock_data.xml
+++ b/addons/stock/stock_data.xml
@@ -74,11 +74,17 @@
view
+
+
+ Delivery Orders
+
Output
internal
customer
+ out
+
Stock
@@ -114,7 +120,13 @@
-
+
+
+
+ Shipping Delay
+
+
+
diff --git a/addons/stock/stock_demo.xml b/addons/stock/stock_demo.xml
index 91acb5c6406..33d130c2d77 100644
--- a/addons/stock/stock_demo.xml
+++ b/addons/stock/stock_demo.xml
@@ -3,8 +3,8 @@
+ Resource: stock.location
+ -->
IT Suppliers
@@ -30,30 +30,18 @@
customer
-
- Stock Level 1
-
-
Shelf 2
-
-
-
- Sub Products
-
-
-
- Workshop
Shelf 1
-
+
+ Resource: stock.inventory
+ -->
Starting Inventory
@@ -62,8 +50,8 @@
+ Resource: stock.inventory.line
+ -->
@@ -189,7 +177,7 @@
-
+
@@ -206,7 +194,7 @@
-
+
@@ -223,7 +211,7 @@
-
+
@@ -234,14 +222,14 @@
-
+
-
+
@@ -263,17 +251,18 @@
-
+
property_stock_variation
-
-
+
+
-
+
PACKO1
out
direct
2binvoiced
+
diff --git a/addons/stock/stock_report.xml b/addons/stock/stock_report.xml
index 1332e840e10..e634d27153e 100644
--- a/addons/stock/stock_report.xml
+++ b/addons/stock/stock_report.xml
@@ -5,7 +5,6 @@
-
diff --git a/addons/stock/stock_sequence.xml b/addons/stock/stock_sequence.xml
index 06d898c6637..cabf24dda5b 100644
--- a/addons/stock/stock_sequence.xml
+++ b/addons/stock/stock_sequence.xml
@@ -20,14 +20,9 @@
stock.picking.internal
-
- Picking Delivery
- stock.picking.delivery
-
-
-
+
Picking IN
@@ -50,13 +45,6 @@
5
-
- Picking DLV
- stock.picking.delivery
- DLV/
- 5
-
-
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index e0a1d61cd47..92d99c4bcc9 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -2,13 +2,13 @@
-
-
+
+
-
-
+
+
@@ -41,7 +41,7 @@
+ type="action" icon="terp-stock_effects-object-colorize"/>
@@ -85,45 +85,57 @@
stock.inventory
form
-
+
-
+
-
-
+ type="action" icon="terp-stock_effects-object-colorize" states="draft"/>
+
+
-
+
+
-
+ type="action" icon="terp-stock_effects-object-colorize"/>
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -132,7 +144,7 @@
- Periodical Inventory
+ Physical Inventories
ir.actions.act_window
stock.inventory
form
@@ -143,7 +155,7 @@
- Draft Periodical Inventories
+ Draft Physical Inventories
ir.actions.act_window
stock.inventory
form
@@ -172,7 +184,7 @@
context="{'type': 'move_history_ids','field': ''}" colspan="2"/>
-
+
@@ -200,7 +212,7 @@
@@ -287,8 +299,23 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -342,13 +369,13 @@
{'full':'1',"search_default_available":1}
-
+
#
# Lot composition (history)
#
- Inventory Moves
+ Stock Moves
stock.move
tree
move_history_ids
@@ -363,8 +390,8 @@
-
-
+
+
@@ -373,7 +400,7 @@
- Inventory Moves
+ Stock Moves
stock.move
tree
move_history_ids2
@@ -388,8 +415,8 @@
-
-
+
+
@@ -481,7 +508,7 @@
{'full':1, 'search_default_in_location':1}
-
+
stock.location.tree
@@ -502,7 +529,7 @@
tree
-
+
stock.warehouse
@@ -541,7 +568,7 @@
form
-
+
stock.picking.move.wizard.form
@@ -554,7 +581,7 @@
-
+
@@ -562,14 +589,14 @@
-
-
+ id="act_stock_picking_move_wizard"/>
+
stock.picking.calendar
stock.picking
@@ -597,7 +624,7 @@
-
+
@@ -624,8 +651,7 @@
-
-
+
@@ -633,10 +659,9 @@
-
-
-
+
@@ -678,14 +702,14 @@
-
-
+
+
-
-
+
+
@@ -717,13 +741,13 @@
-
+
-
+
@@ -761,228 +785,18 @@
+
+
+
+
-
- stock.picking.delivery.tree
- stock.picking
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- stock.picking.delivery.form
- stock.picking
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- stock.view_stock_delivery_filter.list.select
- stock.picking
- search
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Delivery Orders
- stock.picking
- ir.actions.act_window
- form
- tree,form,calendar
- [('type','=','delivery')]
- {'contact_display': 'partner',"search_default_available":1}
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
- calendar
-
-
-
-
-
+
+ stock.move.tree3
+ stock.move
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
stock.move.form2
@@ -1689,38 +1529,37 @@
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
@@ -1740,11 +1579,11 @@
-
-
-
+
+
+
-
+
@@ -1756,9 +1595,9 @@
search
-
+
-
+
@@ -1770,12 +1609,13 @@
+
-
+
@@ -1793,7 +1633,7 @@
tree,form
['|','&',('picking_id','=',False),('location_id.usage', 'in', ['customer','supplier']),'&',('picking_id','!=',False),('picking_id.type','=','in')]
-
+ {"search_default_receive":1}
@@ -1855,7 +1695,7 @@
@@ -1870,7 +1710,7 @@
context="{'location': active_id, 'search_default_future': 1,'search_default_product_id': [active_id]}"
domain="[('state','in',('waiting','confirmed','assigned'))]"
id="act_product_stock_move_futur_open"
- name="Future Inventory Moves"
+ name="Future Stock Moves"
res_model="stock.move"
src_model="product.product"
groups="base.group_extended"/>
@@ -1891,80 +1731,6 @@
-
-
-
-
- Products To Received
- report.products.to.received.planned
- tree
-
-
-
-
-
-
-
-
-
-
- Products To Received
- report.products.to.received.planned
- graph
-
-
-
-
-
-
-
-
-
-
- Number of Products to receive Vs planned
- report.products.to.received.planned
- ir.actions.act_window
- form
- graph,tree
-
-
-
-
-
- Delivered Products
- report.delivery.products.planned
- tree
-
-
-
-
-
-
-
-
-
-
- Delivered Products
- report.delivery.products.planned
- graph
-
-
-
-
-
-
-
-
-
-
- Delivered Products Vs Planned
- report.delivery.products.planned
- ir.actions.act_window
- form
- graph,tree
-
-
-
Customers Packings
stock.picking
@@ -2001,7 +1767,7 @@
tree,form
['|','&',('picking_id','=',False),('location_dest_id.usage', 'in', ['customer','supplier']),'&',('picking_id','!=',False),('picking_id.type','=','out')]
-
+ {"search_default_receive":1}
@@ -2064,7 +1830,7 @@
diff --git a/addons/stock/stock_workflow.xml b/addons/stock/stock_workflow.xml
index 3254f7b6984..7a1f786ebf8 100644
--- a/addons/stock/stock_workflow.xml
+++ b/addons/stock/stock_workflow.xml
@@ -86,21 +86,23 @@
- test_finnished()
+ test_finished()
- not test_finnished()
+ not test_finished()
+ allow_cancel()
button_cancel
+ allow_cancel()
button_cancel
diff --git a/addons/stock/test/stock_report.yml b/addons/stock/test/stock_report.yml
index 491fd7fa9d7..f6bcd60ad5e 100644
--- a/addons/stock/test/stock_report.yml
+++ b/addons/stock/test/stock_report.yml
@@ -1,22 +1,14 @@
-
In order to test the PDF reports defined on a stock, we will print a Stock Overviewall(childs) report
--
+-
!python {model: stock.location}: |
import netsvc, tools, os
- (data, format) = netsvc.LocalService('report.lot.stock.overview_all').create(cr, uid, [ref('stock.stock_location_13')], {}, {})
+ (data, format) = netsvc.LocalService('report.lot.stock.overview_all').create(cr, uid, [ref('stock.stock_location_stock')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'stock-overviewall'+format), 'wb+').write(data)
--
- In order to test the PDF reports defined on stock location, we will print a lot location report
--
- !python {model: stock.location}: |
- import netsvc, tools, os
- (data, format) = netsvc.LocalService('report.lot.location').create(cr, uid, [ref('stock.stock_location_components')], {}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'stock-stock_lot_location.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on stock inventory, we will print a Stock Inventory Move report
--
+-
!python {model: stock.inventory}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.stock.inventory.move').create(cr, uid, [ref('stock.stock_inventory_0')], {}, {})
@@ -24,7 +16,7 @@
file(os.path.join(tools.config['test_report_directory'], 'stock-stock_inventory_move.'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a stock, we will print a Stock Overview report
--
+-
!python {model: stock.location}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.lot.stock.overview').create(cr, uid, [ref('stock.stock_location_14')], {}, {})
@@ -32,17 +24,17 @@
file(os.path.join(tools.config['test_report_directory'], 'stock-overview'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a stock, we will print a Stock Picking List report
--
+-
!python {model: stock.picking}: |
import netsvc, tools, os
- (data, format) = netsvc.LocalService('report.stock.picking.list').create(cr, uid, [ref('stock.stock_picking_1')], {}, {})
+ (data, format) = netsvc.LocalService('report.stock.picking.list').create(cr, uid, [ref('stock.stock_picking_0')], {}, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'stock-picking_list'+format), 'wb+').write(data)
-
In order to test the PDF reports defined on a Stock, we will print Product Stock Report
--
+-
!python {model: product.product}: |
import netsvc, tools, os
(data, format) = netsvc.LocalService('report.stock.product.history').create(cr, uid, [ref('product.product_product_pc1')], {}, {})
if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data)
\ No newline at end of file
+ file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data)
diff --git a/addons/stock/test/stock_test.yml b/addons/stock/test/stock_test.yml
index 442cc8735b9..8b54e555a7b 100644
--- a/addons/stock/test/stock_test.yml
+++ b/addons/stock/test/stock_test.yml
@@ -53,7 +53,7 @@
I create Receivable Account .
-
!record {model: account.account, id: account_account_receivable0}:
- code: '40000'
+ code: '40000-stock-test'
company_id: base.main_company
currency_mode: current
name: Receivable
@@ -65,7 +65,7 @@
I create Payable Account.
-
!record {model: account.account, id: account_account_payable0}:
- code: '440000'
+ code: '440000-stock-test'
company_id: base.main_company
currency_mode: current
name: Payable
@@ -111,7 +111,7 @@
I create Product Sale Account.
-
!record {model: account.account, id: account_account_productsale0}:
- code: '001'
+ code: '001-stock-test'
company_id: base.main_company
currency_mode: current
name: Product Sale
@@ -123,7 +123,7 @@
I create Product Purchase Account.
-
!record {model: account.account, id: account_account_productpurchase0}:
- code: '0002'
+ code: '0002-stock-test'
company_id: base.main_company
currency_mode: current
name: Product Purchase
@@ -267,7 +267,7 @@
-
!record {model: stock.move.split, id: stock_move_split_0}:
line_ids:
- - name: '00001'
+ - name: '00001-stock-test'
quantity: 5
product_id: stock.product_product_hpcdwriters0
@@ -288,17 +288,17 @@
-
!record {model: stock.picking, id: stock_picking_0}:
name: test_picking
- address_id: res_partner_address_0
+ address_id: base.res_partner_address_4
company_id: base.main_company
date: '2010-05-11 15:18:52'
invoice_state: none
move_lines:
- company_id: base.main_company
- date_planned: '2010-05-11 15:18:57'
+ date: '2010-05-11 15:18:57'
location_dest_id: stock.stock_location_customers
location_id: stock.stock_location_stock
name: HP CD writers
- product_id: stock.product_product_hpcdwriters0
+ product_id: product.product_product_pc1
product_qty: 3.0
product_uom: product.product_uom_unit
date: '2010-05-11 15:18:57'
@@ -343,4 +343,4 @@
'product_qty': move.product_qty,
'product_uom': move.product_uom.id,
}
- self.do_partial(cr, uid, [ref('stock_picking_0')],partial_datas)
\ No newline at end of file
+ self.do_partial(cr, uid, [ref('stock_picking_0')],partial_datas)
diff --git a/addons/stock/wizard/__init__.py b/addons/stock/wizard/__init__.py
index 7a13dc26fd5..f6021e0fbe2 100644
--- a/addons/stock/wizard/__init__.py
+++ b/addons/stock/wizard/__init__.py
@@ -27,7 +27,6 @@ import stock_partial_move
import stock_replacement
import stock_ups
import stock_inventory_merge
-import stock_inventory_set_stock_zero
import stock_fill_inventory
import stock_inventory_line_split
import stock_invoice_onshipping
diff --git a/addons/stock/wizard/stock_change_standard_price.py b/addons/stock/wizard/stock_change_standard_price.py
index 47fb5387f26..ecbaef57a36 100644
--- a/addons/stock/wizard/stock_change_standard_price.py
+++ b/addons/stock/wizard/stock_change_standard_price.py
@@ -21,12 +21,13 @@
from osv import fields, osv
from tools.translate import _
+import decimal_precision as dp
class change_standard_price(osv.osv_memory):
_name = "stock.change.standard.price"
_description = "Change Standard Price"
_columns = {
- 'new_price': fields.float('Price', required=True,
+ 'new_price': fields.float('Price', required=True, digits_compute=dp.get_precision('Account'),
help="If cost price is increased, stock variation account will be debited "
"and stock output account will be credited with the value = (difference of amount * quantity available).\n"
"If cost price is decreased, stock variation account will be creadited and stock input account will be debited."),
diff --git a/addons/stock/wizard/stock_fill_inventory.py b/addons/stock/wizard/stock_fill_inventory.py
index e133a9fc879..599377fec1e 100644
--- a/addons/stock/wizard/stock_fill_inventory.py
+++ b/addons/stock/wizard/stock_fill_inventory.py
@@ -24,14 +24,32 @@ from tools.translate import _
class stock_fill_inventory(osv.osv_memory):
_name = "stock.fill.inventory"
- _description = "Fill Inventory"
+ _description = "Import Inventory"
_columns = {
'location_id': fields.many2one('stock.location', 'Location', required=True),
- 'recursive': fields.boolean("Include all children for the location"),
+ 'recursive': fields.boolean("Include children",help="If checked, products contained in child locations of selected location will be included as well."),
+ 'set_stock_zero': fields.boolean("Set to zero",help="If checked, all product quantities will be set to zero to help ensure a real physical inventory is done"),
}
+ def view_init(self, cr, uid, fields_list, context=None):
+ """
+ Creates view dynamically and adding fields at runtime.
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return: New arch of view with new columns.
+ """
+ if context==None:
+ context={}
+ res = super(stock_fill_inventory, self).view_init(cr, uid, fields_list, context=context)
+ 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')
+ True
- def fill_inventory(self, cr, uid, ids, context):
- """ To fill stock inventory according to products available in the selected locations.
+ def fill_inventory(self, cr, uid, ids, context=None):
+ """ To Import stock inventory according to products available in the selected locations.
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@@ -39,36 +57,43 @@ class stock_fill_inventory(osv.osv_memory):
@param context: A standard dictionary
@return:
"""
+ if context==None:
+ context={}
inventory_line_obj = self.pool.get('stock.inventory.line')
location_obj = self.pool.get('stock.location')
product_obj = self.pool.get('product.product')
stock_location_obj = self.pool.get('stock.location')
- for fill_inventory in self.browse(cr, uid, ids):
- res = {}
- res_location = {}
- if fill_inventory.recursive :
- location_ids = location_obj.search(cr, uid, [('location_id',
- 'child_of', fill_inventory.location_id.id)])
- for location in location_ids :
- res = location_obj._product_get(cr, uid, location)
- res_location[location] = res
- else:
- context.update({'compute_child': False})
- res = location_obj._product_get(cr, uid,
- fill_inventory.location_id.id, context=context)
- res_location[fill_inventory.location_id.id] = res
-
+ if ids and len(ids):
+ ids = ids[0]
+ else:
+ return {}
+ fill_inventory = self.browse(cr, uid, ids)
+ res = {}
+ res_location = {}
+ if fill_inventory.recursive :
+ location_ids = location_obj.search(cr, uid, [('location_id',
+ 'child_of', fill_inventory.location_id.id)])
+ for location in location_ids :
+ res = location_obj._product_get(cr, uid, location)
+ res_location[location] = res
+ else:
+ context.update({'compute_child': False})
+ res = location_obj._product_get(cr, uid,
+ fill_inventory.location_id.id, context=context)
+ res_location[fill_inventory.location_id.id] = res
+
product_ids = []
for location in res_location.keys():
res = res_location[location]
for product_id in res.keys():
prod = product_obj.browse(cr, uid, [product_id])[0]
uom = prod.uom_id.id
- context.update({'uom': uom})
+ context.update(uom=uom, compute_child=False)
amount = stock_location_obj._product_get(cr, uid,
location, [product_id], context=context)[product_id]
-
if(amount):
+ if fill_inventory.set_stock_zero:
+ amount = 0
line_ids=inventory_line_obj.search(cr, uid,
[('inventory_id', '=', context['active_ids']),
('location_id', '=', location),
diff --git a/addons/stock/wizard/stock_fill_inventory_view.xml b/addons/stock/wizard/stock_fill_inventory_view.xml
index ef95a3bf447..3db42eb7be5 100644
--- a/addons/stock/wizard/stock_fill_inventory_view.xml
+++ b/addons/stock/wizard/stock_fill_inventory_view.xml
@@ -2,28 +2,30 @@
- Fill Inventory
+ Import Inventory
stock.fill.inventory
form
-
-
+
+
+
-
+
-
diff --git a/addons/stock/wizard/stock_inventory_merge.py b/addons/stock/wizard/stock_inventory_merge.py
index 46c589f18e9..cbb9f380cb1 100644
--- a/addons/stock/wizard/stock_inventory_merge.py
+++ b/addons/stock/wizard/stock_inventory_merge.py
@@ -25,7 +25,25 @@ from tools.translate import _
class stock_inventory_merge(osv.osv_memory):
_name = "stock.inventory.merge"
_description = "Merge Inventory"
-
+
+ def fields_view_get(self, cr, uid, view_id=None, view_type='form',
+ context=None, toolbar=False, submenu=False):
+ """
+ Changes the view dynamically
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param context: A standard dictionary
+ @return: New arch of view.
+ """
+ if not context:
+ context={}
+ res = super(stock_inventory_merge, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
+ if context.get('active_model','') == 'stock.inventory' and len(context['active_ids']) < 2:
+ raise osv.except_osv(_('Warning'),
+ _('Please select multiple physical inventories to merge in the list view.'))
+ return res
+
def do_merge(self, cr, uid, ids, context):
""" To merge selected Inventories.
@param self: The object pointer.
@@ -37,13 +55,7 @@ class stock_inventory_merge(osv.osv_memory):
"""
invent_obj = self.pool.get('stock.inventory')
invent_line_obj = self.pool.get('stock.inventory.line')
-
invent_lines = {}
-
- if len(context['active_ids']) < 2:
- raise osv.except_osv(_('Warning'),
- _('Please select at least two inventories.'))
-
for inventory in invent_obj.browse(cr, uid, context['active_ids'], context=context):
if inventory.state == "done":
raise osv.except_osv(_('Warning'),
diff --git a/addons/stock/wizard/stock_inventory_merge_view.xml b/addons/stock/wizard/stock_inventory_merge_view.xml
index 5ae2987b59a..62cac877179 100644
--- a/addons/stock/wizard/stock_inventory_merge_view.xml
+++ b/addons/stock/wizard/stock_inventory_merge_view.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/addons/stock/wizard/stock_inventory_set_stock_zero.py b/addons/stock/wizard/stock_inventory_set_stock_zero.py
deleted file mode 100644
index 4cbba93bdb6..00000000000
--- a/addons/stock/wizard/stock_inventory_set_stock_zero.py
+++ /dev/null
@@ -1,74 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import fields, osv
-from tools.translate import _
-
-class inventory_set_stock_zero(osv.osv_memory):
- _name = "stock.inventory.set.stock.zero"
- _description = "Set Stock to 0"
-
- _columns = {
- 'location_id': fields.many2one('stock.location', 'Location', required=True),
- }
-
- def do_merge(self, cr, uid, ids, context):
- """ To set stock to Zero
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param ids: the ID or list of IDs if we want more than one
- @param context: A standard dictionary
- @return:
- """
- invent_obj = self.pool.get('stock.inventory')
- invent_line_obj = self.pool.get('stock.inventory.line')
- prod_obj = self.pool.get('product.product')
-
- if len(context['active_ids']) <> 1:
- raise osv.except_osv(_('Warning'),
- _('Please select one and only one inventory !'))
- for id in ids:
- datas = self.read(cr, uid, id)
- loc = str(datas['location_id'])
-
- cr.execute('select distinct location_id,product_id \
- from stock_inventory_line \
- where inventory_id=%s', (context['active_id'],))
- inv = cr.fetchall()
- cr.execute('select distinct product_id from stock_move where \
- location_dest_id=%s or location_id=%s', (loc, loc,))
- stock = cr.fetchall()
- for s in stock:
- if (loc, s[0]) not in inv:
- p = prod_obj.browse(cr, uid, s[0])
- invent_line_obj.create(cr, uid, {
- 'inventory_id': context['active_id'],
- 'location_id': loc,
- 'product_id': s[0],
- 'product_uom': p.uom_id.id,
- 'product_qty': 0.0,
- })
- return {}
-
-inventory_set_stock_zero()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/wizard/stock_inventory_set_stock_zero_view.xml b/addons/stock/wizard/stock_inventory_set_stock_zero_view.xml
deleted file mode 100644
index 0ee84d2045d..00000000000
--- a/addons/stock/wizard/stock_inventory_set_stock_zero_view.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
- Set Stock to Zero
- stock.inventory.set.stock.zero
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/stock/wizard/stock_invoice_onshipping.py b/addons/stock/wizard/stock_invoice_onshipping.py
index f931e575b2f..7e0693b9045 100644
--- a/addons/stock/wizard/stock_invoice_onshipping.py
+++ b/addons/stock/wizard/stock_invoice_onshipping.py
@@ -48,22 +48,22 @@ class stock_invoice_onshipping(osv.osv_memory):
if context is None:
context = {}
picking_obj = self.pool.get('stock.picking')
- usage = 'customer'
+ src_usage = dest_usage = None
pick = picking_obj.browse(cr, uid, context['active_id'], context=context)
if pick.invoice_state == 'invoiced':
raise osv.except_osv(_('UserError'), _('Invoice is already created.'))
if pick.invoice_state == 'none':
raise osv.except_osv(_('UserError'), _('This picking does not require any invoicing.'))
if pick.move_lines:
- usage = pick.move_lines[0].location_id.usage
-
- if pick.type == 'out' and usage == 'supplier':
+ 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':
type = 'in_refund'
- elif pick.type == 'out' and usage == 'customer':
+ elif pick.type == 'out' and dest_usage == 'customer':
type = 'out_invoice'
- elif pick.type == 'in' and usage == 'supplier':
+ elif pick.type == 'in' and src_usage == 'supplier':
type = 'in_invoice'
- elif pick.type == 'in' and usage == 'customer':
+ elif pick.type == 'in' and src_usage == 'customer':
type = 'out_refund'
else:
type = 'out_invoice'
diff --git a/addons/stock/wizard/stock_invoice_onshipping_view.xml b/addons/stock/wizard/stock_invoice_onshipping_view.xml
index e1e742d7aee..eddffb594aa 100644
--- a/addons/stock/wizard/stock_invoice_onshipping_view.xml
+++ b/addons/stock/wizard/stock_invoice_onshipping_view.xml
@@ -16,7 +16,7 @@
-
+
diff --git a/addons/stock/wizard/stock_location_product_view.xml b/addons/stock/wizard/stock_location_product_view.xml
index 518bc6eab35..2459daac189 100644
--- a/addons/stock/wizard/stock_location_product_view.xml
+++ b/addons/stock/wizard/stock_location_product_view.xml
@@ -16,7 +16,7 @@
-
+
diff --git a/addons/stock/wizard/stock_move_view.xml b/addons/stock/wizard/stock_move_view.xml
index 46d3893900b..06f6822e3c7 100644
--- a/addons/stock/wizard/stock_move_view.xml
+++ b/addons/stock/wizard/stock_move_view.xml
@@ -13,7 +13,7 @@
+ string="_Cancel" />
diff --git a/addons/stock/wizard/stock_partial_move.py b/addons/stock/wizard/stock_partial_move.py
index 1016d6c3977..5c7fd3c9472 100644
--- a/addons/stock/wizard/stock_partial_move.py
+++ b/addons/stock/wizard/stock_partial_move.py
@@ -38,7 +38,7 @@ class stock_partial_move(osv.osv_memory):
context={}
for m in move_obj.browse(cr, uid, context.get('active_ids', [])):
if m.state in ('done', 'cancel'):
- raise osv.except_osv(_('Invalid action !'), _('Cannot delivery products which are already delivered !'))
+ raise osv.except_osv(_('Invalid action !'), _('Cannot deliver products which are already delivered !'))
if 'move%s_product_id'%(m.id) not in self._columns:
@@ -47,7 +47,9 @@ class stock_partial_move(osv.osv_memory):
self._columns['move%s_product_qty'%(m.id)] = fields.float("Quantity")
if 'move%s_product_uom'%(m.id) not in self._columns:
self._columns['move%s_product_uom'%(m.id)] = fields.many2one('product.uom',string="Product UOM")
-
+ if 'move%s_prodlot_id'%(m.id) not in self._columns:
+ self._columns['move%s_prodlot_id'%(m.id)] = fields.many2one('stock.production.lot', string="Lot")
+
if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
if 'move%s_product_price'%(m.id) not in self._columns:
self._columns['move%s_product_price'%(m.id)] = fields.float("Price")
@@ -89,7 +91,12 @@ class stock_partial_move(osv.osv_memory):
'relation': 'product.uom',
'required' : True,
'readonly' : True,
- }
+ },
+ 'move%s_prodlot_id'%(m.id): {
+ 'string': _('Production Lot'),
+ 'type': 'many2one',
+ 'relation': 'stock.production.lot',
+ }
})
_moves_arch_lst += """
@@ -97,7 +104,8 @@ class stock_partial_move(osv.osv_memory):
- """%(m.id, m.id, m.id)
+
+ """%(m.id, m.id, m.id,m.id,m.id)
if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
_moves_fields.update({
'move%s_product_price'%(m.id) : {
@@ -162,29 +170,11 @@ class stock_partial_move(osv.osv_memory):
res['move%s_product_qty'%(m.id)] = m.product_qty
if 'move%s_product_uom'%(m.id) in fields:
res['move%s_product_uom'%(m.id)] = m.product_uom.id
- if (m.picking_id.type == 'out') and (m.product_id.cost_method == 'average') and 'sale_id' in m.picking_id._columns.keys():
- price = 0
- if hasattr(m, 'sale_line_id') and m.sale_line_id:
- price = m.sale_line_id.price_unit
-
+ if 'move%s_prodlot_id'%(m.id) in fields:
+ res['move%s_prodlot_id'%(m.id)] = m.prodlot_id.id
+ if m.product_id.cost_method == 'average' :
+ price = m.product_id.standard_price
currency = False
- if hasattr(m.picking_id, 'sale_id') and m.picking_id.sale_id:
- currency = m.picking_id.sale_id.pricelist_id.currency_id.id
-
- if 'move%s_product_price'%(m.id) in fields:
- res['move%s_product_price'%(m.id)] = price
- if 'move%s_product_currency'%(m.id) in fields:
- res['move%s_product_currency'%(m.id)] = currency
-
- if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average') and 'purchase_id' in m.picking_id._columns.keys():
- price = 0
- if hasattr(m, 'purchase_line_id') and m.purchase_line_id:
- price = m.purchase_line_id.price_unit
-
- currency = False
- if hasattr(m.picking_id, 'purchase_id') and m.picking_id.purchase_id:
- currency = m.picking_id.purchase_id.pricelist_id.currency_id.id
-
if 'move%s_product_price'%(m.id) in fields:
res['move%s_product_price'%(m.id)] = price
if 'move%s_product_currency'%(m.id) in fields:
@@ -213,7 +203,8 @@ class stock_partial_move(osv.osv_memory):
partial_datas['move%s'%(m.id)] = {
'product_id' : getattr(partial, 'move%s_product_id'%(m.id)).id,
'product_qty' : getattr(partial, 'move%s_product_qty'%(m.id)),
- 'product_uom' : getattr(partial, 'move%s_product_uom'%(m.id)).id
+ 'product_uom' : getattr(partial, 'move%s_product_uom'%(m.id)).id,
+ 'prodlot_id' : getattr(partial, 'move%s_prodlot_id'%(m.id)).id
}
if (m.picking_id.type == 'in') and (m.product_id.cost_method == 'average'):
diff --git a/addons/stock/wizard/stock_partial_picking.py b/addons/stock/wizard/stock_partial_picking.py
index 3b6ce21b6ee..2d9ec901a8d 100644
--- a/addons/stock/wizard/stock_partial_picking.py
+++ b/addons/stock/wizard/stock_partial_picking.py
@@ -63,7 +63,7 @@ class stock_partial_picking(osv.osv_memory):
_moves_arch_lst = """
-
+
"""
@@ -97,7 +97,6 @@ class stock_partial_picking(osv.osv_memory):
'string': _('Production Lot'),
'type': 'many2one',
'relation': 'stock.production.lot',
- 'readonly': True,
}
})
@@ -106,8 +105,8 @@ class stock_partial_picking(osv.osv_memory):
-
- """%(m.id, m.id, m.id, m.id)
+
+ """%(m.id, m.id, m.id, m.id,m.id)
if (m.product_id.cost_method == 'average'):
_moves_fields.update({
'move%s_product_price'%(m.id) : {
@@ -171,20 +170,9 @@ class stock_partial_picking(osv.osv_memory):
res['move%s_product_uom'%(m.id)] = m.product_uom.id
if 'move%s_prodlot_id'%(m.id) in fields:
res['move%s_prodlot_id'%(m.id)] = m.prodlot_id.id
-
if (m.product_id.cost_method == 'average'):
currency = False
- price = 0
- if (pick.type == 'in') and 'purchase_id' in pick._columns.keys():
- if hasattr(m, 'purchase_line_id') and m.purchase_line_id:
- price = m.purchase_line_id.price_unit
- if hasattr(pick, 'purchase_id') and pick.purchase_id:
- currency = pick.purchase_id.pricelist_id.currency_id.id
- if (pick.type == 'out') and 'sale_id' in pick._columns.keys():
- if hasattr(m, 'sale_line_id') and m.sale_line_id:
- price = m.sale_line_id.price_unit
- if hasattr(pick, 'sale_id') and pick.sale_id:
- currency = pick.sale_id.pricelist_id.currency_id.id
+ price = m.product_id.standard_price
if 'move%s_product_price'%(m.id) in fields:
res['move%s_product_price'%(m.id)] = price
if 'move%s_product_currency'%(m.id) in fields:
diff --git a/addons/stock/wizard/stock_picking_make_view.xml b/addons/stock/wizard/stock_picking_make_view.xml
index fa77042c5d8..4ecebed1031 100644
--- a/addons/stock/wizard/stock_picking_make_view.xml
+++ b/addons/stock/wizard/stock_picking_make_view.xml
@@ -12,7 +12,7 @@
width="600" height="300"/>
+ string="_Cancel" />
diff --git a/addons/stock/wizard/stock_replacement_view.xml b/addons/stock/wizard/stock_replacement_view.xml
index ce5f7efbc9f..cea5bfedbe8 100644
--- a/addons/stock/wizard/stock_replacement_view.xml
+++ b/addons/stock/wizard/stock_replacement_view.xml
@@ -9,7 +9,7 @@
-
+
diff --git a/addons/stock/wizard/stock_return_picking.py b/addons/stock/wizard/stock_return_picking.py
index 74aa96e8e63..4bddc9a7ee4 100644
--- a/addons/stock/wizard/stock_return_picking.py
+++ b/addons/stock/wizard/stock_return_picking.py
@@ -65,18 +65,27 @@ class stock_return_picking(osv.osv_memory):
@return: New arch of view with new columns.
"""
res = super(stock_return_picking, self).view_init(cr, uid, fields_list, context=context)
- record_id = context and context.get('active_id', False) or False
+ record_id = context and context.get('active_id', False)
if record_id:
pick_obj = self.pool.get('stock.picking')
- try:
- pick = pick_obj.browse(cr, uid, record_id)
- for m in [line for line in pick.move_lines]:
- if 'return%s'%(m.id) not in self._columns:
- self._columns['return%s'%(m.id)] = fields.float(string=m.name, required=True)
- if 'invoice_state' not in self._columns:
- self._columns['invoice_state'] = fields.selection([('2binvoiced', 'To be Invoiced'), ('none', 'None')], string='Invoice State', required=True)
- except Exception:
- return res
+ pick = pick_obj.browse(cr, uid, record_id)
+ if pick.state not in ['done','confirmed','assigned']:
+ raise osv.except_osv(_('Warning !'), _("You may only return pickings that are Confirmed, Available or Done!"))
+ return_history = {}
+ valid_lines = 0
+ for m in [line for line in pick.move_lines]:
+ if m.state == 'done':
+ return_history[m.id] = 0
+ for rec in m.move_history_ids2:
+ return_history[m.id] += (rec.product_qty * rec.product_uom.factor)
+ if m.product_qty * m.product_uom.factor > return_history[m.id]:
+ valid_lines += 1
+ if 'return%s'%(m.id) not in self._columns:
+ self._columns['return%s'%(m.id)] = fields.float(string=m.name, required=True)
+ if 'invoice_state' not in self._columns:
+ self._columns['invoice_state'] = fields.selection([('2binvoiced', 'To be Invoiced'), ('none', 'None')], string='Invoice State', required=True)
+ if not valid_lines:
+ raise osv.except_osv(_('Warning !'), _("There are no products to return (only lines in Done state and not fully returned yet can be returned)!"))
return res
def fields_view_get(self, cr, uid, view_id=None, view_type='form',
@@ -97,36 +106,29 @@ class stock_return_picking(osv.osv_memory):
if record_id:
pick_obj = self.pool.get('stock.picking')
pick = pick_obj.browse(cr, uid, record_id)
- if pick.state != 'done':
- raise osv.except_osv(_('Warning !'), _("The Picking is not completed yet!\nYou cannot return picking which is not in 'Done' state!"))
-
return_history = {}
- for m_line in pick.move_lines:
- return_history[m_line.id] = 0
- for rec in m_line.move_history_ids2:
- return_history[m_line.id] += rec.product_qty
res['fields'].clear()
arch_lst=['', '' % _('Return lines'), ' ' % _('Provide the quantities of the returned products.')]
- for m in [line for line in pick.move_lines]:
+ for m in pick.move_lines:
+ return_history[m.id] = 0
+ for rec in m.move_history_ids2:
+ return_history[m.id] += rec.product_qty
quantity = m.product_qty
- if quantity > return_history[m.id] and (quantity - return_history[m.id])>0:
+ if m.state=='done' and quantity > return_history[m.id]:
arch_lst.append(' \n ' % (m.id,))
res['fields']['return%s' % m.id]={'string':m.name, 'type':'float', 'required':True}
res.setdefault('returns', []).append(m.id)
- if not res.get('returns',False):
- raise osv.except_osv(_('Warning!'),_('There is no product to return!'))
-
arch_lst.append(' \n ')
res['fields']['invoice_state']={'string':_('Invoice state'), 'type':'selection','required':True, 'selection':[('2binvoiced', _('To Be Invoiced')), ('none', _('None'))]}
arch_lst.append('')
arch_lst.append(' ')
- arch_lst.append(' ')
+ arch_lst.append(' ')
arch_lst.append(' ')
arch_lst.append(' ')
res['arch'] = '\n'.join(arch_lst)
return res
- def _create_returns(self, cr, uid, ids, context):
+ def create_returns(self, cr, uid, ids, context):
"""
Creates return picking.
@param self: The object pointer.
@@ -149,6 +151,7 @@ class stock_return_picking(osv.osv_memory):
move_ids = [m.id for m in [line for line in pick.move_lines]]
set_invoice_state_to_none = True
+ returned_lines = 0
for move in move_obj.browse(cr, uid, move_ids):
if not new_picking:
if pick.type=='out':
@@ -161,57 +164,45 @@ class stock_return_picking(osv.osv_memory):
'move_lines':[], 'state':'draft', 'type':new_type,
'date':date_cur, 'invoice_state':data['invoice_state'],})
new_location=move.location_dest_id.id
+ if move.state=='done':
+ new_qty = data['return%s' % move.id]
+ returned_qty = move.product_qty
- new_qty = data['return%s' % move.id]
- returned_qty = move.product_qty
-
- for rec in move.move_history_ids2:
- returned_qty -= rec.product_qty
-
- if returned_qty != new_qty:
- set_invoice_state_to_none = False
-
- new_move=move_obj.copy(cr, uid, move.id, {
- 'product_qty': new_qty,
- 'product_uos_qty': uom_obj._compute_qty(cr, uid, move.product_uom.id,
- new_qty, move.product_uos.id),
- 'picking_id':new_picking, 'state':'draft',
- 'location_id':new_location, 'location_dest_id':move.location_id.id,
- 'date':date_cur, 'date_planned':date_cur,})
- move_obj.write(cr, uid, [move.id], {'move_history_ids2':[(4,new_move)]})
-
+ for rec in move.move_history_ids2:
+ returned_qty -= rec.product_qty
+
+ if returned_qty != new_qty:
+ set_invoice_state_to_none = False
+
+ if new_qty:
+ returned_lines += 1
+ new_move=move_obj.copy(cr, uid, move.id, {
+ 'product_qty': new_qty,
+ 'product_uos_qty': uom_obj._compute_qty(cr, uid, move.product_uom.id,
+ new_qty, move.product_uos.id),
+ 'picking_id':new_picking, 'state':'draft',
+ 'location_id':new_location, 'location_dest_id':move.location_id.id,
+ 'date':date_cur,})
+ move_obj.write(cr, uid, [move.id], {'move_history_ids2':[(4,new_move)]})
+
+ if not returned_lines:
+ raise osv.except_osv(_('Warning !'), _("Please specify at least one non-zero quantity!"))
+
if set_invoice_state_to_none:
pick_obj.write(cr, uid, [pick.id], {'invoice_state':'none'})
-
- if new_picking:
- if new_picking:
- wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
- pick_obj.force_assign(cr, uid, [new_picking], context)
- return new_picking
-
- def action_open_window(self, cr, uid, ids, context):
- """
- Opens return picking list.
- @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
- @return: A dictionary which of fields with values.
- """
- res = self._create_returns(cr, uid, ids, context)
- if not res:
- return {}
+ wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
+ pick_obj.force_assign(cr, uid, [new_picking], context)
return {
- 'domain': "[('id', 'in', ["+str(res)+"])]",
+ 'domain': "[('id', 'in', ["+str(new_picking)+"])]",
'name': 'Picking List',
'view_type':'form',
'view_mode':'tree,form',
'res_model':'stock.picking',
'view_id':False,
'type':'ir.actions.act_window',
+ 'context':context,
}
-
+
stock_return_picking()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/wizard/stock_splitinto.py b/addons/stock/wizard/stock_splitinto.py
index 20b1940e1c7..c514c9714eb 100644
--- a/addons/stock/wizard/stock_splitinto.py
+++ b/addons/stock/wizard/stock_splitinto.py
@@ -21,13 +21,13 @@
from osv import fields, osv
from tools.translate import _
-
+import decimal_precision as dp
class stock_split_into(osv.osv_memory):
_name = "stock.split.into"
_description = "Split into"
_columns = {
- 'quantity': fields.float('Quantity', digits=(16,2)),
+ 'quantity': fields.float('Quantity',digits_compute=dp.get_precision('Product UOM')),
}
_defaults = {
'quantity': lambda *x: 0,
@@ -41,14 +41,14 @@ class stock_split_into(osv.osv_memory):
quantity = self.browse(cr, uid, data[0], context).quantity or 0.0
for move in move_obj.browse(cr, uid, rec_id):
quantity_rest = move.product_qty - quantity
- if move.tracking_id :
- raise osv.except_osv(_('Error!'), _('The current move line is already assigned to a pack, please remove it first if you really want to change it ' \
- 'for this product: "%s" (id: %d)') % \
- (move.product_id.name, move.product_id.id,))
+ #if move.tracking_id :
+ # raise osv.except_osv(_('Error!'), _('The current move line is already assigned to a pack, please remove it first if you really want to change it ' \
+ # 'for this product: "%s" (id: %d)') % \
+ # (move.product_id.name, move.product_id.id,))
if quantity > move.product_qty:
raise osv.except_osv(_('Error!'), _('Total quantity after split exceeds the quantity to split ' \
'for this product: "%s" (id: %d)') % \
- (move.product_id.name, move.product_id.id,))
+ (move.product_id.name, move.product_id.id,))
if quantity > 0:
move_obj.setlast_tracking(cr, uid, [move.id], context=context)
move_obj.write(cr, uid, [move.id], {
@@ -63,12 +63,12 @@ class stock_split_into(osv.osv_memory):
move_obj.write(cr, uid, [move.id], {'tracking_id': tracking_id})
else:
default_val = {
- 'product_qty': quantity_rest,
- 'product_uos_qty': quantity_rest,
- 'tracking_id': tracking_id,
- 'state': move.state,
- 'product_uos': move.product_uom.id
- }
+ 'product_qty': quantity_rest,
+ 'product_uos_qty': quantity_rest,
+ 'tracking_id': tracking_id,
+ 'state': move.state,
+ 'product_uos': move.product_uom.id
+ }
move_obj.copy(cr, uid, move.id, default_val)
return {}
stock_split_into()
diff --git a/addons/stock/wizard/stock_splitinto_view.xml b/addons/stock/wizard/stock_splitinto_view.xml
index a325519ca75..7ed7266a163 100644
--- a/addons/stock/wizard/stock_splitinto_view.xml
+++ b/addons/stock/wizard/stock_splitinto_view.xml
@@ -10,7 +10,7 @@
+ string="_Cancel" />
diff --git a/addons/stock/wizard/stock_ups_view.xml b/addons/stock/wizard/stock_ups_view.xml
index 89b5fe131e8..cbce721e1b9 100644
--- a/addons/stock/wizard/stock_ups_view.xml
+++ b/addons/stock/wizard/stock_ups_view.xml
@@ -11,7 +11,7 @@
-
+
diff --git a/addons/stock_location/__openerp__.py b/addons/stock_location/__openerp__.py
index beb24997fb8..5c2ae8e63e5 100644
--- a/addons/stock_location/__openerp__.py
+++ b/addons/stock_location/__openerp__.py
@@ -21,31 +21,82 @@
{
- 'name': 'Stock Location Paths',
+ 'name': 'Warehouse Locations Paths',
'version': '1.0',
'category': 'Generic Modules/Inventory Control',
'description': """
-Manages product's path in locations.
+This module supplements the Warehouse application by adding support for per-product
+location paths, effectively implementing Push and Pull inventory flows.
-This module may be useful for different purposes:
-* Manages the product in his whole manufacturing chain
-* Manages different default locations by products
-* Define paths within the warehouse to route products based on operations:
+Typically this could be used to:
+* Manage product manufacturing chains
+* Manage default locations per product
+* Define routes within your warehouse according to business needs, such as:
- Quality Control
- After Sales Services
- - Supplier Return
-* Manage products to be rent.
+ - Supplier Returns
+* Help rental management, by generating automated return moves for rented products
+
+Once this module is installed, an additional tab appear on the product form, where you can add
+Push and Pull flow specifications. The demo data of CPU1 product for that push/pull :
+
+Push flows
+----------
+Push flows are useful when the arrival of certain products in a given location should always
+be followed by a corresponding move to another location, optionally after a certain delay.
+The original Warehouse application already supports such Push flow specifications on the
+Locations themselves, but these cannot be refined per-product.
+
+A push flow specification indicates which location is chained with which location, and with
+what parameters. As soon as a given quantity of products is moved in the source location,
+a chained move is automatically foreseen according to the parameters set on the flow specification
+(destination location, delay, type of move, journal, etc.) The new move can be automatically
+processed, or require a manual confirmation, depending on the parameters.
+
+Pull flows
+----------
+Pull flows are a bit different from Pull flows, in the sense that they are not related to
+the processing of product moves, but rather to the processing of procurement orders.
+What is being pulled is a need, not directly products.
+A classical example of Push flow is when you have an Outlet company, with a parent Company
+that is responsible for the supplies of the Outlet.
+
+ [ Customer ] <- A - [ Outlet ] <- B - [ Holding ] <~ C ~ [ Supplier ]
+
+When a new procurement order (A, coming from the confirmation of a Sale Order for example) arrives
+in the Outlet, it is converted into another procurement (B, via a Push flow of type 'move')
+requested from the Holding. When procurement order B is processed by the Holding company, and
+if the product is out of stock, it can be converted into a Purchase Order (C) from the Supplier
+(Push flow of type Purchase). The result is that the procurement order, the need, is pushed
+all the way between the Customer and Supplier.
+
+Technically, Pull flows allow to process procurement orders differently, not only depending on
+the product being considered, but also depending on which location holds the "need" for that
+product (i.e. the destination location of that procurement order).
+
+Use-Case
+--------
+
+You can use the demo data as follow:
+ CPU1: Sell some CPU1 from Shop 1 and run the scheduler
+ - Warehouse: delivery order, Shop 1: reception
+ CPU3:
+ - When receiving the product, it goes to Quality Control location then stored to shelf 2.
+ - When delivering the customer: Pick List -> Packing -> Delivery Order from Gate A
""",
'author': 'OpenERP SA',
- 'depends': ['procurement','stock'],
+ 'depends': ['procurement','stock','sale'],
'init_xml': [],
'update_xml': ['stock_location_view.xml', 'security/ir.model.access.csv', 'mrp_pull_workflow.xml'],
- 'demo_xml': [],
+ 'demo_xml': [
+ 'stock_location_demo_cpu1.xml',
+ 'stock_location_demo_cpu3.yml',
+ ],
'installable': True,
'test':[
- 'test/stock_location.yml'
- ],
+# 'test/stock_location_pull_flow.yml',
+# 'test/stock_location_push_flow.yml',
+ ],
'active': False,
'certificate': '0046505115101',
}
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock_location/mrp_pull.py b/addons/stock_location/mrp_pull.py
index b4a68ca1b74..f4c9868a58f 100644
--- a/addons/stock_location/mrp_pull.py
+++ b/addons/stock_location/mrp_pull.py
@@ -18,13 +18,8 @@
#
##############################################################################
-from osv import fields,osv
-import tools
-import ir
-import pooler
+from osv import osv
import netsvc
-from mx import DateTime
-import time
from tools.translate import _
class procurement_order(osv.osv):
@@ -32,7 +27,6 @@ class procurement_order(osv.osv):
def check_buy(self, cr, uid, ids, context=None):
for procurement in self.browse(cr, uid, ids):
for line in procurement.product_id.flow_pull_ids:
-
if line.location_id==procurement.location_id:
return line.type_proc=='buy'
return super(procurement_order, self).check_buy(cr, uid, ids)
@@ -56,7 +50,7 @@ class procurement_order(osv.osv):
def action_move_create(self, cr, uid, ids,context=None):
proc_obj = self.pool.get('procurement.order')
move_obj = self.pool.get('stock.move')
- location_obj = self.pool.get('stock.location')
+ picking_obj=self.pool.get('stock.picking')
wf_service = netsvc.LocalService("workflow")
for proc in proc_obj.browse(cr, uid, ids, context=context):
line = None
@@ -65,7 +59,7 @@ class procurement_order(osv.osv):
break
assert line, 'Line can not be False if we are on this state of the workflow'
origin = (proc.origin or proc.name or '').split(':')[0] +':'+line.name
- picking_id = self.pool.get('stock.picking').create(cr, uid, {
+ picking_id =picking_obj.create(cr, uid, {
'origin': origin,
'company_id': line.company_id and line.company_id.id or False,
'type': line.picking_type,
@@ -75,12 +69,12 @@ class procurement_order(osv.osv):
'note': line.name, # TODO: note on procurement ?
'invoice_state': line.invoice_state,
})
- move_id = self.pool.get('stock.move').create(cr, uid, {
+ move_id =move_obj.create(cr, uid, {
'name': line.name,
'picking_id': picking_id,
'company_id': line.company_id and line.company_id.id or False,
'product_id': proc.product_id.id,
- 'date_planned': proc.date_planned,
+ 'date': proc.date_planned,
'product_qty': proc.product_qty,
'product_uom': proc.product_uom.id,
'product_uos_qty': (proc.product_uos and proc.product_uos_qty)\
@@ -97,10 +91,10 @@ class procurement_order(osv.osv):
'note': line.name, # TODO: same as above
})
if proc.move_id and proc.move_id.state in ('confirmed'):
- self.pool.get('stock.move').write(cr,uid, [proc.move_id.id], {
+ move_obj.write(cr,uid, [proc.move_id.id], {
'state':'waiting'
}, context=context)
- proc_id = self.pool.get('procurement.order').create(cr, uid, {
+ proc_id = proc_obj.create(cr, uid, {
'name': line.name,
'origin': origin,
'company_id': line.company_id and line.company_id.id or False,
@@ -120,7 +114,7 @@ class procurement_order(osv.osv):
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
if proc.move_id:
- self.pool.get('stock.move').write(cr, uid, [proc.move_id.id],
+ move_obj.write(cr, uid, [proc.move_id.id],
{'location_id':proc.location_id.id})
self.write(cr, uid, [proc.id], {'state':'running','message':_('Moved from other location')})
diff --git a/addons/stock_location/stock_location.py b/addons/stock_location/stock_location.py
index 5404946e3ee..baa9692ba75 100644
--- a/addons/stock_location/stock_location.py
+++ b/addons/stock_location/stock_location.py
@@ -26,20 +26,21 @@ import pooler
class stock_location_path(osv.osv):
_name = "stock.location.path"
+ _description = "Pushed Flows"
_columns = {
'name': fields.char('Operation', size=64),
'company_id': fields.many2one('res.company', 'Company'),
'product_id' : fields.many2one('product.product', 'Products', ondelete='cascade', select=1),
'journal_id': fields.many2one('stock.journal','Journal'),
- 'location_from_id' : fields.many2one('stock.location', 'Source Location', ondelete='cascade', select=1),
- 'location_dest_id' : fields.many2one('stock.location', 'Destination Location', ondelete='cascade', select=1),
+ 'location_from_id' : fields.many2one('stock.location', 'Source Location', ondelete='cascade', select=1, required=True),
+ 'location_dest_id' : fields.many2one('stock.location', 'Destination Location', ondelete='cascade', select=1, required=True),
'delay': fields.integer('Delay (days)', help="Number of days to do this transition"),
'invoice_state': fields.selection([
("invoiced", "Invoiced"),
("2binvoiced", "To Be Invoiced"),
("none", "Not from Picking")], "Invoice Status",
required=True,),
- 'picking_type': fields.selection([('out','Sending Goods'),('in','Getting Goods'),('internal','Internal'),('delivery','Delivery')], 'Shipping Type', required=True, select=True, help="Depending on the company, choose whatever you want to receive or send products"),
+ 'picking_type': fields.selection([('out','Sending Goods'),('in','Getting Goods'),('internal','Internal')], 'Shipping Type', required=True, select=True, help="Depending on the company, choose whatever you want to receive or send products"),
'auto': fields.selection(
[('auto','Automatic Move'), ('manual','Manual Operation'),('transparent','Automatic No Step Added')],
'Automatic Move',
@@ -71,7 +72,7 @@ class product_pulled_flow(osv.osv):
'type_proc': fields.selection([('produce','Produce'),('buy','Buy'),('move','Move')], 'Type of Procurement', required=True),
'company_id': fields.many2one('res.company', 'Company', help="Is used to know to which company belong packings and moves"),
'partner_address_id': fields.many2one('res.partner.address', 'Partner Address'),
- 'picking_type': fields.selection([('out','Sending Goods'),('in','Getting Goods'),('internal','Internal'),('delivery','Delivery')], 'Shipping Type', required=True, select=True, help="Depending on the company, choose whatever you want to receive or send products"),
+ 'picking_type': fields.selection([('out','Sending Goods'),('in','Getting Goods'),('internal','Internal')], 'Shipping Type', required=True, select=True, help="Depending on the company, choose whatever you want to receive or send products"),
'product_id':fields.many2one('product.product','Product'),
'invoice_state': fields.selection([
("invoiced", "Invoiced"),
diff --git a/addons/stock_location/stock_location_demo_cpu1.xml b/addons/stock_location/stock_location_demo_cpu1.xml
new file mode 100644
index 00000000000..01f711839d4
--- /dev/null
+++ b/addons/stock_location/stock_location_demo_cpu1.xml
@@ -0,0 +1,92 @@
+
+
+
+
+ This product is configured with example of push/pull flows
+
+
+ Quality Control
+
+
+
+
+
+
+ internal
+ none
+ Quality Control
+ manual
+
+
+
+
+ transparent
+ none
+
+ Receptions to Quality Control
+
+
+ in
+
+
+
+
+ manual
+ none
+
+ Store in Shelf
+
+
+ internal
+
+
+
+
+
+
+
+ none
+
+ move
+
+ make_to_order
+ in
+ Receive from Warehouse
+
+
+
+
+
+
+ move
+ none
+
+
+ make_to_stock
+ out
+ Deliver Shop
+
+
+ 20.0
+ 10.0
+
+
+
+
+
+
+
+
+ Shop 1
+
+
+
+
+
+ Shop 2
+
+
+
+
+
+
diff --git a/addons/stock_location/stock_location_demo_cpu3.yml b/addons/stock_location/stock_location_demo_cpu3.yml
new file mode 100644
index 00000000000..74c9998b1b6
--- /dev/null
+++ b/addons/stock_location/stock_location_demo_cpu3.yml
@@ -0,0 +1,55 @@
+-
+ !record {model: stock.journal, id: journal_pick}:
+ name: Pick List
+-
+ !record {model: stock.journal, id: journal_pack}:
+ name: Packing
+-
+ !record {model: stock.journal, id: journal_gate_a}:
+ name: Delivery Gate A
+-
+ !record {model: stock.journal, id: journal_gate_b}:
+ name: Delivery Gate B
+-
+ !record {model: stock.location, id: location_order}:
+ name: Order Processing
+ usage: internal
+ location_id: stock.stock_location_company
+-
+ !record {model: stock.location, id: location_dispatch_zone}:
+ name: Dispatch Zone
+ usage: internal
+ location_id: location_order
+-
+ !record {model: stock.location, id: location_gate_a}:
+ name: Gate A
+ usage: internal
+ location_id: location_dispatch_zone
+ chained_journal_id: journal_gate_a
+ chained_location_type: customer
+ chained_auto_packing: manual
+ chained_picking_type: out
+-
+ !record {model: stock.location, id: location_pack_zone}:
+ name: Pack Zone
+ usage: internal
+ location_id: location_order
+ chained_journal_id: journal_pack
+ chained_location_id: location_gate_a
+ chained_location_type: fixed
+ chained_auto_packing: manual
+ chained_picking_type: internal
+-
+ !record {model: stock.location, id: location_gate_b}:
+ name: Gate B
+ usage: internal
+ location_id: location_dispatch_zone
+-
+ !record {model: stock.location.path, id: push_pick}:
+ name: Pick List
+ product_id: product.product_product_cpu3
+ journal_id: journal_pick
+ location_from_id: stock.stock_location_output
+ location_dest_id: location_pack_zone
+ picking_type: internal
+ auto: transparent
diff --git a/addons/stock_location/stock_location_view.xml b/addons/stock_location/stock_location_view.xml
index 49c3a808e70..eca4ade39fa 100644
--- a/addons/stock_location/stock_location_view.xml
+++ b/addons/stock_location/stock_location_view.xml
@@ -43,10 +43,11 @@
-
-
-
-
+
+
+
+
+
@@ -64,11 +65,12 @@
+
-
+
@@ -86,13 +88,14 @@
+
-
+
diff --git a/addons/stock_location/test/stock_location.yml b/addons/stock_location/test/stock_location.yml
deleted file mode 100644
index c5360ce67c5..00000000000
--- a/addons/stock_location/test/stock_location.yml
+++ /dev/null
@@ -1,270 +0,0 @@
-
--
- In order to test the stock location module, I will create product, locations, SO, warehouse.
-
--
- Creating a account.account.type record
--
- !record {model: account.account.type, id: account_account_type_asset0}:
- close_method: balance
- code: asset
- name: Asset
- sign: 1
-
-
--
- Creating a account.account.type record
--
- !record {model: account.account.type, id: account_account_type_income0}:
- close_method: unreconciled
- code: income
- name: Income
- sign: 1
-
-
--
- Creating a account.account.type record
--
- !record {model: account.account.type, id: account_account_type_expense0}:
- close_method: unreconciled
- code: expense
- name: Expense
- sign: 1
--
- Creating a account.account.type record
--
- !record {model: account.account.type, id: account_account_type_receivable0}:
- close_method: balance
- code: receivable
- name: Receivable
- sign: 1
--
-
- Creating a account.account record
--
- !record {model: account.account, id: account_account_receivable0}:
- code: '40000'
- company_id: base.main_company
- currency_mode: current
- name: Receivable
- parent_left: 1
- parent_right: 2
- type: receivable
- user_type: account_account_type_receivable0
--
- Creating a account.account record
--
- !record {model: account.account, id: account_account_payable0}:
- code: '440000'
- company_id: base.main_company
- currency_mode: current
- name: Payable
- parent_left: 3
- parent_right: 4
- type: payable
- user_type: account_account_type_expense0
--
- Creating a account.journal record
--
- !record {model: account.journal, id: account_journal_purchasejournal0}:
- code: pur
- company_id: base.main_company
- name: Purchase Journal
- sequence_id: account.sequence_purchase_journal
- type: purchase
- view_id: account.account_journal_bank_view
-
--
- Creating a account.journal record
--
- !record {model: account.journal, id: account_journal_salejouran0}:
- code: sal
- company_id: base.main_company
- name: Sale Jouran
- sequence_id: account.sequence_sale_journal
- type: sale
- view_id: account.account_journal_view
-
--
- Creating a account.account record
--
- !record {model: account.account, id: account_account_expenseaccount0}:
- code: Expe
- company_id: base.main_company
- currency_mode: current
- name: Expense Account
- parent_left: 5
- parent_right: 6
- type: consolidation
- user_type: account_account_type_asset0
--
- Creating a account.account record
--
- !record {model: account.account, id: account_account_productsale0}:
- code: '001'
- company_id: base.main_company
- currency_mode: current
- name: Product Sale
- type: other
- user_type: account_account_type_income0
-
--
- Creating a account.account record
--
- !record {model: account.account, id: account_account_productpurchase0}:
- code: '0002'
- company_id: base.main_company
- currency_mode: current
- name: Product Purchase
- type: other
- user_type: account_account_type_expense0
-
--
- Creating a res.partner record
--
- !record {model: res.partner, id: res_partner_shawtrust0}:
- address:
- - country_id: base.in
- - street: St James House, Vicar Lane, Sheffield
- lang: en_US
- name: 'Shaw Trust '
- property_account_payable: account_account_payable0
- property_account_receivable: account_account_receivable0
--
- Creating a res.partner record
--
- !record {model: res.partner, id: res_partner_diasorinltd0}:
- address:
- - country_id: base.in
- street: Ash House, Ash Road
- name: DiaSorin Ltd
- supplier: true
-
-
--
- Creating a res.partner record
--
- !record {model: res.partner, id: res_partner_microlinktechnologies0}:
- address:
- - street: Kailash Vaibhav, Parksite
- name: Micro Link Technologies
- property_account_payable: account_account_payable0
- property_account_receivable: account_account_receivable0
- supplier: true
-
--
- Creating a res.partner.address record
--
- !record {model: res.partner.address, id: res_partner_address_0}:
- country_id: base.in
- partner_id: res_partner_microlinktechnologies0
- street: Ash House, Ash Road
- title: base.res_partner_title_miss
-
-
--
- Creating a product.category record
--
- !record {model: product.category, id: product_category_computer0}:
- name: Computer
--
- Creating a stock.location record
--
- !record {model: stock.location, id: stock_location_suppiler0}:
- chained_auto_packing: auto
- chained_delay: 15
- chained_location_type: none
- company_id: base.main_company
- name: Suppiler1
- usage: supplier
--
-
- Creating a product.product record
--
- !record {model: product.product, id: product_product_hpcdwriters0}:
- categ_id: product_category_computer0
- cost_method: standard
- list_price: 1000.0
- mes_type: fixed
- name: HP CD writers
- procure_method: make_to_stock
- seller_ids:
- - delay: 1
- name: res_partner_shawtrust0
- min_qty: 5.0
- supply_method: buy
- type: product
- uom_id: product.product_uom_unit
- uom_po_id: product.product_uom_unit
- property_account_expense: account_account_productpurchase0
- property_account_income: account_account_productsale0
- path_ids:
- - auto: auto
- delay: 30
- location_dest_id: stock.location_inventory
- location_from_id: stock_location_suppiler0
- property_stock_inventory: stock.location_inventory
- property_stock_procurement: stock.location_procurement
- property_stock_production: stock.location_production
--
- Creating a stock.location record
--
- !record {model: stock.location, id: stock_location_suppiler0}:
- address_id: res_partner_address_0
- chained_auto_packing: manual
- chained_delay: 20
- chained_location_type: none
- company_id: base.main_company
- name: Suppiler 1
- usage: internal
--
- I create warehouse.
--
- !record {model: stock.warehouse, id: warehouse0}:
- company_id: base.main_company
- lot_input_id: stock.stock_location_stock
- lot_output_id: stock_location_suppiler0
- lot_stock_id: stock_location_suppiler0
- name: OpenERP S.A.
- partner_address_id: res_partner_address_0
--
- I create Sale order for HP CD writers.
--
- !record {model: sale.order, id: sale_order_01}:
- date_order: '2010-04-20'
- invoice_quantity: order
- name: Test/location
- order_line:
- - name: HP CD writers
- price_unit: 1000.0
- product_uom: product.product_uom_unit
- product_uom_qty: 5.0
- state: draft
- product_id: product_product_hpcdwriters0
- type: make_to_order
- order_policy: manual
- partner_id: base.res_partner_agrolait
- partner_invoice_id: base.res_partner_address_8
- partner_order_id: base.res_partner_address_8
- partner_shipping_id: base.res_partner_address_8
- 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_01}
--
- I check the delay mentioned in pushed flow in move.
--
- !python {model: stock.move}: |
- product_id=self.pool.get('product.product').search(cr,uid,[('name','=','HP CD writers')])
- location_id=self.pool.get('stock.location').search(cr,uid,[('name','=','Inventory loss')])
- move_ids =self.search(cr, uid, [('product_id','in',product_id),('location_dest_id','=',location_id)])
- if move_ids:
- move_obj=self.browse(cr,uid,move_ids)[0]
- import time
- from_dt = time.mktime(time.strptime(move_obj.date,'%Y-%m-%d %H:%M:%S'))
- to_dt = time.mktime(time.strptime(move_obj.date_planned,'%Y-%m-%d %H:%M:%S'))
- diff_day = (to_dt-from_dt)/(3600*24)
- assert (round(diff_day)+1 ==30)
diff --git a/addons/stock_location/test/stock_location_pull_flow.yml b/addons/stock_location/test/stock_location_pull_flow.yml
new file mode 100644
index 00000000000..a6f7a8e913a
--- /dev/null
+++ b/addons/stock_location/test/stock_location_pull_flow.yml
@@ -0,0 +1,226 @@
+-
+ In order to test the product pulled flow , I create ,partner,product,procurement
+-
+ I create a account type Asset.
+-
+ !record {model: account.account.type, id: account_account_type_asset0}:
+ close_method: balance
+ code: asset
+ name: Asset
+ sign: 1
+-
+ I create a account type income.
+-
+ !record {model: account.account.type, id: account_account_type_income0}:
+ close_method: unreconciled
+ code: income
+ name: Income
+ sign: 1
+-
+ I create a account type Expense.
+-
+ !record {model: account.account.type, id: account_account_type_expense0}:
+ close_method: unreconciled
+ code: expense
+ name: Expense
+ sign: 1
+-
+ I create a account type Receivable.
+-
+ !record {model: account.account.type, id: account_account_type_receivable0}:
+ close_method: balance
+ code: receivable
+ name: Receivable
+ sign: 1
+-
+
+ I create a account Receivable.
+-
+ !record {model: account.account, id: account_account_receivable0}:
+ code: '40000'
+ company_id: base.main_company
+ currency_mode: current
+ name: Receivable
+ parent_left: 1
+ parent_right: 2
+ type: receivable
+ user_type: account_account_type_receivable0
+-
+ I create a account Payable.
+-
+ !record {model: account.account, id: account_account_payable0}:
+ code: '440000'
+ company_id: base.main_company
+ currency_mode: current
+ name: Payable
+ parent_left: 3
+ parent_right: 4
+ type: payable
+ user_type: account_account_type_expense0
+-
+ I create a Purchase Journal.
+-
+ !record {model: account.journal, id: account_journal_purchasejournal0}:
+ code: pur
+ company_id: base.main_company
+ name: Purchase Journal
+ sequence_id: account.sequence_purchase_journal
+ type: purchase
+ view_id: account.account_journal_bank_view
+
+-
+ I create a Sale Journal.
+-
+ !record {model: account.journal, id: account_journal_salejouran0}:
+ code: sal
+ company_id: base.main_company
+ name: Sale Journal
+ sequence_id: account.sequence_sale_journal
+ type: sale
+ view_id: account.account_journal_view
+
+-
+ I create a Sale Journal.
+-
+ !record {model: account.account, id: account_account_expenseaccount0}:
+ code: Expe
+ company_id: base.main_company
+ currency_mode: current
+ name: Expense Account
+ parent_left: 5
+ parent_right: 6
+ type: consolidation
+ user_type: account_account_type_asset0
+-
+ I create Product Sale account.
+-
+ !record {model: account.account, id: account_account_productsale0}:
+ code: '001'
+ company_id: base.main_company
+ currency_mode: current
+ name: Product Sale
+ type: other
+ user_type: account_account_type_income0
+
+-
+ I create Product Product Purchase.
+-
+ !record {model: account.account, id: account_account_productpurchase0}:
+ code: '0002'
+ company_id: base.main_company
+ currency_mode: current
+ name: Product Purchase
+ type: other
+ user_type: account_account_type_expense0
+-
+ I create Supplier.
+-
+ !record {model: res.partner, id: res_partner_shawtrust0}:
+ address:
+ - country_id: base.in
+ - street: St James House, Vicar Lane, Sheffield
+ lang: en_US
+ name: 'Shaw Trust '
+ property_account_payable: account_account_payable0
+ property_account_receivable: account_account_receivable0
+-
+ I create product category.
+-
+ !record {model: product.category, id: product_category_computer0}:
+ name: Computer
+-
+ I create product and define the pulled flow condition for stock move.
+ I set shipping type Sending Goods. and set Procurement type move.
+-
+ !record {model: product.product, id: product_product_hpcdwriters0}:
+ categ_id: product_category_computer0
+ cost_method: standard
+ list_price: 1000.0
+ mes_type: fixed
+ name: HP CD writers
+ procure_method: make_to_stock
+ seller_ids:
+ - delay: 1
+ name: res_partner_shawtrust0
+ min_qty: 5.0
+ supply_method: buy
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+ property_account_expense: account_account_productpurchase0
+ property_account_income: account_account_productsale0
+ flow_pull_ids:
+ - invoice_state: none
+ location_id: stock.stock_location_shop0
+ location_src_id: stock.stock_location_shop1
+ name: E001
+ partner_address_id: base.res_partner_address_2
+ picking_type: out
+ procure_method: make_to_stock
+ type_proc: move
+ - invoice_state: none
+ location_id: stock.stock_location_shop1
+ location_src_id: stock.stock_location_suppliers
+ name: E002
+ partner_address_id: base.res_partner_address_7
+ picking_type: out
+ procure_method: make_to_stock
+ type_proc: move
+ - invoice_state: none
+ location_id: stock.stock_location_suppliers
+ location_src_id: stock.stock_location_stock
+ name: E003
+ type_proc: buy
+ property_stock_inventory: stock.location_inventory
+ property_stock_procurement: stock.location_procurement
+ property_stock_production: stock.location_production
+ qty_available: 15
+-
+ I create procurement order.
+-
+ !record {model: procurement.order, id: procurement_order_test0}:
+ company_id: base.main_company
+ date_planned: '2010-10-07 18:24:24'
+ location_id: stock.stock_location_shop0
+ name: Testing pulled flow
+ priority: '1'
+ procure_method: make_to_order
+ product_id: product_product_hpcdwriters0
+ product_qty: 5.0
+ product_uom: product.product_uom_unit
+ product_uos: product.product_uom_unit
+ product_uos_qty: 0.0
+-
+ I confirm procurement order.
+-
+ !workflow {model: procurement.order, action: button_confirm, ref: procurement_order_test0}
+-
+ I launch the scheduler to compute procurement.
+-
+ !python {model: procurement.order.compute.all}: |
+ proc_obj = self.pool.get('procurement.order')
+ proc_obj._procure_confirm(cr,uid)
+-
+ I check the state of procurement order is cancel and stock move is cancel.
+-
+ !python {model: procurement.order }: |
+ from tools.translate import _
+ procurement_ids=self.search(cr, uid, [('id', '=', ref('procurement_order_test0'))])
+ if procurement_ids:
+ order=self.browse(cr,uid,procurement_ids)[0]
+ assert(order.state=='cancel')
+-
+ I check the new of procurement order create .
+-
+ !python {model: procurement.order }: |
+ from tools.translate import _
+ procurement_ids=self.search(cr, uid, [('name','=','E001')])
+ assert len(procurement_ids), "Procurement order hasn't Created."
+-
+ I check the Outgoing Picking is create for source location Shop 2 and destination shop1.
+-
+ !python {model: stock.picking }: |
+ from tools.translate import _
+ picking_id = self.search(cr, uid, [('origin','=','Testing pulled flow:E001'),('type','=','out')])
+ assert len(picking_id), "Picking hasn't Created."
+
\ No newline at end of file
diff --git a/addons/stock_location/test/stock_location_push_flow.yml b/addons/stock_location/test/stock_location_push_flow.yml
new file mode 100644
index 00000000000..3f473026c8b
--- /dev/null
+++ b/addons/stock_location/test/stock_location_push_flow.yml
@@ -0,0 +1,134 @@
+-
+ In order to test the product pushed flow , I create account ,partner,product,shipment
+ Push flow specification indicates which location is chained with which location.
+-
+ I create product category.
+-
+ !record {model: product.category, id: product_category_computer0}:
+ name: Computer
+
+-
+ I create Supplier.
+-
+ !record {model: res.partner, id: res_partner_microlinktechnologies0}:
+ address:
+ - street: Kailash Vaibhav, Parksite
+ name: Micro Link Technologies
+ property_account_payable: account_account_payable0
+ property_account_receivable: account_account_receivable0
+ supplier: true
+
+-
+ I create Supplier address.
+-
+ !record {model: res.partner.address, id: res_partner_address_0}:
+ country_id: base.in
+ partner_id: res_partner_microlinktechnologies0
+ street: Ash House, Ash Road
+ title: base.res_partner_title_miss
+
+-
+ I create product and define the pushed flow .
+-
+ I set the chain location Supplier to stock Input
+ Stock Input to Quality test and Quality test -Stock .
+-
+ !record {model: product.product, id: product_product_hpcdwriters0}:
+ categ_id: product_category_computer0
+ cost_method: standard
+ list_price: 1000.0
+ mes_type: fixed
+ name: HP CD writers
+ procure_method: make_to_stock
+ seller_ids:
+ - delay: 1
+ name: res_partner_microlinktechnologies0
+ min_qty: 5.0
+ path_ids:
+ - auto: auto
+ invoice_state: none
+ location_dest_id: stock.stock_location_stock
+ location_from_id: stock.stock_location_suppliers
+ - auto: auto
+ invoice_state: none
+ location_dest_id: stock_location.stock_location_qualitytest0
+ location_from_id: stock.stock_location_stock
+ - auto: auto
+ invoice_state: none
+ location_dest_id: stock.stock_location_stock
+ location_from_id: stock_location.stock_location_qualitytest0
+ supply_method: buy
+ type: product
+ uom_id: product.product_uom_unit
+ uom_po_id: product.product_uom_unit
+ property_stock_inventory: stock.location_inventory
+ property_stock_procurement: stock.location_procurement
+ property_stock_production: stock.location_production
+-
+ In order to test pushed flow .I buy the product from Micro Link Technologies supplier. I create a Picking.
+-
+ !record {model: stock.picking , id: stock_picking_in0}:
+ address_id: res_partner_address_0
+ company_id: base.main_company
+ invoice_state: none
+ move_lines:
+ - date_expected: '2010-10-08 15:36:53'
+ location_dest_id: stock.stock_location_stock
+ location_id: stock.stock_location_suppliers
+ name: 'HP CD writers'
+ product_id: product_product_hpcdwriters0
+ product_qty: 6.0
+ product_uom: product.product_uom_unit
+ product_uos_qty: 6.0
+ name: Pushed Flow Test
+ type: in
+-
+ I confirm picking.
+-
+ !python {model: stock.picking }: |
+ self.draft_force_assign(cr, uid, [ref("stock_picking_in0")], {"lang": "en_US",
+ "search_default_available": 1, "tz": False, "active_model": "ir.ui.menu",
+ "contact_display": "partner_address", "active_ids": [ref("stock.menu_action_picking_tree4")],
+ "active_id": ref("stock.menu_action_picking_tree4"), })
+-
+ I check that the outgoing order of the supplier is create with two move line.
+ Stock/Input To Quality test and Quality test To Stock.
+-
+ I check the move is in waiting state.
+-
+ !python {model: stock.picking }: |
+ from tools.translate import _
+ picking_id = self.search(cr, uid, [('origin','=','Pushed Flow Test'),('type','=','out')])
+ if picking_id:
+ pick=self.browse(cr,uid,picking_id[0])
+ for move in pick.move_lines:
+ assert(move.state == 'waiting'), _('Stock is not in waiting state')
+-
+ I receive the order of the supplier Micro Link Technologies from the Incoming Shipments menu.
+-
+ !python {model: stock.picking }: |
+ import time
+ picking_id = self.search(cr, uid, [('address_id.partner_id','=',ref('res_partner_microlinktechnologies0')),('type','=','in')])
+ if picking_id:
+ pick=self.browse(cr,uid,picking_id[0])
+ move =pick.move_lines[0]
+ partial_datas = {
+ 'partner_id':pick.address_id.partner_id.id,
+ 'address_id': pick.address_id.id,
+ 'delivery_date' : time.strftime('%Y-%m-%d'),
+ }
+ partial_datas['move%s'%(move.id)]= {
+ 'product_id': move.product_id.id,
+ 'product_qty': move.product_qty,
+ 'product_uom': move.product_uom.id,
+ }
+ self.do_partial(cr, uid, picking_id,partial_datas)
+-
+ I check the Outgoing Orders is automatically done.
+-
+ !python {model: stock.picking }: |
+ from tools.translate import _
+ picking_id = self.search(cr, uid, [('origin','=','Pushed Flow Test'),('type','=','out')])
+ if picking_id:
+ pick=self.browse(cr,uid,picking_id[0])
+ assert(pick.state == 'done'), _('Picking is not in done state')
diff --git a/addons/stock_no_autopicking/test/stock_no_autopicking.yml b/addons/stock_no_autopicking/test/stock_no_autopicking.yml
index 9732e17194c..34e20eeb6c4 100644
--- a/addons/stock_no_autopicking/test/stock_no_autopicking.yml
+++ b/addons/stock_no_autopicking/test/stock_no_autopicking.yml
@@ -86,7 +86,7 @@
-
!record {model: mrp.routing, id: mrp_routing_productionrouting0}:
name: Production Routing
- location_id: stock.stock_location_13
+ location_id: stock.stock_location_stock
workcenter_lines:
- cycle_nbr: 1.0
hour_nbr: 0.5
diff --git a/addons/stock_planning/stock_planning.py b/addons/stock_planning/stock_planning.py
index 9d9102d67b3..546e83e0053 100644
--- a/addons/stock_planning/stock_planning.py
+++ b/addons/stock_planning/stock_planning.py
@@ -691,7 +691,7 @@ class stock_planning(osv.osv):
'name': _('MPS(') + str(user.login) +') '+ obj.period_id.name,
'picking_id': picking_id,
'product_id': obj.product_id.id,
- 'date_planned': obj.period_id.date_start,
+ 'date': obj.period_id.date_start,
'product_qty': uom_qty,
'product_uom': uom,
'product_uos_qty': uos_qty,
diff --git a/addons/survey/report/survey_analysis_report.py b/addons/survey/report/survey_analysis_report.py
index c95bd33ac32..0d866368bf2 100644
--- a/addons/survey/report/survey_analysis_report.py
+++ b/addons/survey/report/survey_analysis_report.py
@@ -29,7 +29,6 @@ from report import report_sxw
class survey_analysis(report_rml):
def create(self, cr, uid, ids, datas, context):
-
surv_obj = pooler.get_pool(cr.dbname).get('survey')
user_obj = pooler.get_pool(cr.dbname).get('res.users')
rml_obj=report_sxw.rml_parse(cr, uid, surv_obj._name,context)
@@ -46,9 +45,6 @@ class survey_analysis(report_rml):
"""+to_xml(rml_obj.formatLang(time.strftime("%Y-%m-%d %H:%M:%S"),date_time=True))+"""
"""+ to_xml(company.name) +"""
-
- /
-
1.3cm 28.1cm 20cm 28.1cm
@@ -426,6 +422,7 @@ class survey_analysis(report_rml):
rml += """"""
report_type = datas.get('report_type', 'pdf')
create_doc = self.generators[report_type]
+ self.internal_header=True
pdf = create_doc(rml, title=self.title)
return (pdf, report_type)
diff --git a/addons/survey/report/survey_browse_response.py b/addons/survey/report/survey_browse_response.py
index a8bfa906c90..2cdb98622a9 100644
--- a/addons/survey/report/survey_browse_response.py
+++ b/addons/survey/report/survey_browse_response.py
@@ -273,7 +273,7 @@ class survey_browse_response(report_rml):
style = 'tbl_white'
else:
style = 'tbl_gainsboro'
- i +=1
+ i +=1
rml += """"""
table_data = col_heading.browse(cr, uid, col_heading.search(cr, uid, [('response_table_id', '=', answer[0].id), ('name', '=', row)]))
for column in matrix_ans:
@@ -521,7 +521,6 @@ class survey_browse_response(report_rml):
report_type = datas.get('report_type', 'pdf')
create_doc = self.generators[report_type]
pdf = create_doc(rml, title=self.title)
-
return (pdf, report_type)
survey_browse_response('report.survey.browse.response', 'survey','','')
diff --git a/addons/survey/report/survey_form.py b/addons/survey/report/survey_form.py
index 5a7d5e283e3..1a623db4211 100644
--- a/addons/survey/report/survey_form.py
+++ b/addons/survey/report/survey_form.py
@@ -390,7 +390,6 @@ class survey_form(report_rml):
report_type = datas.get('report_type', 'pdf')
create_doc = self.generators[report_type]
pdf = create_doc(rml, title=self.title)
-
return (pdf, report_type)
survey_form('report.survey.form', 'survey','','')
diff --git a/addons/wiki_faq/i18n/de.po b/addons/wiki_faq/i18n/de.po
index 24579de9728..b7849cc39cf 100644
--- a/addons/wiki_faq/i18n/de.po
+++ b/addons/wiki_faq/i18n/de.po
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2010-08-20 11:42+0000\n"
-"PO-Revision-Date: 2010-10-10 10:53+0000\n"
-"Last-Translator: Ferdinand @ ChriCar \n"
+"PO-Revision-Date: 2010-10-11 07:19+0000\n"
+"Last-Translator: Ferdinand-chricar \n"
"Language-Team: German \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-10-11 04:45+0000\n"
+"X-Launchpad-Export-Date: 2010-10-12 04:51+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: wiki_faq
diff --git a/addons/wiki_quality_manual/i18n/de.po b/addons/wiki_quality_manual/i18n/de.po
index c0925029a28..c0b73038993 100644
--- a/addons/wiki_quality_manual/i18n/de.po
+++ b/addons/wiki_quality_manual/i18n/de.po
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2010-08-20 11:48+0000\n"
-"PO-Revision-Date: 2010-10-10 10:54+0000\n"
-"Last-Translator: Ferdinand @ ChriCar \n"
+"PO-Revision-Date: 2010-10-11 07:19+0000\n"
+"Last-Translator: Ferdinand-chricar \n"
"Language-Team: German \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-10-11 04:45+0000\n"
+"X-Launchpad-Export-Date: 2010-10-12 04:51+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: wiki_quality_manual
diff --git a/addons/wiki_sale_faq/i18n/de.po b/addons/wiki_sale_faq/i18n/de.po
index bb66a8e23a4..a1e54fc3646 100644
--- a/addons/wiki_sale_faq/i18n/de.po
+++ b/addons/wiki_sale_faq/i18n/de.po
@@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2010-08-20 11:54+0000\n"
-"PO-Revision-Date: 2010-10-10 10:55+0000\n"
-"Last-Translator: Ferdinand @ ChriCar \n"
+"PO-Revision-Date: 2010-10-11 07:18+0000\n"
+"Last-Translator: Ferdinand-chricar \n"
"Language-Team: German \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2010-10-11 04:45+0000\n"
+"X-Launchpad-Export-Date: 2010-10-12 04:51+0000\n"
"X-Generator: Launchpad (build Unknown)\n"
#. module: wiki_sale_faq