Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8.0 pep8 v7 forward port #33

Closed
wants to merge 56 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
0ca4175
In account_easy_reconcile, now write-off entries can be created with …
guewen Mar 27, 2014
c45e47d
Improvement on the account_statement_base_import module to have profi…
pedrobaeza Jul 2, 2014
beea3e1
Create README.md
pedrobaeza Jul 2, 2014
59234d8
Merge pull request #9 from lepistone/7.0-account_easy_reconcile-analy…
lepistone Jul 11, 2014
56f6818
Merge pull request #4 from pedrobaeza/7.0-bank-statement-reconcile-pr…
pedrobaeza Jul 14, 2014
2971f66
[imp] auto reconcile: commit every 10 lines
lepistone Jul 15, 2014
8193d5d
refactor as suggested by @guewen
lepistone Jul 15, 2014
7b735ac
Merge pull request #12 from lepistone/easy_reconcile_commit
bwrsandman Jul 16, 2014
8f5861e
Add meta files
bwrsandman Jul 16, 2014
e5cfdfc
Add account-financial-tools dependency
bwrsandman Jul 16, 2014
3bf9710
allow to configure reconcile_commit_every
lepistone Jul 16, 2014
5c0f812
easy auto reconcile: commit at the end
lepistone Jul 16, 2014
996dea7
I'm a contributor, not an author
lepistone Jul 16, 2014
a1245da
Add ofxparse python dependency
bwrsandman Jul 16, 2014
1d1ae57
Merge pull request #15 from lepistone/easy_reconcile_commit_settings
lepistone Jul 16, 2014
1a96b22
Add logging during reconcile
guewen Jul 18, 2014
f40fe31
Wrong count of credit lines
guewen Jul 18, 2014
c6e8ea5
[FIX] API Improvement
florian-dacosta Jul 23, 2014
30525cf
fix docstring
florian-dacosta Jul 23, 2014
a61698b
fix docstring
florian-dacosta Jul 23, 2014
f6c5967
Merge pull request #19 from guewen/advanced-reconcile-logging
yvaucher Jul 28, 2014
d081f6c
Merge pull request #13 from bwrsandman/7.0-metafiles
yvaucher Jul 31, 2014
c1cf75d
[FIX] travis: update travis file to match the one in https://github.c…
lmignon Aug 1, 2014
bf46411
[FIX] travis: exclude account_statement_ext_point_of_sale (addon with…
lmignon Aug 1, 2014
18eb190
Merge pull request #25 from acsone/7.0-fix-travis
pedrobaeza Aug 1, 2014
7022628
[IMP] account_statement_base_import: Fill balance start when parser d…
pedrobaeza Aug 4, 2014
69c0e16
[FIX] Correct call order
pedrobaeza Aug 4, 2014
8e20a45
Merge pull request #22 from florian-dacosta/api_improvement
pedrobaeza Aug 4, 2014
2c1773e
Merge pull request #27 from pedrobaeza/7.0-import_start_balance_null
pedrobaeza Aug 4, 2014
44a59ce
autopep8
pedrobaeza Aug 4, 2014
2ec18f7
[IMP] account_statement_transactionid_import: Fix PEP8
pedrobaeza Aug 4, 2014
4a1c950
[IMP] account_easy_reconcile: Fix PEP8
pedrobaeza Aug 4, 2014
5072c71
[IMP] statement_voucher_killer: Fix PEP8
pedrobaeza Aug 4, 2014
f1e0b78
[IMP] account_advanced_reconcile: Fix PEP8
pedrobaeza Aug 4, 2014
c6298b0
[IMP] account_statement_base_completion: Fix PEP8
pedrobaeza Aug 4, 2014
b3c1aa9
[IMP] account_statement_so_completion: Fix PEP8
pedrobaeza Aug 4, 2014
5e98a81
[IMP] account_statement_ext_voucher: Fix PEP8
pedrobaeza Aug 4, 2014
d0a06fd
[IMP] account_statement_one_move: Fix PEP8
pedrobaeza Aug 4, 2014
66af054
[IMP] account_statement_ext_point_of_sale: Fix PEP8
pedrobaeza Aug 4, 2014
d64122c
[IMP] account_statement_regex_account_completion: Fix PEP8
pedrobaeza Aug 4, 2014
602d39d
[IMP] account_statement_completion_label: Fix PEP8
pedrobaeza Aug 4, 2014
aebcbfd
[IMP] account_invoice_reference: Fix PEP8
pedrobaeza Aug 4, 2014
d9a943d
[IMP] account_statement_base_import: Fix PEP8
pedrobaeza Aug 4, 2014
a851336
[IMP] account_statement_transactionid_completion: Fix PEP8
pedrobaeza Aug 4, 2014
6ccd6f4
[IMP] account_statement_commission: Fix PEP8
pedrobaeza Aug 4, 2014
9facd19
[IMP] account_statement_no_invoice_import: Fix PEP8
pedrobaeza Aug 4, 2014
5f0628b
[IMP] account_statement_ofx_import: Fix PEP8
pedrobaeza Aug 4, 2014
48e03e6
[IMP] account_advanced_reconcile_transaction_ref: Fix PEP8
pedrobaeza Aug 4, 2014
5cfa975
[IMP] account_statement_completion_voucher: Fix PEP8
pedrobaeza Aug 4, 2014
85d139f
[IMP] account_statement_completion_voucher: Fix PEP8
pedrobaeza Aug 4, 2014
b94bebe
[IMP] account_statement_bankaccount_completion: Fix PEP8
pedrobaeza Aug 4, 2014
b522f28
Fix Travis errors
pedrobaeza Aug 4, 2014
4e13e0e
F401 remaining
pedrobaeza Aug 4, 2014
a33cfa6
Fix multiline docstring param
pedrobaeza Aug 5, 2014
c0cbab8
Merge pull request #31 from pedrobaeza/7.0-pep8_fix
pedrobaeza Aug 6, 2014
8496d84
Merge remote-tracking branch 'upstream/7.0' into 8.0-port-base-import
lmignon Aug 6, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[IMP] account_statement_ext_point_of_sale: Fix PEP8
  • Loading branch information
pedrobaeza committed Aug 4, 2014
commit 66af054fa3602668efeab557bb343d6d079a0060
70 changes: 35 additions & 35 deletions account_statement_ext_point_of_sale/point_of_sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.addons.point_of_sale.point_of_sale import pos_session as std_pos_session
from openerp.osv import orm, osv
from openerp.addons.point_of_sale.point_of_sale import pos_session as \
std_pos_session
from openerp.osv import orm
from openerp.tools.translate import _

if not hasattr(std_pos_session, '_prepare_bank_statement'):
Expand All @@ -34,7 +35,8 @@
# which _inherit pos.session
#
# This change has been proposed for merging to fix lp:125375
def mp_prepare_bank_statement(self, cr, uid, pos_config, journal, context=None):
def mp_prepare_bank_statement(self, cr, uid, pos_config, journal,
context=None):
bank_values = {
'journal_id': journal.id,
'user_id': uid,
Expand All @@ -47,9 +49,9 @@ def mp_create(self, cr, uid, values, context=None):
config_id = values.get('config_id', False) or context.get(
'default_config_id', False)
if not config_id:
raise osv.except_osv(_('Error!'),
_("You should assign a Point of Sale to your session."))

raise orm.except_orm(
_('Error!'),
_("You should assign a Point of Sale to your session."))
# journal_id is not required on the pos_config because it does not
# exists at the installation. If nothing is configured at the
# installation we do the minimal configuration. Impossible to do in
Expand All @@ -62,26 +64,27 @@ def mp_create(self, cr, uid, values, context=None):
cr, uid, ['journal_id'], context=context)['journal_id']
if jid:
jobj.write(
cr, uid, [pos_config.id], {'journal_id': jid}, context=context)
cr, uid, [pos_config.id], {'journal_id': jid},
context=context)
else:
raise osv.except_osv(_('error!'),
_("Unable to open the session. You have to assign a sale journal to your point of sale."))

