@@ -288,13 +276,7 @@
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/addons/account/project/report/quantity_cost_ledger.py b/addons/account/project/report/quantity_cost_ledger.py
index c593d05566e..4d874fe50ee 100644
--- a/addons/account/project/report/quantity_cost_ledger.py
+++ b/addons/account/project/report/quantity_cost_ledger.py
@@ -102,7 +102,7 @@ class account_analytic_quantity_cost_ledger(report_sxw.rml_parse):
def _sum_quantity(self, accounts, date1, date2, journals):
ids = map(lambda x: x.id, accounts)
- if not len(ids):
+ if not ids:
return 0.0
if not journals:
self.cr.execute("SELECT sum(unit_amount) \
diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py
index 22b04e05f39..457ce7bb27f 100644
--- a/addons/account/report/account_aged_partner_balance.py
+++ b/addons/account/report/account_aged_partner_balance.py
@@ -62,7 +62,6 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
def _get_lines(self, form):
res = []
- account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
self.cr.execute('SELECT DISTINCT res_partner.id AS id,\
res_partner.name AS name \
FROM res_partner,account_move_line AS l, account_account\
@@ -71,7 +70,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
OR (reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND (l.partner_id=res_partner.id)\
AND ' + self.query + ' \
- ORDER BY res_partner.name' , (self.date_from,))
+ ORDER BY res_partner.name', (self.date_from,))
partners = self.cr.dictfetchall()
## mise a 0 du total
for i in range(7):
@@ -97,7 +96,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND ' + self.query + '\
AND account_account.active\
- GROUP BY partner_id ' , (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids), self.date_from))
+ GROUP BY partner_id ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids), self.date_from))
t = self.cr.fetchall()
for i in t:
totals[i[0]] = i[1]
@@ -132,7 +131,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND '+ self.query + '\
AND account_account.active\
- GROUP BY l.partner_id' , (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids), self.date_from))
+ GROUP BY l.partner_id', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, tuple(partner_ids), self.date_from))
t = self.cr.fetchall()
for i in t:
future_past[i[0]] = i[1]
@@ -141,7 +140,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
# Each history will contain : history[1] = {'': }
history = []
for i in range(5):
- args_list = (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids) ,self.date_from,)
+ args_list = (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids),self.date_from,)
dates_query = '(COALESCE(l.date_maturity,l.date)'
if form[str(i)]['start'] and form[str(i)]['stop']:
dates_query += ' BETWEEN %s AND %s)'
@@ -154,7 +153,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
args_list += (form[str(i)]['stop'],)
self.cr.execute('SELECT l.partner_id, SUM(l.debit-l.credit)\
- FROM account_move_line AS l, account_account , account_move am \
+ FROM account_move_line AS l, account_account, account_move am \
WHERE (l.account_id = account_account.id) AND (l.move_id=am.id)\
AND (am.state IN %s)\
AND (account_account.type IN %s)\
@@ -164,7 +163,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
AND '+ self.query + '\
AND account_account.active\
AND ' + dates_query + '\
- GROUP BY l.partner_id' , args_list)
+ GROUP BY l.partner_id', args_list)
t = self.cr.fetchall()
d = {}
for i in t:
@@ -219,7 +218,6 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
def _get_lines_with_out_partner(self, form):
res = []
- account_move_line_obj = pooler.get_pool(self.cr.dbname).get('account.move.line')
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted']
@@ -229,7 +227,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
self.total_account.append(0)
totals = {}
self.cr.execute('SELECT SUM(l.debit-l.credit) \
- FROM account_move_line AS l, account_account , account_move am \
+ FROM account_move_line AS l, account_account, account_move am \
WHERE (l.account_id = account_account.id) AND (l.move_id=am.id)\
AND (am.state IN %s)\
AND (l.partner_id IS NULL)\
@@ -237,7 +235,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
AND ((l.reconcile_id IS NULL) \
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND ' + self.query + '\
- AND account_account.active ' ,(tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from))
+ AND account_account.active ',(tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from))
t = self.cr.fetchall()
for i in t:
totals['Unknown Partner'] = i[0]
@@ -268,7 +266,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
AND ((l.reconcile_id IS NULL)\
OR (l.reconcile_id IN (SELECT recon.id FROM account_move_reconcile AS recon WHERE recon.create_date > %s )))\
AND '+ self.query + '\
- AND account_account.active ' , (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from))
+ AND account_account.active ', (tuple(move_state), tuple(self.ACCOUNT_TYPE), self.date_from, self.date_from))
t = self.cr.fetchall()
for i in t:
future_past['Unknown Partner'] = i[0]
@@ -288,7 +286,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
args_list += (form[str(i)]['stop'],)
self.cr.execute('SELECT SUM(l.debit-l.credit)\
- FROM account_move_line AS l, account_account , account_move am \
+ FROM account_move_line AS l, account_account, account_move am \
WHERE (l.account_id = account_account.id) AND (l.move_id=am.id)\
AND (am.state IN %s)\
AND (account_account.type IN %s)\
@@ -298,7 +296,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header):
AND '+ self.query + '\
AND account_account.active\
AND ' + dates_query + '\
- GROUP BY l.partner_id' , args_list)
+ GROUP BY l.partner_id', args_list)
t = self.cr.fetchall()
d = {}
for i in t:
diff --git a/addons/account/report/account_analytic_entries_report.py b/addons/account/report/account_analytic_entries_report.py
index aa0c5b3ba99..a53e19721dd 100644
--- a/addons/account/report/account_analytic_entries_report.py
+++ b/addons/account/report/account_analytic_entries_report.py
@@ -33,7 +33,7 @@ class analytic_entries_report(osv.osv):
'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),
- 'user_id' : fields.many2one('res.users', 'User',readonly=True),
+ 'user_id': fields.many2one('res.users', 'User',readonly=True),
'name': fields.char('Description', size=64, readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner'),
'company_id': fields.many2one('res.company', 'Company', required=True),
diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml
index 34d23826e80..6f1094599b5 100644
--- a/addons/account/report/account_analytic_entries_report_view.xml
+++ b/addons/account/report/account_analytic_entries_report_view.xml
@@ -56,18 +56,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -83,6 +72,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py
index 236433819c5..5a6c7700b9d 100644
--- a/addons/account/report/account_balance.py
+++ b/addons/account/report/account_balance.py
@@ -86,7 +86,7 @@ class account_balance(report_sxw.rml_parse, common_report_header):
self.sum_debit += account_rec['debit']
self.sum_credit += account_rec['credit']
if disp_acc == 'bal_movement':
- if res['credit'] > 0 or res['debit'] > 0 or res['balance'] > 0 :
+ if res['credit'] > 0 or res['debit'] > 0 or res['balance'] > 0:
self.result_acc.append(res)
elif disp_acc == 'bal_solde':
if res['balance'] != 0:
diff --git a/addons/account/report/account_balance_landscape.py b/addons/account/report/account_balance_landscape.py
index 04f7cc8ec7f..6ec7ec7c10e 100644
--- a/addons/account/report/account_balance_landscape.py
+++ b/addons/account/report/account_balance_landscape.py
@@ -139,7 +139,7 @@ class account_balance_landscape(rml_parse.rml_parse):
ctx['state'] = form['context'].get('state','all')
tmp = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx.copy())
- if len(tmp):
+ if tmp:
accounts.append(tmp)
merged_accounts=zip(*accounts)
@@ -198,7 +198,7 @@ class account_balance_landscape(rml_parse.rml_parse):
ctx['state'] = form['context'].get('state','all')
tmp1 = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx.copy())
- if len(tmp1):
+ if tmp1:
accounts.append(tmp1)
if level==1: #if parent is called,done is not empty when called again.
diff --git a/addons/account/report/account_balance_sheet_horizontal.rml b/addons/account/report/account_balance_sheet_horizontal.rml
index 08b9030a968..bde0d2786d0 100644
--- a/addons/account/report/account_balance_sheet_horizontal.rml
+++ b/addons/account/report/account_balance_sheet_horizontal.rml
@@ -233,7 +233,7 @@
[[ '. '*(a['level']-1) ]][[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]
- [[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[ formatLang(abs(a['balance'])) ]] [[ company.currency_id.symbol ]]
+ [[ a['level1']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[(a['code'] and a['name']) and formatLang(abs(a['balance'])) or removeParentNode('font')]] [[ company.currency_id.symbol ]]
diff --git a/addons/account/report/account_central_journal.py b/addons/account/report/account_central_journal.py
index bf5164253cc..35f1e666c6f 100644
--- a/addons/account/report/account_central_journal.py
+++ b/addons/account/report/account_central_journal.py
@@ -71,11 +71,12 @@ class journal_print(report_sxw.rml_parse, common_report_header):
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted']
- self.cr.execute('SELECT a.currency_id ,a.code, a.name, c.code AS currency_code,l.currency_id ,l.amount_currency ,SUM(debit) AS debit, SUM(credit) AS credit \
+
+ self.cr.execute('SELECT a.currency_id ,a.code, a.name, c.code AS currency_code, l.currency_id, l.amount_currency, SUM(debit) AS debit, SUM(credit) AS credit \
from account_move_line l \
LEFT JOIN account_move am ON (l.move_id=am.id) \
LEFT JOIN account_account a ON (l.account_id=a.id) \
- LEFT JOIN res_currency c on (l.currency_id=c.id) WHERE am.state IN %s AND l.period_id=%s AND l.journal_id=%s '+self.query_get_clause+' GROUP BY a.id, a.code, a.name,l.amount_currency,c.code , a.currency_id,l.currency_id', (tuple(move_state), period_id, journal_id))
+ LEFT JOIN res_currency c on (l.currency_id=c.id) WHERE am.state IN %s AND l.period_id=%s AND l.journal_id=%s '+self.query_get_clause+' GROUP BY a.id, a.code, a.name,l.amount_currency,c.code, a.currency_id,l.currency_id', (tuple(move_state), period_id, journal_id))
return self.cr.dictfetchall()
def _set_get_account_currency_code(self, account_id):
@@ -91,12 +92,12 @@ class journal_print(report_sxw.rml_parse, common_report_header):
def _get_account(self, data):
if data['model'] == 'account.journal.period':
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).company_id.name
- return super(journal_print ,self)._get_account(data)
+ return super(journal_print,self)._get_account(data)
def _get_fiscalyear(self, data):
if data['model'] == 'account.journal.period':
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).fiscalyear_id.name
- return super(journal_print ,self)._get_fiscalyear(data)
+ return super(journal_print,self)._get_fiscalyear(data)
def _display_currency(self, data):
if data['model'] == 'account.journal.period':
diff --git a/addons/account/report/account_central_journal.rml b/addons/account/report/account_central_journal.rml
index 1045470b2f2..28cb68fcce3 100644
--- a/addons/account/report/account_central_journal.rml
+++ b/addons/account/report/account_central_journal.rml
@@ -283,7 +283,7 @@
Balance
- [[ display_currency(data) or removeParentNode('blockTable') ]]
+ [[ display_currency(data) or removeParentNode('blockTable') ]]
[[ line['currency_id'] and formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]
+
[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'] ) ]] [[ line['currency_code'] or '' ]]
diff --git a/addons/account/report/account_general_ledger.py b/addons/account/report/account_general_ledger.py
index f3ec97a592e..e13604c4219 100644
--- a/addons/account/report/account_general_ledger.py
+++ b/addons/account/report/account_general_ledger.py
@@ -117,15 +117,15 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
sold_account = self._sum_balance_account(child_account)
self.sold_accounts[child_account.id] = sold_account
if self.display_account == 'bal_movement':
- if child_account.type != 'view' and num_entry <> 0 :
+ if child_account.type != 'view' and num_entry <> 0:
res.append(child_account)
elif self.display_account == 'bal_solde':
- if child_account.type != 'view' and num_entry <> 0 :
+ if child_account.type != 'view' and num_entry <> 0:
if ( sold_account <> 0.0):
res.append(child_account)
else:
res.append(child_account)
- if not len(res):
+ if not res:
return [account]
return res
@@ -161,7 +161,7 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
else:
sql_sort='l.date'
sql = """
- SELECT l.id AS lid, l.date AS ldate, j.code AS lcode, l.amount_currency,l.ref AS lref, l.name AS lname, COALESCE(l.debit,0) AS debit, COALESCE(l.credit,0) AS credit, l.period_id AS lperiod_id, l.partner_id AS lpartner_id,
+ SELECT l.id AS lid, l.date AS ldate, j.code AS lcode, l.currency_id,l.amount_currency,l.ref AS lref, l.name AS lname, COALESCE(l.debit,0) AS debit, COALESCE(l.credit,0) AS credit, l.period_id AS lperiod_id, l.partner_id AS lpartner_id,
m.name AS move_name, m.id AS mmove_id,
c.symbol AS currency_code,
i.id AS invoice_id, i.type AS invoice_type, i.number AS invoice_number,
diff --git a/addons/account/report/account_general_ledger.rml b/addons/account/report/account_general_ledger.rml
index 6ac6cd51286..917ffa214d8 100644
--- a/addons/account/report/account_general_ledger.rml
+++ b/addons/account/report/account_general_ledger.rml
@@ -334,7 +334,7 @@
[[ formatLang(line['amount_currency'] or '') ]] [[ line['currency_code'] or '']]
+
[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']]
[[ (line['currency_id']==None or line['amount_currency']==None) and removeParentNode('font') ]] [[ formatLang(line['amount_currency'])]] [[ line['currency_code'] or '']]
diff --git a/addons/account/report/account_journal.py b/addons/account/report/account_journal.py
index 4f6ad99792d..ab7b6211064 100644
--- a/addons/account/report/account_journal.py
+++ b/addons/account/report/account_journal.py
@@ -84,7 +84,7 @@ class journal_print(report_sxw.rml_parse, common_report_header):
if self.target_move == 'posted':
move_state = ['posted']
- self.cr.execute('SELECT SUM(debit) FROM account_move_line l , account_move am '
+ self.cr.execute('SELECT SUM(debit) FROM account_move_line l, account_move am '
'WHERE l.move_id=am.id AND am.state IN %s AND l.period_id IN %s AND l.journal_id IN %s ' + self.query_get_clause + ' ',
(tuple(move_state), tuple(period_id), tuple(journal_id)))
return self.cr.fetchone()[0] or 0.0
@@ -121,7 +121,7 @@ class journal_print(report_sxw.rml_parse, common_report_header):
if self.target_move == 'posted':
move_state = ['posted']
- self.cr.execute('SELECT l.id FROM account_move_line l, account_move am WHERE l.move_id=am.id AND am.state IN %s AND l.period_id=%s AND l.journal_id IN %s ' + self.query_get_clause + ' ORDER BY l.'+ self.sort_selection + '' ,(tuple(move_state), period_id, tuple(journal_id) ))
+ self.cr.execute('SELECT l.id FROM account_move_line l, account_move am WHERE l.move_id=am.id AND am.state IN %s AND l.period_id=%s AND l.journal_id IN %s ' + self.query_get_clause + ' ORDER BY l.'+ self.sort_selection + '',(tuple(move_state), period_id, tuple(journal_id) ))
ids = map(lambda x: x[0], self.cr.fetchall())
return obj_mline.browse(self.cr, self.uid, ids)
@@ -138,12 +138,12 @@ class journal_print(report_sxw.rml_parse, common_report_header):
def _get_fiscalyear(self, data):
if data['model'] == 'account.journal.period':
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).fiscalyear_id.name
- return super(journal_print ,self)._get_fiscalyear(data)
+ return super(journal_print, self)._get_fiscalyear(data)
def _get_account(self, data):
if data['model'] == 'account.journal.period':
return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).company_id.name
- return super(journal_print ,self)._get_account(data)
+ return super(journal_print, self)._get_account(data)
def _display_currency(self, data):
if data['model'] == 'account.journal.period':
diff --git a/addons/account/report/account_partner_balance.py b/addons/account/report/account_partner_balance.py
index 06baa4639eb..c17de597e1c 100644
--- a/addons/account/report/account_partner_balance.py
+++ b/addons/account/report/account_partner_balance.py
@@ -83,7 +83,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
full_account = []
result_tmp = 0.0
self.cr.execute(
- "SELECT p.ref,l.account_id,ac.name AS account_name,ac.code AS code ,p.name, sum(debit) AS debit, sum(credit) AS credit, " \
+ "SELECT p.ref,l.account_id,ac.name AS account_name,ac.code AS code,p.name, sum(debit) AS debit, sum(credit) AS credit, " \
"CASE WHEN sum(debit) > sum(credit) " \
"THEN sum(debit) - sum(credit) " \
"ELSE 0 " \
@@ -254,7 +254,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
"JOIN account_move am ON (am.id = l.move_id)" \
"WHERE l.account_id IN %s" \
"AND am.state IN %s" \
- "AND " + self.query + "" ,
+ "AND " + self.query + "",
(tuple(self.account_ids), tuple(move_state)))
temp_res = float(self.cr.fetchone()[0] or 0.0)
return temp_res
@@ -273,7 +273,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
"JOIN account_move am ON (am.id = l.move_id)" \
"WHERE l.account_id IN %s" \
"AND am.state IN %s" \
- "AND " + self.query + "" ,
+ "AND " + self.query + "",
(tuple(self.account_ids), tuple(move_state)))
temp_res = float(self.cr.fetchone()[0] or 0.0)
return temp_res
diff --git a/addons/account/report/account_partner_ledger.rml b/addons/account/report/account_partner_ledger.rml
index 3eef3270dd5..ae273ba5647 100644
--- a/addons/account/report/account_partner_ledger.rml
+++ b/addons/account/report/account_partner_ledger.rml
@@ -289,7 +289,7 @@
Ref.
- [[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]]
+ [[ (line['account_id']['type'] == 'receivable' and formatLang(line['debit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['credit'] * -1) or ' ') ]]
- [[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]]
+ [[ (line['account_id']['type'] == 'receivable' and formatLang(line['credit']) or 0) or (line['account_id']['type'] == 'payable' and formatLang(line['debit'] * -1) or 0) ]]
- [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]]
+ [[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['debit'] or 0) or (y['account_id']['type'] == 'payable' and y['credit'] * -1 or 0)), getLines(o), 0))) ]]
[[ formatLang((reduce(lambda x, y: x + ((y['account_id']['type'] == 'receivable' and y['credit'] or 0) or (y['account_id']['type'] == 'payable' and y['debit'] * -1 or 0)), getLines(o), 0))) ]]
@@ -220,6 +222,8 @@
- [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[ formatLang(abs(a['balance1'])) ]] [[ company.currency_id.symbol ]]
+ [[ a['level']<4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]][[(a['code1'] and a['name1']) and formatLang(abs(a['balance1'])) or removeParentNode('font') ]] [[ company.currency_id.symbol ]]
-
-
-
-
-
-
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
+
+
+
+
@@ -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.formboard.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 Ordersir.actions.act_windowprocurement.orderform
- {'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 Exceptionsir.actions.act_windowprocurement.orderformtree,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 Exceptionsir.actions.act_window
@@ -136,26 +153,6 @@
formtree,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..831e07b726f 100644
--- a/addons/procurement/schedulers.py
+++ b/addons/procurement/schedulers.py
@@ -23,6 +23,7 @@ import time
from mx import DateTime
from osv import osv
+from tools.translate import _
import netsvc
import pooler
@@ -170,8 +171,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 +237,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 Price2
@@ -166,6 +160,9 @@ parameter) will see those record just disappear.
Stock Weight2
-
+
+ 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 @@
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 @@
formtree,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.treereport.stock.inventorytree
-
+
+
-
-
+
+
@@ -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 @@
formtree,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 @@
-
+
@@ -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 Packingsstock.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 Inventorystock.fill.inventoryform
-
-
+
+
+
-
+
-
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_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..a54e6a485c2 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,
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 += """