Browse Source

Merge remote-tracking branch 'origin/9.0' into 9.0-S0023-Elise

pull/14/head
EliseDup 9 years ago
parent
commit
c33521f876
  1. 2
      beesdoo_base/__openerp__.py
  2. 12
      beesdoo_coda/wizard/import_coda.py
  3. 2
      beesdoo_pos/__openerp__.py
  4. 3
      beesdoo_product/models/beesdoo_product.py

2
beesdoo_base/__openerp__.py

@ -15,7 +15,7 @@
'category': 'Project Management',
'version': '0.1',
'depends': ['point_of_sale'],
'depends': ['point_of_sale', 'purchase'],
'data': [
'security/groups.xml',

12
beesdoo_coda/wizard/import_coda.py

@ -33,7 +33,7 @@ class CodaBankStatementImport(models.TransientModel):
'partner_name': move.counterparty_name, #ok
'ref': move.ref,
'sequence': sequence, #ok
'unique_import_id' : statement.coda_seq_number + '-' + statement.creation_date + '-' + move.ref
'unique_import_id' : statement.coda_seq_number + '-' + statement.old_balance_date + '-' + statement.new_balance_date + '-' + move.ref
}
return move_data
@ -48,6 +48,14 @@ class CodaBankStatementImport(models.TransientModel):
}
return statement_data
def _get_acc_number(self, acc_number):
#Check if we match the exact acc_number or the end of an acc number
journal = self.env['account.journal'].search([('bank_acc_number', '=like', '%' + acc_number)])
if not journal or len(journal) > 1: #if not found or ambiguious
return acc_number
return journal.bank_acc_number
def _parse_file(self, data_file):
parser = Parser()
try:
@ -66,4 +74,4 @@ class CodaBankStatementImport(models.TransientModel):
for move in statement.movements:
statement_data['transactions'].append(self._get_move_value(move, statement, len(statement_data['transactions']) + 1))
return currency_code, account_number, stmts_vals
return currency_code, self._get_acc_number(account_number), stmts_vals

2
beesdoo_pos/__openerp__.py

@ -20,7 +20,7 @@
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['point_of_sale', 'beesdoo_base'],
'depends': ['beesdoo_base', 'beesdoo_product'],
# always loaded
'data': [

3
beesdoo_product/models/beesdoo_product.py

@ -42,7 +42,8 @@ class BeesdooProduct(models.Model):
@api.one
@api.depends('taxes_id', 'list_price', 'taxes_id.amount', 'taxes_id.tax_group_id', 'total_with_vat', 'display_weight', 'weight')
def _get_total(self):
consignes_group = self.env.ref('beesdoo_product.consignes_group_tax')
consignes_group = self.env.ref('beesdoo_product.consignes_group_tax', raise_if_not_found=False)
tax_amount_sum = sum([tax._compute_amount(self.list_price, self.list_price) for tax in self.taxes_id if tax.tax_group_id != consignes_group])
self.total_deposit = sum([tax._compute_amount(self.list_price, self.list_price) for tax in self.taxes_id if tax.tax_group_id == consignes_group])
self.total_with_vat = self.list_price + tax_amount_sum

Loading…
Cancel
Save