raise orm.except_orm(
_('error!'),
_("Unable to open the session. You have to assign a sale "
"journal to your point of sale."))
# define some cash journal if no payment method exists
if not pos_config.journal_ids:
journal_proxy = self.pool.get('account.journal')
cashids = journal_proxy.search(
cr, uid, [('journal_user', '=', True), ('type', '=', 'cash')], context=context)
cr, uid, [('journal_user', '=', True),
('type', '=', 'cash')], context=context)
if not cashids:
cashids = journal_proxy.search(
cr, uid, [('type', '=', 'cash')], context=context)
if not cashids:
cashids = journal_proxy.search(
cr, uid, [('journal_user', '=', True)], context=context)

jobj.write(
cr, uid, [pos_config.id], {'journal_ids': [(6, 0, cashids)]})

pos_config = jobj.browse(cr, uid, config_id, context=context)
bank_statement_ids = []
for journal in pos_config.journal_ids:
Expand All @@ -90,42 +93,39 @@ def mp_create(self, cr, uid, values, context=None):
statement_id = self.pool.get('account.bank.statement').create(
cr, uid, bank_values, context=context)
bank_statement_ids.append(statement_id)

values.update({
'name': pos_config.sequence_id._next(),
'statement_ids': [(6, 0, bank_statement_ids)],
'config_id': config_id
})
return super(std_pos_session, self).create(cr, uid, values, context=context)

return super(std_pos_session, self).create(cr, uid, values,
context=context)
std_pos_session._prepare_bank_statement = mp_prepare_bank_statement
std_pos_session.create = mp_create


class pos_session(orm.Model):
class PosSession(orm.Model):
_inherit = 'pos.session'

def _prepare_bank_statement(self, cr, uid, pos_config, journal, context=None):
""" Override the function _mp_create. To add the bank profile to the statement

Function That was previously added to pos.session model using monkey patching

def _prepare_bank_statement(self, cr, uid, pos_config, journal,
context=None):
""" Override the function _mp_create. To add the bank profile to the
statement.
Function That was previously added to pos.session model using monkey
patching.
"""

bank_values = super(pos_session, self)._prepare_bank_statement(cr, uid,
pos_config,
journal, context)
user_obj = self.pool.get('res.users')
profile_obj = self.pool.get('account.statement.profile')
bank_values = super(PosSession, self)._prepare_bank_statement(
cr, uid, pos_config, journal, context)
user_obj = self.pool['res.users']
profile_obj = self.pool['account.statement.profile']
user = user_obj.browse(cr, uid, uid, context=context)
defaults = self.pool['account.bank.statement'].default_get(cr, uid,
['profile_id',
'period_id'],
context=context)
profile_ids = profile_obj.search(cr, uid,
[('company_id', '=', user.company_id.id),
('journal_id', '=', bank_values['journal_id'])],
context=context)
defaults = self.pool['account.bank.statement'].default_get(
cr, uid, ['profile_id', 'period_id'], context=context)
profile_ids = profile_obj.search(
cr, uid, [('company_id', '=', user.company_id.id),
('journal_id', '=', bank_values['journal_id'])],
context=context)
if profile_ids:
defaults['profile_id'] = profile_ids[0]
bank_values.update(defaults)
Expand Down