Skip to content

Commit

Permalink
Fix completion rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ecino committed Sep 25, 2015
1 parent 77eda24 commit 95b5a4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion account_reconcile_compassion/model/bank_statement_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ def _create_invoice_from_mv_lines(self, mv_line_dicts, invoice=None):

# Generate a unique bvr_reference
ref = self.ref
if not ref or len(ref) < 26:
if ref and len(ref) > 27:
ref = mod10r(ref[:26])
elif len(ref) < 26:
ref = mod10r((self.date.replace('-', '') + str(
self.statement_id.id) + str(self.id)).ljust(26, '0'))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
##############################################################################

from openerp import api, exceptions, models, fields
from openerp import api, models, fields
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT as DF
from openerp.addons.sponsorship_compassion.model.product import \
GIFT_CATEGORY, GIFT_NAMES
Expand Down Expand Up @@ -221,8 +221,8 @@ def get_from_amount(self, st_line):

def get_from_lsv_dd(self, st_line):
""" If line is a LSV or DD credit, change the account to 1098. """
label = st_line.ref.replace('\n', ' ') if st_line.ref != '/' else \
st_line.name.replace('\n', ' ')
label = st_line.name.replace('\n', ' ') if st_line.name != '/' else \
st_line.ref.replace('\n', ' ')
lsv_dd_strings = [u'BULLETIN DE VERSEMENT ORANGE',
u'ORDRE DEBIT DIRECT',
u'Crèdit LSV']
Expand Down Expand Up @@ -260,12 +260,12 @@ def get_from_move_line_ref(self, st_line):

def get_sponsor_name(self, st_line):
res = {}
reference = st_line.ref
name = st_line.name
sender_lines = []

sender_lines.append(reference.replace('\n', ' ').split(
sender_lines.append(name.replace('\n', ' ').split(
' EXPÉDITEUR: '.decode('utf8')))
sender_lines.append(reference.replace('\n', ' ').split(
sender_lines.append(name.replace('\n', ' ').split(
" DONNEUR D'ORDRE: ".decode('utf8')))

id_line1 = 1 if len(sender_lines[0]) > 1 else False
Expand Down

0 comments on commit 95b5a4e

Please sign in to comment.